From: senator Date: Tue, 21 Dec 2010 23:10:42 +0000 (+0000) Subject: Acq: support manual claiming as always intended, which to some users means X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=79154d1e598508b3335e4bf6067ae41c32e301d8;p=contrib%2FConifer.git Acq: support manual claiming as always intended, which to some users means claiming with no predefined policy git-svn-id: svn://svn.open-ils.org/ILS/trunk@19040 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js b/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js index a34e2bed01..28042b25e5 100644 --- a/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js +++ b/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js @@ -172,10 +172,9 @@ function ClaimDialogManager( this.claim = function(lid_ids) { progressDialog.show(true); - var win = null; fieldmapper.standardRequest( - ["open-ils.acq", "open-ils.acq.claim.lineitem_detail"], { + ["open-ils.acq", "open-ils.acq.claim.lineitem_detail.atomic"], { "params": [ openils.User.authtoken, lid_ids, null, this.claimType.attr("value"), @@ -184,20 +183,17 @@ function ClaimDialogManager( "async": true, "onresponse": function(r) { if (r = openils.Util.readResponse(r)) { - if (!win) - win = openClaimVoucherWindow(); - dojo.byId("main", win.document).innerHTML += - (r.template_output().data() + "
"); - } - else { - progressDialog.hide(); + if (r.length) { + openils.Util.printHtmlString( + r.map( + function(o) { + return o.template_output().data(); + } + ).join("
") + ); + } } - }, - "oncomplete": function() { progressDialog.hide(); - dojo.byId("print", win.document).innerHTML = - localeStrings.PRINT; - dojo.byId("print", win.document).disabled = false; self.claimCallback(self.workingLi); } } 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 bbaf04856c..3088b68750 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 @@ -376,10 +376,10 @@ function AcqLiTable() { }; this.reconsiderClaimControl = function(li, row) { + if (!row) row = this._findLiRow(li); var option = nodeByName("action_manage_claims", row); var eligible = this.claimEligibleLidByLi[li.id()].length; var count = this._liCountClaims(li); - if (!row) row = this._findLiRow(li); option.disabled = !(count || eligible); option.innerHTML = @@ -409,6 +409,19 @@ function AcqLiTable() { }; this.checkClaimEligibility = function(li, callback, row) { + /* Assume always eligible, i.e. from this interface we don't care about + * claim eligibility any more. this is where the user would force a + * claime. */ + this.clearEligibility(li); + this.claimEligibleLidByLi[li.id()] = li.lineitem_details().map( + function(lid) { return lid.id(); } + ); + li.lineitem_details().forEach( + function(lid) { self.claimEligibleLid[lid.id()] = true; } + ); + this.reconsiderClaimControl(li, row); + if (callback) callback(); + /* this.clearEligibility(li); fieldmapper.standardRequest( ["open-ils.acq", "open-ils.acq.claim.eligible.lineitem_detail"], { @@ -429,6 +442,7 @@ function AcqLiTable() { } } ); + */ }; this.updateLiNotesCount = function(li, row) {