added more detailed handling for barred patron hold placement failures
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 15:02:57 +0000 (15:02 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 15:02:57 +0000 (15:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5180 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/holds.js
Open-ILS/web/opac/skin/default/xml/common/holds.xml

index 42af3df..9b5a6ba 100644 (file)
@@ -537,6 +537,7 @@ function holdsCheckPossibility(pickuplib) {
        var type = holdArgs.type;
        var req = new Request(CHECK_HOLD_POSSIBLE, G.user.session, 
                        { titleid : rec, patronid : G.user.id(), depth : 0, pickup_lib : pickuplib } );
+       req.request.alertEvent = false;
        req.send(true);
        return req.result();
 }
@@ -643,8 +644,17 @@ function holdsPlaceHold(hold, recurse) {
        swapCanvas($('check_holds_box'));
 
        if( holdArgs.type == 'M' || holdArgs.type == 'T' ) {
-               if( ! holdsCheckPossibility(hold.pickup_lib() ) ) {
-                       alert($('hold_not_allowed').innerHTML);
+               var res = holdsCheckPossibility(hold.pickup_lib());
+               if(!res || checkILSEvent(res) ) {
+                       if(!res) {
+                               alert($('hold_not_allowed').innerHTML);
+                       } else {
+                               if( res.textcode == 'PATRON_BARRED' ) {
+                                       alertId('hold_failed_patron_barred');
+                               } else {
+                                       alert($('hold_not_allowed').innerHTML);
+                               }
+                       }
                        swapCanvas($('holds_box'));
                        return;
                }
index 2108d47..578f958 100644 (file)
                A hold already exists on the requested item.  Would you like to create the hold anyway?
        </span>
 
+       <span id='hold_failed_patron_barred' class='hide_me'>
+               PATRON BARRED.  
+               Please see any notes in the notes section of your "My Account" page or contact your local library.
+       </span>
+
+
 
 </div>