not allowing freezing if the hold has already been captured
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 14 Sep 2007 15:49:22 +0000 (15:49 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 14 Sep 2007 15:49:22 +0000 (15:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7785 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/skin/default/js/myopac.js

index 63da334..7aa050f 100644 (file)
@@ -210,11 +210,12 @@ avoid using bookbags all together.  Thank you.">
 <!ENTITY myopac.holds.processing "Processing holds... This may take a moment.">
 <!ENTITY myopac.holds.actions 'Actions for selected holds'>
 <!ENTITY myopac.holds.cancel.confirm 'Are you sure you wish to cancel the selected holds?'>
-<!ENTITY myopac.holds.freeze.confirm 'Are you sure you wish to freeze the selected holds?'>
+<!ENTITY myopac.holds.freeze.confirm 'Are you sure you wish to freeze the selected holds?
+Note that if an item has already been selected to fulfill the hold, it will not be frozen'>
 <!ENTITY myopac.holds.thaw.confirm 'Are you sure you wish to un-freeze the selected holds?'>
 <!ENTITY myopac.holds.thaw_date.confirm 'Are you sure you wish to change the un-freeze date for the selected holds?'>
 <!ENTITY myopac.holds.freeze.select_thaw "Select an 'Un-Freeze' date.  This is the date at which the holds will become active again.
-    If no date is chosen, the holds will remain frozen until they are manually un-frozen.">
+If no date is chosen, the holds will remain frozen until they are manually un-frozen.">
 
 <!ENTITY opac.holds.freeze "Freeze this hold">
 <!ENTITY opac.holds.freeze.help "A 'frozen' will retain its place in the queue, but will not be fulfilled until it has been unfrozen.">
index bd59b28..11ff6f3 100644 (file)
@@ -6,6 +6,7 @@ attachEvt('common','locationUpdated', myopacReload );
 var fleshedUser = null;
 var fleshedContainers = {};
 var holdCache = {};
+var holdStatusCache = {};
 
 
 function clearNodes( node, keepArray ) {
@@ -397,6 +398,8 @@ function myOShowHoldStatus(r) {
 
        var hold = r.hold;
        var status = r.getResultObject();
+    holdStatusCache[hold.id()] = status;
+
        var row = $("myopac_holds_row_" + r.hold.id());
 
        if( status < 3 )
@@ -1355,6 +1358,7 @@ function myopacDoHoldAction() {
     var holds = [];
     for(var i = 0; i < selectedRows.length; i++) {
         hold = holdCache[myopacHoldIDFromRow(selectedRows[i])];
+        var status = holdStatusCache[hold.id()];
         switch(action) {
             case 'cancel':
                 holds.push(hold);
@@ -1365,7 +1369,7 @@ function myopacDoHoldAction() {
                     holds.push(hold);
                 break;
             case 'freeze':
-                if(!isTrue(hold.frozen()))
+                if(!isTrue(hold.frozen()) && status < 3)
                     holds.push(hold);
                 break;
         }
@@ -1441,6 +1445,7 @@ function myopacBatchHoldCallback(r) {
     if(++myopacProcessedHolds >= myopacTotalHoldsToProcess) {
         myopacHideHoldProcessing();
         holdCache = {};
+        holdStatusCache = {};
         myopacForceHoldsRedraw = true;
         myOPACShowHolds();
     }