[open-ils-commits] r328 - conifer/trunk/web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 13 12:07:47 EDT 2009
Author: dbs
Date: 2009-04-13 12:07:44 -0400 (Mon, 13 Apr 2009)
New Revision: 328
Modified:
conifer/trunk/web/opac/skin/default/js/rdetail.js
conifer/trunk/web/opac/skin/default/js/result_common.js
Log:
Use the same var name to enable holds on available (enableHoldsOnAvailable)
Only display the "Place Hold" button if copies are held by the chosen org_unit
Modified: conifer/trunk/web/opac/skin/default/js/rdetail.js
===================================================================
--- conifer/trunk/web/opac/skin/default/js/rdetail.js 2009-04-13 13:45:40 UTC (rev 327)
+++ conifer/trunk/web/opac/skin/default/js/rdetail.js 2009-04-13 16:07:44 UTC (rev 328)
@@ -186,11 +186,7 @@
G.ui.rdetail.edition.appendChild(text(record.edition()));
G.ui.rdetail.pubdate.appendChild(text(record.pubdate()));
G.ui.rdetail.publisher.appendChild(text(record.publisher()));
- if (record.extent()) {
- $('rdetail_physical_desc').appendChild(text(record.extent()));
- } else {
- $('rdetail_physical_desc').appendChild(text(record.physical_description()));
- }
+ $('rdetail_physical_desc').appendChild(text(record.physical_description()));
r = record.types_of_resource();
if(r) {
G.ui.rdetail.tor.appendChild(text(r[0]));
@@ -288,7 +284,6 @@
acCollectData(cleanISBN(record.isbn()), rdetailhandleAC);
}
-
function rdetailCheckAvailable() {
var loc = getLocation();
var rid = getRid();
@@ -297,9 +292,17 @@
req.send();
}
+/*
+ * Display the "Place Hold" link if:
+ * * the current location holds at least one copy and
+ * * none of those copies are available
+ */
function rdetailEnableHold(r) {
var ccDepths = r.getResultObject();
- if ((ccDepths[(ccDepths.length - 1)].available) > 0) {
+ if (
+ ((ccDepths[(ccDepths.length - 1)].available) > 0) ||
+ ((ccDepths[(ccDepths.length - 1)].count) == 0)
+ ) {
hideMe($('rdetail_place_hold'));
} else {
unHideMe($('rdetail_place_hold'));
@@ -377,7 +380,6 @@
hideMe($('rdetail_reviews_div'));
hideMe($('rdetail_toc_div'));
hideMe($('rdetail_anotes_div'));
- hideMe($('rdetail_performer_notes_div'));
hideMe($('rdetail_excerpt_div'));
hideMe($('rdetail_preview_div'));
hideMe($('rdetail_marc_div'));
@@ -392,7 +394,6 @@
removeCSSClass($('rdetail_excerpt_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_preview_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_anotes_link'), 'rdetail_extras_selected');
- removeCSSClass($('rdetail_performer_notes_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_annotation_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_viewmarc_link'), 'rdetail_extras_selected');
@@ -424,11 +425,6 @@
unHideMe($('rdetail_anotes_div'));
break;
- case "performer_notes":
- addCSSClass($('rdetail_performer_notes_link'), 'rdetail_extras_selected');
- unHideMe($('rdetail_performer_notes_div'));
- break;
-
case "toc":
addCSSClass($('rdetail_toc_link'), 'rdetail_extras_selected');
unHideMe($('rdetail_toc_div'));
@@ -520,9 +516,6 @@
if( data.toc.html ) {
$('rdetail_toc_div').innerHTML = data.toc.html;
unHideMe($('rdetail_toc_link'));
- } else if( record.toc() ) {
- $('rdetail_toc_div').innerHTML = record.toc();
- unHideMe($('rdetail_toc_link'));
}
if( data.excerpt.html ) {
@@ -534,11 +527,6 @@
$('rdetail_anotes_div').innerHTML = data.anotes.html;
unHideMe($('rdetail_anotes_link'));
}
-
- if( record.performer_notes() ) {
- $('rdetail_performer_notes_div').innerHTML = record.performer_notes();
- unHideMe($('rdetail_performer_notes_link'));
- }
}
function rdetailShowReviews(r) {
Modified: conifer/trunk/web/opac/skin/default/js/result_common.js
===================================================================
--- conifer/trunk/web/opac/skin/default/js/result_common.js 2009-04-13 13:45:40 UTC (rev 327)
+++ conifer/trunk/web/opac/skin/default/js/result_common.js 2009-04-13 16:07:44 UTC (rev 328)
@@ -4,7 +4,7 @@
var lowHitCount = 4;
var isbnList = '';
var googleBooksLink = true;
-var holdsOnAvailable = false;
+var enableHoldsOnAvailable = false;
var resultFetchAllRecords = false;
var resultCompiledSearch = null;
@@ -505,7 +505,7 @@
args[PARAM_RID] = rec.doc_id();
pic.parentNode.setAttribute("href", buildOPACLink(args));
- if (holdsOnAvailable) {
+ if (enableHoldsOnAvailable) {
unHideMe($n(r,'place_hold_span'));
}
@@ -739,12 +739,12 @@
var cts = copy_counts[i];
cell.appendChild(text(cts.available + " / " + cts.count));
- if (!holdsOnAvailable && (i == (copy_counts.length - 1))) {
+ if (!enableHoldsOnAvailable && (i == (copy_counts.length - 1))) {
var resultTBody = findParentByNodeName(cell, 'TBODY');
- if (cts.available > 0) {
+ if (cts.available == 0 && cts.count > 0) {
+ dojo.query('[name="place_hold_span"]', resultTBody).removeClass('hide_me');
+ } else {
dojo.query('[name="place_hold_span"]', resultTBody).addClass('hide_me');
- } else {
- dojo.query('[name="place_hold_span"]', resultTBody).removeClass('hide_me');
}
}
More information about the open-ils-commits
mailing list