From 368e4a5f0cb8fafc319d386ccee9029f35a557b4 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sun, 15 Apr 2018 18:20:23 +0200 Subject: [PATCH] Added some UX behavior --- Site/Pages/v5/Ledgers/AccountPlan.aspx | 27 +++++++++++++++++------ Site/Pages/v5/Ledgers/AccountPlan.aspx.cs | 14 ++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Site/Pages/v5/Ledgers/AccountPlan.aspx b/Site/Pages/v5/Ledgers/AccountPlan.aspx index b1795637..e135eecd 100644 --- a/Site/Pages/v5/Ledgers/AccountPlan.aspx +++ b/Site/Pages/v5/Ledgers/AccountPlan.aspx @@ -527,6 +527,15 @@ } + function onToggleChange(newValue, cookie) { + if (newValue) { + $(".DivEditAutomationControls").slideDown(); + } else { + $(".DivEditAutomationControls").slideUp(); + } + } + + var currentYear = <%=DateTime.Today.Year %>; var firstFiscalYear = <%=CurrentOrganization.FirstFiscalYear %>; var ledgersClosedUntil = <%=CurrentOrganization.Parameters.FiscalBooksClosedUntilYear %>; @@ -574,6 +583,10 @@ font-weight:500; } + .DivEditAutomaticRetrievalCredentials, .DivEditAutomationProfileCustom, .DivEditAutomationControls, .DivEditForexControls { + display: none; + } + @@ -617,15 +630,15 @@
- +
-
+
-
+
-
+
@@ -650,12 +663,12 @@ Enable account automation

-
+
Custom Profile XML
-
+
Automatic Retrieval
-
+
Autoretrieval Username
Autoretrieval Password
diff --git a/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs b/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs index fa46f6a6..def4da8c 100644 --- a/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs +++ b/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Globalization; using System.Web; using System.Web.Services; +using System.Web.UI.WebControls; using Resources; using Swarmops.Common.Enums; using Swarmops.Logic.Financial; @@ -94,6 +95,15 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers this.LabelSidebarOptions.Text = Resources.Global.Sidebar_Options; this.LabelOptionsShowInactive.Text = String.Format(Resources.Pages.Ledgers.AccountPlan_Options_ShowInactive, inactiveCount); + + this.DropAccountAutomationProfile.Items.Add(new ListItem(Resources.Global.Global_SelectOne, "0")); + + // Hardcoded automation profiles for the time being + + this.DropAccountAutomationProfile.Items.Add(new ListItem("[CZ CZK] Fio CSV", "3")); + this.DropAccountAutomationProfile.Items.Add(new ListItem("[DE EUR] Postbank CSV", "2")); + this.DropAccountAutomationProfile.Items.Add(new ListItem("[SE SEK] SEB CSV", "1")); + } PageAccessRequired = new Access (CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Write); DbVersionRequired = 2; // Account reparenting @@ -512,6 +522,10 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers } } + [WebMethod] + public static bool ToggleSwitch () + + [WebMethod] public static bool SetAccountSwitch (int accountId, string switchName, bool switchValue) {