From 895d1b26389059ba292a61927bd81105f45cdff1 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Tue, 3 Apr 2012 10:54:59 -0400 Subject: [PATCH] Display Series, Hold Count in record summary 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 --- Open-ILS/web/opac/skin/tadlv2/js/grpl_utils.js | 24 ++++++++++++++++++++++ Open-ILS/web/opac/skin/tadlv2/js/rdetail.js | 11 ++++++++++ Open-ILS/web/opac/skin/tadlv2/xml/page_rdetail.xml | 1 + .../skin/tadlv2/xml/rdetail/rdetail_summary.xml | 9 ++++++++ 4 files changed, 45 insertions(+) create mode 100644 Open-ILS/web/opac/skin/tadlv2/js/grpl_utils.js 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 index 0000000000..70dad80047 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv2/js/grpl_utils.js @@ -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; + +} diff --git a/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js b/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js index f1df91b8f3..ba8f086410 100644 --- a/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js +++ b/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js @@ -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)); + } } diff --git a/Open-ILS/web/opac/skin/tadlv2/xml/page_rdetail.xml b/Open-ILS/web/opac/skin/tadlv2/xml/page_rdetail.xml index 9fdf85767c..40f29e17c2 100644 --- a/Open-ILS/web/opac/skin/tadlv2/xml/page_rdetail.xml +++ b/Open-ILS/web/opac/skin/tadlv2/xml/page_rdetail.xml @@ -7,6 +7,7 @@ +