Testing some new mechanisms on Mono

This commit is contained in:
Rick Falkvinge
2013-11-02 10:11:21 +00:00
parent 5516ea2066
commit af2a23e881
4 changed files with 26 additions and 10 deletions
@@ -238,6 +238,10 @@
<data name="FileExpenseClaim_UploadRecieptImages" xml:space="preserve">
<value>Upload Receipt Images:</value>
</data>
<data name="FileExpenseClaim_ValidationError_MissingTag" xml:space="preserve">
<value>Please select an option as indicated.</value>
<comment>Very general as tags may be many things.</comment>
</data>
<data name="PayOutMoney_GridHeader_Amount" xml:space="preserve">
<value>Amount</value>
<comment>Amount to be paid out</comment>
@@ -42,10 +42,18 @@
if ($('#<%=this.ComboBudgets.ClientID %>_DropBudgets').combotree('tree').tree('getSelected') == null) {
isValid = false;
$('#<%=this.ComboBudgets.ClientID %>_DropBudgets').addClass("entryError");
$('#<%=this.ComboBudgets.ClientID %>_SpanBudgets').addClass("entryError");
alertify.error("<asp:Literal runat="server" ID="LiteralErrorBudget" />");
}
<asp:Repeater ID="RepeaterErrorCheckTags" runat="server"><ItemTemplate>
if ($('#DropTags<%# Eval("TagSetId") %>').combotree('tree').tree('getSelected') == null) {
isValid = false;
$('#SpanDropTags<%# Eval("TagSetId") %>').addClass("entryError");
alertify.error('<%=Resources.Pages.Financial.FileExpenseClaim_ValidationError_MissingTag.Replace("'", "''") %>');
}
</ItemTemplate></asp:Repeater>
isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', "<asp:Literal runat="server" ID="LiteralErrorPurpose" />") && isValid;
$.ajax({
@@ -15,22 +15,21 @@ namespace Swarmops.Frontend.Pages.v5.Financial
protected void Page_Init(object sender, EventArgs e)
{
string tagSetIdsString = Request.Form["HiddenTagSetIdentifiers"];
int[] tagSetIds;
// Find our tag ids, either from previously hidden var or load from org
if (String.IsNullOrEmpty(tagSetIdsString))
{
tagSetIds = FinancialTransactionTagSets.ForOrganization(this.CurrentOrganization).Identities;
_tagSetIds = FinancialTransactionTagSets.ForOrganization(this.CurrentOrganization).Identities;
}
else
{
string[] tagSetIdStrings = tagSetIdsString.Split(',');
tagSetIds = new int[tagSetIdStrings.Length];
_tagSetIds = new int[tagSetIdStrings.Length];
for (int index = 0; index < tagSetIdStrings.Length; index++)
{
tagSetIds[index] = Int32.Parse(tagSetIdStrings[index]);
_tagSetIds[index] = Int32.Parse(tagSetIdStrings[index]);
}
}
@@ -38,7 +37,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
List<TagSetDataSourceItem> dataSource = new List<TagSetDataSourceItem>();
foreach (int tagSetId in tagSetIds)
foreach (int tagSetId in _tagSetIds)
{
TagSetDataSourceItem item = new TagSetDataSourceItem()
{
@@ -56,16 +55,18 @@ namespace Swarmops.Frontend.Pages.v5.Financial
this.RepeaterTagLabels.DataSource = dataSource;
this.RepeaterTagDrop.DataSource = dataSource;
this.RepeaterTagDropScript.DataSource = dataSource;
this.RepeaterErrorCheckTags.DataSource = dataSource;
this.RepeaterTagLabels.DataBind();
this.RepeaterTagDrop.DataBind();
this.RepeaterTagDropScript.DataBind();
this.RepeaterErrorCheckTags.DataBind();
// Write set list back to hidden variable
List<string> tagSetIdStringList = new List<string>();
foreach (int tagSetId in tagSetIds)
foreach (int tagSetId in _tagSetIds)
{
tagSetIdStringList.Add(tagSetId.ToString(CultureInfo.InvariantCulture));
}
@@ -73,6 +74,8 @@ namespace Swarmops.Frontend.Pages.v5.Financial
this.HiddenTagSetIdentifiers.Value = String.Join(",", tagSetIdStringList.ToArray());
}
private int[] _tagSetIds;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.CurrentOrganization.IsEconomyEnabled)
@@ -119,6 +122,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
this.LiteralErrorBankName.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankName;
this.LiteralErrorBankClearing.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankClearing;
this.LiteralErrorBankAccount.Text = Resources.Pages.Financial.RequestCashAdvance_ValidationError_BankAccount;
}
@@ -141,12 +145,12 @@ namespace Swarmops.Frontend.Pages.v5.Financial
if (budget.Organization.Identity != CurrentOrganization.Identity)
{
throw new InvalidOperationException("Budget-organization mismatch; won't file cash advance");
throw new InvalidOperationException("Budget-organization mismatch; won't file expense claim");
}
if (costType.Organization.Identity != CurrentOrganization.Identity)
{
throw new InvalidOperationException("CostType-organization mismatch; won't file cash advance");
throw new InvalidOperationException("CostType-organization mismatch; won't file expense claim");
}
// Store bank details for current user
+1 -1
View File
@@ -622,7 +622,7 @@ span.loginalphabetasign
}
input.entryError {
input.entryError, span.entryError, div.entryError {
outline: red ridge 4px;
}