Work on person editor
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<asp:TextBox ID="TextInput" runat="server" />
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div id="<%=this.ClientID %>_hiddenInitArea" class="box modal" style="visibility:hidden">
|
||||
<div class="divInitializedContent">
|
||||
<div id="<%=this.ClientID %>_hiddenInitArea" class="box modal" style="visibility:hidden; width: 960px"> <!-- width necessary for correct init -->
|
||||
<div class="divInitializedContent" >
|
||||
<asp:PlaceHolder runat="server" ID="PlaceHolderDialog" />
|
||||
</div>
|
||||
</div>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
+111
-18
@@ -220,61 +220,154 @@
|
||||
|
||||
<Swarmops5:ModalDialog ID="ModalMasterEditPerson" runat="server">
|
||||
<DialogCode>
|
||||
<h2>Work in progress...</h2>
|
||||
<div id="divTabsEditPerson" class="easyui-tabs" data-options="tabWidth:70,tabHeight:70">
|
||||
<div title="<img src='/Images/Icons/iconshock-redshirt-128px.png' width='64' height='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Account</h2>
|
||||
<div class="entryFields">...</div>
|
||||
<div class="entryFields">
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonName" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonMail" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonPhone" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonTwitterId" runat="server" />
|
||||
</div>
|
||||
<div class="entryLabels">
|
||||
Name<br/>
|
||||
Mail
|
||||
Mail<br/>
|
||||
Phone<br/>
|
||||
Twitter<br/>
|
||||
</div>
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-lock-256px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Security</h2>
|
||||
<div class="entryFields">...</div>
|
||||
<div class="entryLabels">
|
||||
Current Password<br/>
|
||||
New Password<br/>
|
||||
New Password Again<br/>
|
||||
<br/>
|
||||
<h2>TWO FACTOR AUTHENTICATION</h2>
|
||||
Enable BitId (bitcoin signature login)
|
||||
Enable BitId (bitcoin signature login)<br/>
|
||||
Enter current password to save
|
||||
</div>
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-switch-red-64px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Preferences</h2>
|
||||
</div>
|
||||
<div title="<img src='/Images/PageIcons/iconshock-money-calculator-128px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Payment Channels</h2>
|
||||
</div>
|
||||
<div title="<img src='/Images/PageIcons/iconshock-moneybag-128px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Payment History</h2>
|
||||
</div>
|
||||
<!--
|
||||
<div title="<img src='/Images/Icons/iconshock-foreman-128px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Role and Responsibility</h2>
|
||||
TODO
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-mail-256px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Mail Account</h2>
|
||||
<div class="divEntryFields">
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonOrgMail" runat="server" />​<br/>
|
||||
</div>
|
||||
<div class="entryLabels">
|
||||
Organization mail account<br/>
|
||||
Reset mail server password
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div title="<img src='/Images/Icons/iconshock-location-256px.png' width='64' height='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Address</h2>
|
||||
<div class="entryFields">...</div>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonCountry" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonStreet1" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonStreet2" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonPostalCodeCity" runat="server" />
|
||||
<div class="entryLabels">
|
||||
Country<br/>
|
||||
Street 1<br/>
|
||||
Street 2<br/>
|
||||
Postal code, city
|
||||
</div>
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-mail-open-64px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Mail Preferences</h2>
|
||||
<div class="entryFields">
|
||||
Switch1
|
||||
Switch2
|
||||
Switch3
|
||||
Switch4
|
||||
</div>
|
||||
<div class="entryLabels">
|
||||
Recieve mail from local leaders<br/>
|
||||
Receive organization newsletters<br/>
|
||||
Receive membership accounting info<br/>
|
||||
Receive security alerts
|
||||
</div>
|
||||
</div>
|
||||
<div title="<img src='/Images/PageIcons/iconshock-moneybag-128px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Payment Channels</h2>
|
||||
<div class="entryFields">
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonLegacyBankClearing" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonLegacyBankAccount" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonLegacyBankHolder" runat="server" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonLegacyBitcoinAddress" runat="server" />​<br/>
|
||||
Switch1​<br/>
|
||||
Switch2
|
||||
</div>
|
||||
<div class="entryLabels">
|
||||
Legacy bank SWIFT/BIC/clearing<br/>
|
||||
Legacy bank IBAN/account<br/>
|
||||
Account holder name<br/>
|
||||
Bitcoin address<br/>
|
||||
Prefer bitcoin for expenses/advances<br/>
|
||||
Prefer bitcoin for salaries
|
||||
</div>
|
||||
</div>
|
||||
<div title="<img src='/Images/PageIcons/iconshock-money-calculator-128px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Payment History</h2>
|
||||
TABLE
|
||||
</div>
|
||||
<div title="<img src='/Images/PageIcons/iconshock-award-96px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Achievements</h2>
|
||||
TABLE
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-logfile-256px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: System Log</h2>
|
||||
TABLE
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-notes-256px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Officer Notes</h2>
|
||||
</div>
|
||||
FREETEXT FIELD
|
||||
</div>-->
|
||||
</div>
|
||||
</DialogCode>
|
||||
</Swarmops5:ModalDialog>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
// This JavaScript block is for the Master Modal Person Editor.
|
||||
|
||||
function masterBeginEditPerson(personId) {
|
||||
_master_PersonEditedId = personId;
|
||||
|
||||
// Disable saving on change
|
||||
// Clear fields
|
||||
_master_PersonEditLoading = true;
|
||||
|
||||
// Clear fields, mark disabled until data retrieved
|
||||
|
||||
<%=this.ModalMasterEditPerson.ClientID%>_open();
|
||||
|
||||
var personEditorData = {
|
||||
personId: personId
|
||||
};
|
||||
|
||||
SwarmopsJS.ajaxCall('/Automation/SwarmFunctions.aspx/GetPersonEditorData', personEditorData, function(data) {
|
||||
if (data.Success) {
|
||||
<%= this.MasterEditPersonName.ClientID %>_initialize(data.Name);
|
||||
<%= this.MasterEditPersonMail.ClientID %>_initialize(data.Mail);
|
||||
<%= this.MasterEditPersonPhone.ClientID %>_initialize(data.Phone);
|
||||
<%= this.MasterEditPersonTwitterId.ClientID %>_initialize(data.TwitterId);
|
||||
} else {
|
||||
alert('Call to SwarmFunctions.aspx failed');
|
||||
}
|
||||
});
|
||||
|
||||
// Begin ajax query for data
|
||||
|
||||
// If success, populate; enable saving on change
|
||||
// If secvio, notify
|
||||
}
|
||||
|
||||
var _master_PersonEditedId = -1; // no person: zero means "self"
|
||||
var _master_PersonEditLoading = false;
|
||||
|
||||
</script>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -196,6 +196,8 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
});
|
||||
|
||||
var gridsLoaded = 0;
|
||||
|
||||
@@ -638,6 +638,7 @@ body.rtl .button-orange {
|
||||
|
||||
div.modal .entryFields {
|
||||
margin-right: 3px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
body.rtl .entryFields {
|
||||
|
||||
Reference in New Issue
Block a user