when a user places a hold in the OPAC, we ask the server if the hold is possible.
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Feb 2006 21:40:29 +0000 (21:40 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Feb 2006 21:40:29 +0000 (21:40 +0000)
still need to add alert message for when the hold is not possible

git-svn-id: svn://svn.open-ils.org/ILS/trunk@3050 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index d7ed9f8..6563b2f 100644 (file)
@@ -52,6 +52,14 @@ function holdsDrawWindow(recid, type) {
                initLogin();
                return;
        }
+
+
+       swapCanvas($('check_holds_box'));
+       setTimeout( function() { holdsCheckPossibility(recid, type); }, 10 );
+}
+
+function _holdsDrawWindow(recid, type) {
+
        swapCanvas($('holds_box'));
 
        var rec = findRecord( recid, type );
@@ -85,6 +93,17 @@ function holdsDrawWindow(recid, type) {
 }
 
 
+function holdsCheckPossibility(recid, type) {
+       var req = new Request(CHECK_HOLD_POSSIBLE, G.user.session, 
+                       { titleid : recid, patronid : G.user.id(), depth : 0 } );
+       req.send(true);
+       var res = req.result();
+
+       if(res) _holdsDrawWindow(recid, type);
+       else drawCanvas();
+}
+
+
 function holdsBuildOrgSelector(node) {
 
        if(!node) node = globalOrgTree;
index 0f4fb02..bf7960d 100644 (file)
@@ -17,6 +17,7 @@
        <script language='javascript'>
                config.ids.altcanvas.org_tree           = config.ids.common.org_container;
                config.ids.altcanvas.holds                      = 'holds_box';
+               config.ids.altcanvas.check_holds        = 'check_holds_box';
                config.ids.altcanvas.xulholds           = 'xulholds_box';
                config.ids.altcanvas.loading            = 'loading_alt';
                //config.ids.altcanvas.cnbrowse         = 'cn_browse';
index 5ee36a2..b1f3904 100644 (file)
                </center>
        </div>
 
+       <div id='check_holds_box' class='hide_me non_canvas' 
+               style='margin-top: 6px; width: 100%; text-align: center'>
+               <br/><br/><br/>
+               <b>Checking for possibility of hold fulfillment...</b>
+       </div>
+
        <div id='holds_box' class='hide_me non_canvas' style='margin-top: 6px;'>
        
                <br/><br/>