Icon maintenance

This commit is contained in:
Rick Falkvinge
2019-02-05 09:28:43 +01:00
parent 899c6b7c71
commit 475cb23df6
3 changed files with 59 additions and 207 deletions
@@ -1,123 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Swarmops.Frontend.Controls.v5.Financial {
public partial class TransactionEditor {
/// <summary>
/// LabelGridHeaderAccountName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelGridHeaderAccountName;
/// <summary>
/// LabelGridHeaderDeltaPositive2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelGridHeaderDeltaPositive2;
/// <summary>
/// LabelGridHeaderDeltaNegative2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelGridHeaderDeltaNegative2;
/// <summary>
/// LabelGridHeaderDateTimeEntered control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelGridHeaderDateTimeEntered;
/// <summary>
/// LabelGridHeaderInitials control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelGridHeaderInitials;
/// <summary>
/// LabelAddTransactionRowsHeader control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelAddTransactionRowsHeader;
/// <summary>
/// LabelAddRowAccount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelAddRowAccount;
/// <summary>
/// BudgetAddRow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Swarmops.Controls.Financial.ComboBudgets BudgetAddRow;
/// <summary>
/// LabelAddRowAmount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelAddRowAmount;
/// <summary>
/// TextInsertAmount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Swarmops.Frontend.Controls.Financial.CurrencyTextBox TextInsertAmount;
/// <summary>
/// LabelTrackedTransactionHeader control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelTrackedTransactionHeader;
/// <summary>
/// LiteralWriteAccess control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal LiteralWriteAccess;
}
}
+58 -78
View File
@@ -92,100 +92,80 @@
});
$(".LocalIconApproval").click(function() {
if ($(this).attr("rel") != "loading" && $("#IconDenial" + $(this).attr("baseid")) != "loading") {
if ($(this).hasClass("LocalFundsInsufficient")) {
if (!canOverdraftBudgets) {
alertify.error(SwarmopsJS.unescape('<%=this.Localized_Error_InsufficientBudget%>'));
return;
}
// Handle confirm-overdraft case
alertify.set({
labels: {
ok: SwarmopsJS.unescape('<%=this.Localized_ConfirmOverdraftNo%>'),
cancel: SwarmopsJS.unescape('<%=this.Localized_ConfirmOverdraftYes%>')
}
});
alertify.confirm(SwarmopsJS.unescape('<%=this.Localized_ConfirmOverdraftPrompt%>'),
$.proxy(function(response) {
if (!response) {
// user clicked the RED button, which is "confirm overdraft"
onExpenseApproval(this);
}
}, this));
return; // Do not process here - must wait for confirm dialog to return
if ($(this).hasClass("LocalFundsInsufficient")) {
if (!canOverdraftBudgets) {
alertify.error(SwarmopsJS.unescape('<%=this.Localized_Error_InsufficientBudget%>'));
return;
}
// Handle normal case
// Handle confirm-overdraft case
onExpenseApproval(this);
alertify.set({
labels: {
ok: SwarmopsJS.unescape('<%=this.Localized_ConfirmOverdraftNo%>'),
cancel: SwarmopsJS.unescape('<%=this.Localized_ConfirmOverdraftYes%>')
}
});
alertify.confirm(SwarmopsJS.unescape('<%=this.Localized_ConfirmOverdraftPrompt%>'),
$.proxy(function(response) {
if (!response) {
// user clicked the RED button, which is "confirm overdraft"
onExpenseApproval(this);
}
}, this));
return; // Do not process here - must wait for confirm dialog to return
}
// Handle normal case
onExpenseApproval(this);
});
$(".LocalIconUndo").click(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("rel", "loading");
$(this).attr("src", "/Images/Abstract/ajaxloader-48x36px.gif");
$("#IconApproved" + $(this).attr("baseid")).fadeTo(1000, 0.01);
$(this).attr("src", "/Images/Abstract/ajaxloader-48x36px.gif");
$("#IconApproved" + $(this).attr("baseid")).fadeTo(1000, 0.01);
var baseid = $(this).attr("baseid");
var accountId = $("#IconApproval" + baseid).attr("accountid");
var funds = parseFloat($("#IconApproval" + baseid).attr("amount"));
budgetRemainingLookup[accountId] -= funds;
setApprovability();
var baseid = $(this).attr("baseid");
var accountId = $("#IconApproval" + baseid).attr("accountid");
var funds = parseFloat($("#IconApproval" + baseid).attr("amount"));
budgetRemainingLookup[accountId] -= funds;
setApprovability();
$.ajax({
type: "POST",
url: "/Pages/v5/Financial/ApproveCosts.aspx/RetractApproval",
data: "{'identifier': '" + escape($(this).attr("baseid")) + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: $.proxy(function (msg) {
if (msg.d.Success) {
var baseid = $(this).attr("baseid");
$(this).attr("src", "/Images/Icons/iconshock-balloon-undo-128x96px.png");
$(this).attr("rel", "");
$(this).hide();
$("#IconApproved" + baseid).finish().css("opacity", 0.5).css("display", "none");
$("#IconApproval" + baseid).fadeIn(100);
$("#IconDenial" + baseid).fadeIn(100).css("cursor", "pointer");
$('.row' + baseid).removeClass("action-list-item-approved");
alertify.log(SwarmopsJS.unescape(msg.d.DisplayMessage));
$.ajax({
type: "POST",
url: "/Pages/v5/Financial/ApproveCosts.aspx/RetractApproval",
data: "{'identifier': '" + escape($(this).attr("baseid")) + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: $.proxy(function (msg) {
if (msg.d.Success) {
var baseid = $(this).attr("baseid");
$(this).attr("src", "/Images/Icons/iconshock-balloon-undo-128x96px.png");
$(this).attr("rel", "");
$(this).hide();
$("#IconApproved" + baseid).finish().css("opacity", 0.5).css("display", "none");
$("#IconApproval" + baseid).fadeIn(100);
$("#IconDenial" + baseid).fadeIn(100).css("cursor", "pointer");
$('.row' + baseid).removeClass("action-list-item-approved");
alertify.log(SwarmopsJS.unescape(msg.d.DisplayMessage));
recheckBudgets(); // will double-check budgets against server
} else {
$(this).attr("src", "/Images/Icons/iconshock-greentick-128x96px.png");
alertify.error(SwarmopsJS.unescape(msg.d.DisplayMessage));
// TODO: Add alert box?
}
}, this)
});
recheckBudgets(); // will double-check budgets against server
} else {
$(this).attr("src", "/Images/Icons/iconshock-greentick-128x96px.png");
alertify.error(SwarmopsJS.unescape(msg.d.DisplayMessage));
// TODO: Add alert box?
}
}, this)
});
}
});
$(".LocalIconDenial").mouseover(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("src", "/Images/Icons/iconshock-balloon-no-128x96px-hot.png");
}
});
$(".LocalIconDenial").mouseout(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("src", "/Images/Icons/iconshock-balloon-no-128x96px.png");
}
});
$(".LocalViewDox").click(function () {
$(".LocalIconDox").click(function () {
$("a.FancyBox_Gallery[rel='" + $(this).attr("baseid") + "']").first().click();
});
+1 -6
View File
@@ -12,12 +12,7 @@
}
preload([
'/Images/Abstract/ajaxloader-medium.gif',
'/Images/Icons/iconshock-balloon-yes-16px-hot.png',
'/Images/Icons/iconshock-balloon-no-16px-hot.png',
'/Images/Icons/iconshock-greentick-16px.png',
'/Images/Icons/iconshock-redcross-16px.png',
'/Images/Icons/undo-16px.png'
]);
$(document).ready(function () {