Deploying to test live and on to style on Chrome
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Json-ExpensableBudgetsTree.aspx.cs" Inherits="Pages_v5_Finance_Json_ExpensableBudgetsTree" %>
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Activizr.Logic.Financial;
|
||||
using Activizr.Logic.Pirates;
|
||||
using Activizr.Logic.Security;
|
||||
using Activizr.Logic.Structure;
|
||||
|
||||
public partial class Pages_v5_Finance_Json_ExpensableBudgetsTree : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Current authentication
|
||||
|
||||
string identity = HttpContext.Current.User.Identity.Name;
|
||||
string[] identityTokens = identity.Split(',');
|
||||
|
||||
string userIdentityString = identityTokens[0];
|
||||
string organizationIdentityString = identityTokens[1];
|
||||
|
||||
int currentUserId = Convert.ToInt32(userIdentityString);
|
||||
int currentOrganizationId = Convert.ToInt32(organizationIdentityString);
|
||||
|
||||
Person currentUser = Person.FromIdentity(currentUserId);
|
||||
Authority authority = currentUser.GetAuthority();
|
||||
Organization currentOrganization = Organization.FromIdentity(currentOrganizationId);
|
||||
|
||||
// Get accounts
|
||||
|
||||
FinancialAccounts accounts = currentOrganization.FinancialAccounts.ExpensableAccounts;
|
||||
|
||||
// Build tree (there should be a template for this)
|
||||
|
||||
Dictionary<int, List<FinancialAccount>> treeMap = new Dictionary<int, List<FinancialAccount>>();
|
||||
|
||||
foreach (FinancialAccount account in accounts)
|
||||
{
|
||||
if (!treeMap.ContainsKey(account.ParentIdentity))
|
||||
{
|
||||
treeMap[account.ParentIdentity] = new List<FinancialAccount>();
|
||||
}
|
||||
|
||||
treeMap[account.ParentIdentity].Add(account);
|
||||
}
|
||||
|
||||
Response.ContentType = "application/json";
|
||||
|
||||
Response.Output.WriteLine(RecurseTreeMap (treeMap, 0));
|
||||
|
||||
Response.End();
|
||||
}
|
||||
|
||||
private string RecurseTreeMap (Dictionary<int, List<FinancialAccount>> treeMap, int node)
|
||||
{
|
||||
List<string> elements = new List<string>();
|
||||
|
||||
foreach (FinancialAccount account in treeMap[node])
|
||||
{
|
||||
string element = string.Format("\"id\":{0},\"text\":\"{1}\"", account.Identity,
|
||||
account.Name.Replace("\"", "'"));
|
||||
|
||||
if (treeMap.ContainsKey(account.Identity))
|
||||
{
|
||||
element += ",\"children\":" + RecurseTreeMap(treeMap, account.Identity);
|
||||
}
|
||||
|
||||
elements.Add("{" + element + "}");
|
||||
}
|
||||
|
||||
return "[" + String.Join(",", elements.ToArray()) + "]";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="RequestCashAdvance.aspx.cs" Inherits="Pages_v5_Finance_RequestCashAdvance" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHead" Runat="Server">
|
||||
</asp:Content>
|
||||
<script src="http://hostedscripts.falkvinge.net/easyui/jquery.easyui.min.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">␍ <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">␍</asp:Content>
|
||||
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
|
||||
<div class="entryFields">
|
||||
<asp:TextBox runat="server" ID="TextAmount" CssClass="alignRight" /> <br/>
|
||||
<asp:TextBox runat="server" ID="TextPurpose" /> <br/>
|
||||
<asp:DropDownList runat="server" ID="DropBudgets"/> <br/>
|
||||
<select class="easyui-combotree" url="Json-ExpensableBudgetsTree.aspx" name="DropBudgets" style="width:300px"></select> <br/>
|
||||
<br/><!-- placeholder for label-side H2 -->
|
||||
<asp:TextBox runat="server" ID="TextBank" /> <br/>
|
||||
<asp:TextBox runat="server" ID="TextClearing" /> <br/>
|
||||
|
||||
@@ -24,18 +24,6 @@ public partial class Pages_v5_Finance_RequestCashAdvance : PageV5Base
|
||||
this.TextAccount.Text = this.CurrentUser.BankAccount;
|
||||
this.TextAmount.Text = 0.ToString("N2");
|
||||
this.TextAmount.Focus();
|
||||
|
||||
// Prime budget dropdown
|
||||
|
||||
this.DropBudgets.Items.Clear();
|
||||
this.DropBudgets.Items.Add(new ListItem(Resources.Global.Global_DropInits_SelectFinancialAccount, "0"));
|
||||
|
||||
FinancialAccounts accounts = this.CurrentOrganization.FinancialAccounts.ExpensableAccounts;
|
||||
|
||||
foreach (FinancialAccount account in accounts)
|
||||
{
|
||||
this.DropBudgets.Items.Add(new ListItem(account.Name, account.Identity.ToString(CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,6 +431,11 @@ span.loginalphabetasign
|
||||
top: -2px;
|
||||
left: -2px;
|
||||
box-shadow: 2px 2px 4px #7F5500;
|
||||
background: #FFC34D;
|
||||
background: -moz-linear-gradient(top, #FFD580, #FFC34D);
|
||||
background: -webkit-linear-gradient(top, #FFD580, #FFC34D);
|
||||
background: linear-gradient(top, #FFD580, #FFC34D);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -521,11 +526,16 @@ span.loginalphabetasign
|
||||
padding: 0px 10px 0px 15px;
|
||||
}
|
||||
|
||||
.entryFields input:not(.buttonAccentColor), .entryFields textarea, .entryFields select
|
||||
.entryFields input:not(.buttonAccentColor), .entryFields textarea
|
||||
{
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.entryFields select {
|
||||
width: 330px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.entryFields input:not(.buttonAccentColor):focus, .entryFields textarea:focus, .entryFields select:focus
|
||||
{
|
||||
background: #F0F6FF;
|
||||
|
||||
Reference in New Issue
Block a user