From 886f967da2e6a7401f8645c732c5dfd4e116a3a2 Mon Sep 17 00:00:00 2001 From: artunit Date: Fri, 12 Nov 2010 04:32:46 +0000 Subject: [PATCH] suppress hold messages for on order and in process items, add in process link git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@1063 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- web/opac/skin/uwin/js/copy_details.js | 31 ++++++++++++++++++++++++++----- web/opac/skin/uwin/js/rdetail.js | 9 +++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/web/opac/skin/uwin/js/copy_details.js b/web/opac/skin/uwin/js/copy_details.js index a0647918ff..1d5f16ac2c 100644 --- a/web/opac/skin/uwin/js/copy_details.js +++ b/web/opac/skin/uwin/js/copy_details.js @@ -9,6 +9,15 @@ var showDueDate = true; */ var showDueTime = true; +/* order status regular expression */ +var orderRE = new RegExp("order","gi"); + +/* process status regular expression */ +var processRE = new RegExp("process","gi"); + +/* url for process */ +var processURL = 'http://web4.uwindsor.ca/units/leddy/leddy.nsf/InProcessRequest?OpenForm'; + function cpdBuild( contextTbody, contextRow, record, callnumber, orgid, depth, copy_location ) { var i = cpdCheckExisting(contextRow); if(i) return i; @@ -210,15 +219,27 @@ function cpdDrawCopies(r) { function cpdDrawCopy(r) { var copy = r.getResultObject(); var row = r.row; + var statusStr = copy.status().name(); - if (r.args.copy_location && copy.location().name() != r.args.copy_location) { - hideMe(row); - return; - } + if (r.args.copy_location && copy.location().name() != r.args.copy_location) { + hideMe(row); + return; + } $n(row, 'barcode').appendChild(text(copy.barcode())); $n(row, 'location').appendChild(text(copy.location().name())); - $n(row, 'status').appendChild(text(copy.status().name())); + //$n(row, 'status').appendChild(text(copy.status().name())); + //alert(copy.status().name()); + if (processRE.test(statusStr)) { + var processLink = document.createElement('a'); + processLink.setAttribute('href', processURL); + processLink.setAttribute('class', 'classic_link'); + var tn = document.createTextNode(copy.status().name()); + processLink.appendChild(tn); + $n(row, 'status').appendChild(processLink); + } else { + $n(row, 'status').appendChild(text(copy.status().name())); + }//if processRE if(isXUL()) { /* show the hold link */ diff --git a/web/opac/skin/uwin/js/rdetail.js b/web/opac/skin/uwin/js/rdetail.js index 59ce894e87..8b7448e77f 100644 --- a/web/opac/skin/uwin/js/rdetail.js +++ b/web/opac/skin/uwin/js/rdetail.js @@ -18,6 +18,10 @@ var enableHoldsOnAvailable = false; var urlCheck = true; //whether to use a url check to mask legacy urls var urlExpr = /webvoy|janus|resolver/i; //regular expression + +var orderStatus = 9; +var processStatus = 5; +var checkStatus = true; /* assume 1 copy unless we look for more */ var cpCnt = 1; @@ -501,6 +505,7 @@ function _rdetailDraw(r) { ); RW.setAttribute('target', 'RefWorksMain'); + RW.setAttribute('class', 'classic_link'); unHideMe($('rdetail_exp_refworks_span')); } @@ -1295,6 +1300,10 @@ function rdetailApplyStatuses( row, template, statuses ) { for( var j in _statusPositions ) { var stat = _statusPositions[j]; var val = statuses[stat.id()]; + if (val && checkStatus) { + if (j == orderStatus || j == processStatus) + hideMe($('rdetail_place_hold')); + }//if var nn = template.cloneNode(true); if(val) nn.appendChild(text(val)); else nn.appendChild(text(0)); -- 2.11.0