From c74e2e3d2c95c983fd4e610b065160513e540dbd Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 18 Feb 2014 13:41:37 +0000 Subject: [PATCH] Minor cosmetics, Account Plan --- Site5/Images/Icons/iconshock-warning-16px.png | Bin 0 -> 598 bytes .../Icons/iconshock-warning-16x12px.png | Bin 0 -> 449 bytes .../v5/Ledgers/Json-AccountPlanData.aspx.cs | 24 +++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Site5/Images/Icons/iconshock-warning-16px.png create mode 100644 Site5/Images/Icons/iconshock-warning-16x12px.png diff --git a/Site5/Images/Icons/iconshock-warning-16px.png b/Site5/Images/Icons/iconshock-warning-16px.png new file mode 100644 index 0000000000000000000000000000000000000000..4565af53b75d4bd0d87c3a47aabbcfc525708d0e GIT binary patch literal 598 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE(}6TtKSRv1wTBrP7^6I0978NlFFj}LeK3`+{$vJ1xiWl&ng@y_YslD*rmJ8COk&HAnL zJm%fQ#e*a$I zzdybIN6Qze8=IpfzQO^*41~fcTiOOApA0}w&G<8L%=mgKenVMs|kNN zIrhjHgt@FT3i6sWJAKI%k5D&Z*E>24?tdA=%`M6{3p^5TQ%sa7+HUY~XZxE+=bD!l zGacE_Tx!lOA$PWHszz7GqK=iXm!IEzbKN3tcJD*+60)e_f;l9a@fRIB8oR3OD* zWMF8ZYhbKvWDsI#YGq(#Wn!pn0Av_=)!dzdq9HdwB{QuOsKLNe*U(7Uz%aznz{>l$ZPhF=Nz8%aE`zuA6JM$mxyN2jqT%j&1qhZew$n%&b`}X zlQ9_yuxdyn#&Iakihr6)tIEv3078=VPqRg;jG1Cl2ycs#0Nvn7#uH(YzEr;Xbtxn4 zw5kLq0$4TXbb|w5eh*bT7h0~0j8W7KRwp$$4K9QrRKk9?P_lqOnMXG`UsOnuFuJzV$!&=6!5qVQ&R00000NkvXXu0mjf3xK<@ literal 0 HcmV?d00001 diff --git a/Site5/Pages/v5/Ledgers/Json-AccountPlanData.aspx.cs b/Site5/Pages/v5/Ledgers/Json-AccountPlanData.aspx.cs index a1138823..600563b1 100644 --- a/Site5/Pages/v5/Ledgers/Json-AccountPlanData.aspx.cs +++ b/Site5/Pages/v5/Ledgers/Json-AccountPlanData.aspx.cs @@ -78,6 +78,28 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers continue; } + string ownerString = " "; + if (account.AccountType == FinancialAccountType.Income || account.AccountType == FinancialAccountType.Cost) + { + if (account.OwnerPersonId != 0) + { + // TODO: add zoom, write capability + + ownerString = + "" + + JsonSanitize(Server.HtmlEncode(account.Owner.Canonical)) + ""; + } + else + { + // TODO: add write capability + + ownerString = + "" + + JsonSanitize(Server.HtmlEncode(Resources.Global.Global_NoOwner)) + ""; + } + } + string grandChildren = GetAccountsRecurse(accountType, account.Identity); if (!string.IsNullOrEmpty(grandChildren)) { @@ -88,7 +110,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers childStrings.Add('{' + String.Format("\"id\":\"{0}\",\"accountName\":\"{1}\",\"owner\":\"{2}\",\"balance\":\"{3}\",\"budget\":\"{4}\"", account.Identity, Server.HtmlEncode(JsonSanitize(account.Name)), - account.OwnerPersonId != 0? "" + JsonSanitize(Server.HtmlEncode(account.Owner.Canonical)) + "" : JsonSanitize(Resources.Global.Global_NoOwner), + ownerString, _hashedAccounts[account.Identity].Count > 1 ? JsonDualString(account.Identity, _treeBalanceLookup[account.Identity], _singleBalanceLookup[account.Identity]) : (_singleBalanceLookup [account.Identity] / 100.0).ToString("N0"), account.AccountType == FinancialAccountType.Income || account.AccountType == FinancialAccountType.Cost? _hashedAccounts[account.Identity].Count > 1 ? (JsonDualString(account.Identity, _treeBudgetLookup[account.Identity], _singleBudgetLookup[account.Identity])) :