Display Series, Hold Count in record summary
authorJeff Godin <jgodin@tadl.org>
Tue, 3 Apr 2012 14:54:59 +0000 (10:54 -0400)
committerJeff Godin <jgodin@tadl.org>
Tue, 3 Apr 2012 14:54:59 +0000 (10:54 -0400)
Re-adding pre-bibtemplate Series display to record summary,
re-adding CGI-backed Hold Count.

These are both prime candidates for being replaced using
newly-available features.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/web/opac/skin/tadlv2/js/grpl_utils.js [new file with mode: 0644]
Open-ILS/web/opac/skin/tadlv2/js/rdetail.js
Open-ILS/web/opac/skin/tadlv2/xml/page_rdetail.xml
Open-ILS/web/opac/skin/tadlv2/xml/rdetail/rdetail_summary.xml

diff --git a/Open-ILS/web/opac/skin/tadlv2/js/grpl_utils.js b/Open-ILS/web/opac/skin/tadlv2/js/grpl_utils.js
new file mode 100644 (file)
index 0000000..70dad80
--- /dev/null
@@ -0,0 +1,24 @@
+function getHoldCount(id){
+  var holdCount = null;
+  var result = null;
+
+  if (window.XMLHttpRequest) {
+    // Code for all new browsers
+    holdCount = new XMLHttpRequest();
+  } else if ( window.ActiveXObject ) {
+    // Code for IE 5 and 6
+    holdCount = new ActiveXObject( "Microsoft.XMLHTTP" );
+  }
+
+   holdCount.open( "GET", "/cgi-bin/utils/public/hold_count_tadl.cgi?id=" + id, false )
+   holdCount.onreadystatechange = function() {
+        if (holdCount.readyState == 4) {
+            result = holdCount.responseText;
+        }
+    }
+    holdCount.send(null);
+
+    if (holdCount.responseText)
+       return  holdCount.responseText;
+
+}
index f1df91b..ba8f086 100644 (file)
@@ -476,6 +476,12 @@ function _rdetailDraw(r) {
        G.ui.rdetail.pubdate.appendChild(text(record.pubdate()));
        G.ui.rdetail.publisher.appendChild(text(record.publisher()));
        $('rdetail_physical_desc').appendChild(text(record.physical_description()));
+
+       if (record.series()) {
+               unHideMe($("series_row"));
+               $('rdetail_series').appendChild(text(record.series()));
+       }
+
        r = record.types_of_resource();
        if(r) {
                G.ui.rdetail.tor.appendChild(text(r[0]));
@@ -647,6 +653,11 @@ function _rdetailDraw(r) {
         }
     }); 
     req.send();
+
+       var curr_holds = getHoldCount(record.doc_id());
+       if (curr_holds) {
+               $('rdetail_hold_count').appendChild(text(curr_holds));
+       }
 }
 
 
index 9fdf857..40f29e1 100644 (file)
@@ -7,6 +7,7 @@
        <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/holds.js'></script>
        <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/cn_browse.js'></script>
        <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/container.js'></script>
+       <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/tadlv2/js/grpl_utils.js'></script>
 
        <script language='javascript' type='text/javascript'>
                config.ids.rdetail = {};
index d869f38..3bc25f0 100644 (file)
                                <td class='rdetail_item' id='rdetail_publisher'> </td>
                        </tr>
 
+                       <tr id='series_row' class='hide_me'>
+                               <td nowrap='nowrap' class='rdetail_desc'>Series</td>
+                               <td class='rdetail_item' id='rdetail_series'> </td>
+                       </tr>
 
                        <tr>
                                <td nowrap='nowrap' class='rdetail_desc'>&common.physical;</td>         
                 </td>
             </tr>
 
+                       <tr id='rdetail_hold_count_row' class=''>
+                               <td nowrap='nowrap' class='rdetail_desc'>Current Holds</td>
+                               <td class='rdetail_item' id='rdetail_hold_count'> </td>
+                       </tr>
+
                        <tr class='hide_me' id='rdetail_online_row'>
                                <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
                                     *** summary screen with complex information, such as location-specific URIs (856$9). -->