diff --git a/Site5/App_GlobalResources/Pages.Financial.resx b/Site5/App_GlobalResources/Pages.Financial.resx index b6489ba1..6cd993de 100644 --- a/Site5/App_GlobalResources/Pages.Financial.resx +++ b/Site5/App_GlobalResources/Pages.Financial.resx @@ -238,6 +238,10 @@ Upload Receipt Images: + + Please select an option as indicated. + Very general as tags may be many things. + Amount Amount to be paid out diff --git a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx index bf869194..93b11a8b 100644 --- a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx +++ b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx @@ -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(""); } + + 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("'", "''") %>'); + } + + isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', "") && isValid; $.ajax({ diff --git a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs index 46838bb4..79c15df1 100644 --- a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs +++ b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs @@ -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 dataSource = new List(); - 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 tagSetIdStringList = new List(); - 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 diff --git a/Site5/Style/style-v5.css b/Site5/Style/style-v5.css index eb99de43..81608efb 100644 --- a/Site5/Style/style-v5.css +++ b/Site5/Style/style-v5.css @@ -622,7 +622,7 @@ span.loginalphabetasign } -input.entryError { +input.entryError, span.entryError, div.entryError { outline: red ridge 4px; }