From bce6612c0dcb5a2a9c20c3bddeb918bbbe767530 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Fri, 3 Apr 2015 01:06:31 +0200 Subject: [PATCH] Checkpoint commit for denying attestation --- .../App_GlobalResources/Pages.Financial.resx | 46 +++++++++++++++ Site5/Pages/v5/Financial/AttestCosts.aspx | 58 +++++++++++++++++++ Site5/Pages/v5/Financial/AttestCosts.aspx.cs | 3 + 3 files changed, 107 insertions(+) diff --git a/Site5/App_GlobalResources/Pages.Financial.resx b/Site5/App_GlobalResources/Pages.Financial.resx index dc5283f9..ff2b2456 100644 --- a/Site5/App_GlobalResources/Pages.Financial.resx +++ b/Site5/App_GlobalResources/Pages.Financial.resx @@ -173,9 +173,55 @@ Invoice #{0:N0} from {1} was UN-attested. It will not be paid unless attested again. When somebody undoes a previous attestation. + + Attest + keep short + + + Deny + keep short + + + Rebudget + keep short + + + My hovercraft is full of eels + This is a Monty Python reference. When translating, translate to "I am denying your request for funds because..." + + + What amount are you attesting instead (in {0})? + The {0} is the organization currency (SEK, USD, µBTC etc). + + + Optional reason for denial to the submitter: + + + Move the charge to this budget instead: + + + Fix problems or deny attestation + + + I will attest this, but for a different amount. + + + I will not attest this record. It is scratched. + This is a Monty Python reference. When translating, translate to "Deny attestation of this record altogether." + + + This record should charge a different budget. Move it there. + + + What seems to be the problem with this record? + There are not enough funds remaining in the budget to attest this cost. + + There are not enough funds to attest this. You can attest up to {0} {1:N2} for this year and budget. + The {0} is the currency and the {1} is the remaining budget. + Attest Costs diff --git a/Site5/Pages/v5/Financial/AttestCosts.aspx b/Site5/Pages/v5/Financial/AttestCosts.aspx index 98e0edb2..50bb28cd 100644 --- a/Site5/Pages/v5/Financial/AttestCosts.aspx +++ b/Site5/Pages/v5/Financial/AttestCosts.aspx @@ -1,5 +1,7 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="AttestCosts.aspx.cs" Inherits="Swarmops.Frontend.Pages.v5.Financial.AttestCosts" %> <%@ Register src="~/Controls/v5/Base/ModalDialog.ascx" tagname="ModalDialog" tagprefix="Swarmops5" %> +<%@ Register src="~/Controls/v5/Financial/ComboBudgets.ascx" tagname="ComboBudgets" tagprefix="Swarmops5" %> +<%@ Register src="~/Controls/v5/Financial/CurrencyTextBox.ascx" tagname="CurrencyTextBox" tagprefix="Swarmops5" %> @@ -97,6 +99,7 @@ $(".LocalIconDenial").click(function() { if ($(this).attr("rel") != "loading" && $("#IconDenial" + $(this).attr("baseid")) != "loading") { + $('div.radioOption').hide(); <%=this.DialogDeny.ClientID%>_open(); } }); @@ -228,6 +231,13 @@ // we're still in document.ready + $('input:radio[name="ModalOptions"]').change(function () { + var pickedButtonName = $(this).val(); + $('div.radioOption').slideUp(); + $('div#radioOption' + pickedButtonName).slideDown(); + }); + + SwarmopsJS.ajaxCall("/Pages/v5/Financial/AttestCosts.aspx/GetRemainingBudgets", {}, function(data) { data.forEach(function(accountData, dummy1, dummy2) { budgetRemainingLookup[accountData.AccountId] = accountData.Remaining; @@ -289,6 +299,20 @@ .rowPrevious { color: #AAA; } + + div.radioOption { + margin-top: -20px; + padding-bottom: 10px; + padding-left: 12px; + margin-right: 10px; + } + body.ltr div.radioOption { + padding-left: initial; + margin-right: initial; + padding-right: 12px; + margin-left: 10px; + } + @@ -312,6 +336,40 @@

+

+

+
+
+ ​
+ +
+ +
+
+

+
+
+ ​
+ +
+ +
+
+

+
+
+ ​
+ +
+ +
+
diff --git a/Site5/Pages/v5/Financial/AttestCosts.aspx.cs b/Site5/Pages/v5/Financial/AttestCosts.aspx.cs index c8f1be3c..12f2890f 100644 --- a/Site5/Pages/v5/Financial/AttestCosts.aspx.cs +++ b/Site5/Pages/v5/Financial/AttestCosts.aspx.cs @@ -5,6 +5,7 @@ using System.Linq; using System.ServiceModel.Security; using System.Web; using System.Web.Services; +using System.Web.UI; using Resources; using Swarmops.Logic.Financial; using Swarmops.Logic.Security; @@ -36,6 +37,8 @@ namespace Swarmops.Frontend.Pages.v5.Financial Localize(); } + this.TextDenyReason.Style [HtmlTextWriterStyle.FontSize] = "60% !important"; + this._attestationRights = GetAttestationRights(); this._documentList = new List();