From: Bill Erickson Date: Wed, 30 Sep 2015 21:49:21 +0000 (-0400) Subject: JBAS-914 Prevent creation of extra lieitem copies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5d4807eb5b003747a146f87ad7550831c9f4104f;p=working%2FEvergreen.git JBAS-914 Prevent creation of extra lieitem copies Prevent the API call which creates/modifies copies for a linteitem in the lineitem copy UI from running if one is already in flight. This is done both by disabling the Save Changes button and by checking an internal flag (in case something besides the button is causing the action to run). Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 957995cc28..e4c6e74e22 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -2901,6 +2901,14 @@ function AcqLiTable() { if (!this.confirmBreachedCopyFunds(copies)) return; + if (this._savingCopiesInFlight) { + // Save in progress. Get outta here. + return; + } + + this._savingCopiesInFlight = true; + acqLitSaveCopies.attr('disabled', true); + if (typeof(this._copy_count_cb) == "function") this._copy_count_cb(liId, total); @@ -2917,6 +2925,8 @@ function AcqLiTable() { self.drawCopies(liId, true /* force_fetch */); openils.Util.hide("acq-lit-update-copies-progress"); refreshPOSummaryAmounts(); + self._savingCopiesInFlight = false; + acqLitSaveCopies.attr('disabled', false); } } );