From 81bcb9fe73b2fb60db081a767ab11fb739bb3497 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 10 Sep 2016 20:23:06 +0200 Subject: [PATCH] Work on person editor --- Logic/Financial/Payouts.cs | 2 +- Site5/Automation/SwarmFunctions.aspx.cs | 46 +++++++ Site5/Controls/v5/Base/AjaxTextBox.ascx | 15 ++ Site5/Controls/v5/Base/ModalDialog.ascx | 4 +- .../Images/Icons/iconshock-location-256px.png | Bin 0 -> 54053 bytes Site5/Images/Icons/iconshock-mail-256px.png | Bin 0 -> 33979 bytes Site5/Master-v5.master | 129 +++++++++++++++--- Site5/Pages/v5/Financial/PayOutMoney.aspx | 2 + Site5/Style/style-v5.css | 1 + 9 files changed, 178 insertions(+), 21 deletions(-) create mode 100644 Site5/Images/Icons/iconshock-location-256px.png create mode 100644 Site5/Images/Icons/iconshock-mail-256px.png diff --git a/Logic/Financial/Payouts.cs b/Logic/Financial/Payouts.cs index 3416afdc..680a0e75 100644 --- a/Logic/Financial/Payouts.cs +++ b/Logic/Financial/Payouts.cs @@ -266,7 +266,7 @@ namespace Swarmops.Logic.Financial { BasicPayout basicPayout = new BasicPayout (0, organization.Identity, string.Empty, invoice.PayToAccount, - invoice.Ocr.Length > 0 ? "OCR " + invoice.Ocr : "Ref# " + invoice.InvoiceReference, + invoice.Ocr.Length > 0 ? invoice.Ocr : invoice.InvoiceReference, // prefer OCR (automatic) over Reference (manual) (Int64) (invoice.Amount*100), invoice.DueDate, false, DateTime.Now, 0); Payout payout = Payout.FromBasic (basicPayout); diff --git a/Site5/Automation/SwarmFunctions.aspx.cs b/Site5/Automation/SwarmFunctions.aspx.cs index a1c1a9a8..9a88c3fd 100644 --- a/Site5/Automation/SwarmFunctions.aspx.cs +++ b/Site5/Automation/SwarmFunctions.aspx.cs @@ -1,6 +1,7 @@ using System; using System.Activities.Statements; using System.Collections.Generic; +using System.EnterpriseServices.Internal; using System.Linq; using System.Web; using System.Web.Services; @@ -210,5 +211,50 @@ namespace Swarmops.Frontend.Automation GetAuthenticationDataAndCulture(); return new AjaxCallResult {Success = true, DisplayMessage = Geography.FromIdentity (geographyId).Name}; } + + public class PersonEditorData : AjaxCallResult + { + // Personal Details tab + + public string Name; + public string Mail; + public string Phone; + public string TwitterId; + + // Accounts tab + + // (no data) + + // other tabs - fill in as we go + } + + [WebMethod] + public static PersonEditorData GetPersonEditorData (int personId) + { + AuthenticationData authData = GetAuthenticationDataAndCulture(); + bool self = false; + + if (personId == 0) // request self record + { + self = true; // may make use of this later + personId = authData.CurrentUser.Identity; + } + + Person person = Person.FromIdentity (personId); + + if (!authData.Authority.CanSeePerson (person)) + { + throw new ArgumentException(); // can't see the requested person, for whatever reason + } + + return new PersonEditorData + { + Success = true, + Name = person.Name, + Mail = person.Mail, + Phone = person.Phone, + TwitterId = person.TwitterId + }; + } } } \ No newline at end of file diff --git a/Site5/Controls/v5/Base/AjaxTextBox.ascx b/Site5/Controls/v5/Base/AjaxTextBox.ascx index 2b868650..9a93f09d 100644 --- a/Site5/Controls/v5/Base/AjaxTextBox.ascx +++ b/Site5/Controls/v5/Base/AjaxTextBox.ascx @@ -78,6 +78,21 @@ }); + function <%=this.ClientID%>_clear() { + $('#<%=this.TextInput.ClientID%>').val(''); + } + + function <%=this.ClientID%>_setValue(newValue) { + $('#<%=this.TextInput.ClientID%>').val(newValue); + } + + function <%=this.ClientID%>_initialize(initValue) { + $('#<%=this.TextInput.ClientID%>').val(initValue); + _initVal_<%=this.TextInput.ClientID%> = initValue; + } + + + diff --git a/Site5/Controls/v5/Base/ModalDialog.ascx b/Site5/Controls/v5/Base/ModalDialog.ascx index 912e9bb5..53b45313 100644 --- a/Site5/Controls/v5/Base/ModalDialog.ascx +++ b/Site5/Controls/v5/Base/ModalDialog.ascx @@ -59,8 +59,8 @@ -