[open-ils-commits] r19040 - trunk/Open-ILS/web/js/ui/default/acq/common (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Dec 21 18:10:48 EST 2010


Author: senator
Date: 2010-12-21 18:10:42 -0500 (Tue, 21 Dec 2010)
New Revision: 19040

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
Log:
Acq: support manual claiming as always intended, which to some users means
claiming with no predefined policy


Modified: trunk/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js	2010-12-21 23:10:18 UTC (rev 19039)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/claim_dialog.js	2010-12-21 23:10:42 UTC (rev 19040)
@@ -172,10 +172,9 @@
 
     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 @@
                 "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() + "<hr />");
+                        if (r.length) {
+                            openils.Util.printHtmlString(
+                                r.map(
+                                    function(o) {
+                                        return o.template_output().data();
+                                    }
+                                ).join("<hr />")
+                            );
+                        }
                     }
-                    else {
-                        progressDialog.hide();
-                    }
-                },
-                "oncomplete": function() {
                     progressDialog.hide();
-                    dojo.byId("print", win.document).innerHTML =
-                        localeStrings.PRINT;
-                    dojo.byId("print", win.document).disabled = false;
                     self.claimCallback(self.workingLi);
                 }
             }

Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-12-21 23:10:18 UTC (rev 19039)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-12-21 23:10:42 UTC (rev 19040)
@@ -376,10 +376,10 @@
     };
 
     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,7 +409,20 @@
     };
 
     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"], {
                 "params": [openils.User.authtoken, {"lineitem": li.id()}],
@@ -429,6 +442,7 @@
                 }
             }
         );
+        */
     };
 
     this.updateLiNotesCount = function(li, row) {



More information about the open-ils-commits mailing list