Add PLACE_UNFILLABLE_HOLD permission
[working/Evergreen.git] / Open-ILS / web / opac / skin / default / js / holds.js
index 15e7bc2..5c4a324 100644 (file)
@@ -1022,18 +1022,27 @@ function holdHandleCreateResponse(r, recurse) {
 
        if(!recurse) {
                var res = r.getResultObject();
-        var age_protect_override = false;;
+        var place_anyway = false;
                if(checkILSEvent(res) || res.success != 1) {
-            if(res.success != 1 && res.age_protected_copy == 1) {
-                // There is at least one copy that *could* fill the hold, if it were not age-protected.
-                if( confirm($('hold_age_protected_override').innerHTML) ) {
-                    age_protect_override = true;
-                } else {
-                       swapCanvas($('holds_box'));
-                           return;
+            if(res.success != 1) {
+                if(res.age_protected_copy == 1) {
+                    // There is at least one copy that *could* fill the hold, if it were not age-protected.
+                    if( confirm($('hold_age_protected_override').innerHTML) ) {
+                        place_anyway = true;
+                    } else {
+                               swapCanvas($('holds_box'));
+                               return;
+                    }
+                } else if(res.place_unfillable == 1) {
+                    if( confirm($('hold_place_unfillable_override').innerHTML) ) {
+                        place_anyway = true;
+                    } else {
+                               swapCanvas($('holds_box'));
+                               return;
+                    }
                 }
             }
-            if(!age_protect_override) {
+            if(!place_anyway) {
                        if(res.success != 1) {
 
                     if(!holdArgs.partsSuggestionMade && holdArgs.recordParts &&