From: Jeff Godin Date: Mon, 23 Apr 2012 11:25:14 +0000 (-0400) Subject: Add reshelving counts, suggest hold when no copies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a24a3344a0bcb31be18ff9efbdedfb3a245e12af;p=evergreen%2Ftadl.git Add reshelving counts, suggest hold when no copies Rather than count "reshelving" copies as "available", note that there are X available "plus Y recently returned". Adjust logic to display unavailable count when there are no available copies, and to include a suggestion to (try) placing a hold. Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml b/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml index 94c76f1d26..3cedebfc2b 100644 --- a/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml +++ b/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml @@ -242,8 +242,13 @@ if (!copySummaryObj[libkey][lockey][cnkey]) { copySummaryObj[libkey][lockey][cnkey] = new Object(); copySummaryObj[libkey][lockey][cnkey]['count'] = 0; + copySummaryObj[libkey][lockey][cnkey]['count_reshelving'] = 0; + } + if (status_id == 7) { + copySummaryObj[libkey][lockey][cnkey]['count_reshelving']++; + } else { + copySummaryObj[libkey][lockey][cnkey]['count']++; } - copySummaryObj[libkey][lockey][cnkey]['count']++; item_cnt++; //if (item_cnt >= max_items) { @@ -257,7 +262,6 @@ for (var lib in copySummaryObj) { numLibs++; } - if (numLibs == 0) { return; } if (numLibs == 1) { var lines_output = 0; var sumdiv = dojo.create('div', { "style": "font-weight: bold;" }); @@ -277,7 +281,12 @@ morediv.appendChild(dojo.doc.createTextNode("additional copies available - click title for details")); } else { var sumcount = copySummaryObj[sumlib][sumloc][sumcn]['count']; - var summary_line = sumcount + ' available in ' + sumloc + ', call number ' + sumcn; + var sumcount_reshelving = copySummaryObj[sumlib][sumloc][sumcn]['count_reshelving']; + var summary_line = sumcount + ' available in ' + sumloc; + if (sumcount_reshelving) { + summary_line += ' (plus ' + sumcount_reshelving + ' recently returned)'; + } + summary_line += ', call number ' + sumcn; var locdiv = dojo.create('div', null, sumdiv); locdiv.appendChild(dojo.doc.createTextNode(summary_line)); lines_output++; @@ -286,7 +295,7 @@ } } output.appendChild(sumdiv); - } else { + } else if (numLibs > 1) { // output the grouped-by-library summary for (var libname in copySummaryObj) { var copycount = 0; @@ -307,9 +316,10 @@ if (count_copies_unavail > 0) { other_or_null = (count_copies_avail > 0) ? 'other ' : ' '; item_or_items = (count_copies_unavail > 1) ? 'items' : 'item'; + suggest_hold = (count_copies_avail < 1) ? ' -- try placing a hold!' : ''; output.appendChild( dojo.doc.createTextNode( - count_copies_unavail + " " + other_or_null + item_or_items + " not currently available" + count_copies_unavail + " " + other_or_null + item_or_items + " not currently available" + suggest_hold ) ); } diff --git a/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml b/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml index 92c5e5d363..738971ddd4 100644 --- a/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml +++ b/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml @@ -237,9 +237,13 @@ if (!copySummaryObj[libkey][lockey][cnkey]) { copySummaryObj[libkey][lockey][cnkey] = new Object(); copySummaryObj[libkey][lockey][cnkey]['count'] = 0; + copySummaryObj[libkey][lockey][cnkey]['count_reshelving'] = 0; + } + if (status_id == 7) { + copySummaryObj[libkey][lockey][cnkey]['count_reshelving']++; + } else { + copySummaryObj[libkey][lockey][cnkey]['count']++; } - copySummaryObj[libkey][lockey][cnkey]['count']++; - item_cnt++; //if (item_cnt >= max_items) { // dojo.create('br', null, cp_entry); @@ -252,7 +256,6 @@ for (var lib in copySummaryObj) { numLibs++; } - if (numLibs == 0) { return output.innerHTML; } if (numLibs == 1) { var lines_output = 0; var sumdiv = dojo.create('div', { "style": "font-weight: bold;" }); @@ -272,7 +275,12 @@ morediv.appendChild(dojo.doc.createTextNode("additional copies available - click title for details")); } else { var sumcount = copySummaryObj[sumlib][sumloc][sumcn]['count']; - var summary_line = sumcount + ' available in ' + sumloc + ', call number ' + sumcn; + var sumcount_reshelving = copySummaryObj[sumlib][sumloc][sumcn]['count_reshelving']; + var summary_line = sumcount + ' available in ' + sumloc; + if (sumcount_reshelving) { + summary_line += ' (plus ' + sumcount_reshelving + ' recently returned)'; + } + summary_line += ', call number ' + sumcn; var locdiv = dojo.create('div', null, sumdiv); locdiv.appendChild(dojo.doc.createTextNode(summary_line)); lines_output++; @@ -281,7 +289,7 @@ } } output.appendChild(sumdiv); - } else { + } else if (numLibs > 1) { // output the grouped-by-library summary for (var libname in copySummaryObj) { var copycount = 0; @@ -302,9 +310,10 @@ if (count_copies_unavail > 0) { other_or_null = (count_copies_avail > 0) ? 'other ' : ' '; item_or_items = (count_copies_unavail > 1) ? 'items' : 'item'; + suggest_hold = (count_copies_avail < 1) ? ' -- try placing a hold!' : ''; output.appendChild( dojo.doc.createTextNode( - count_copies_unavail + " " + other_or_null + item_or_items + " not currently available" + count_copies_unavail + " " + other_or_null + item_or_items + " not currently available" + suggest_hold ) ); }