var rdetailRefWorksHost = 'http://refworks.scholarsportal.info';
var enableHoldsOnAvailable = false;
+/* threshold for paging */
+var rdetailBreakUpLargeSets = true; //flag for paging support
+var pgThreshold = 15; //the number of items to invoke paging
+var pgDisplay = 10; //number of items to display at a time
+
/* vars vars vars */
var record = null;
var cp_statuses = null;
}
function rdetailBuildInfoRows() {
- var req;
- var method = FETCH_COPY_COUNTS_SUMMARY;
- if (rdetailShowCopyLocation)
- method = FETCH_COPY_LOCATION_COUNTS_SUMMARY;
-
- if( rdetailShowLocal )
- req = new Request(method, record.doc_id(), getLocation(), getDepth())
- else
- req = new Request(method, record.doc_id());
- req.callback(_rdetailBuildInfoRows);
- req.send();
+ var req;
+ var method = FETCH_COPY_COUNTS_SUMMARY;
+ var cpCnt = 0;
+
+ //we figure out the number of copies
+ if (rdetailBreakUpLargeSets)
+ cpCnt = sortOutCopies(getLocation(), getRid(), getForm());
+
+ if (rdetailShowCopyLocation && cpCnt < pgThreshold)
+ method = FETCH_COPY_LOCATION_COUNTS_SUMMARY;
+
+ if( rdetailShowLocal )
+ req = new Request(method, record.doc_id(), getLocation(), getDepth())
+ else
+ req = new Request(method, record.doc_id());
+
+ if (rdetailBreakUpLargeSets && cpCnt >= pgThreshold) {
+ rdetailLocalOnly = true;
+ req.request.rec_id = record.doc_id();
+ req.request.cpCnt = cpCnt;
+ //remove the location options for paged sets
+ try {
+ /*
+ hideMe(G.ui.rdetail.cp_info_local);
+ hideMe(G.ui.rdetail.cp_info_all);
+ */
+ } catch(e) { }
+ req.callback(_rdetailBuildInfoPagedRows);
+ } else
+ req.callback(_rdetailBuildInfoRows);
+ req.send();
}
-function _rdetailRows(node) {
-
- if( rdetailShowLocal && getLocation() != globalOrgTree.id() ) {
- var loc = findOrgUnit(getLocation());
- if( node ) {
- if( !orgIsMine(node, loc) && !orgIsMine(loc,node) ) return;
- } else {
- for( var i = 0; i < globalOrgTree.children().length; i++ ) {
- var org = findOrgUnit(globalOrgTree.children()[i]);
- if( orgIsMine(org, loc) ) {
- node = org;
- break;
- }
- }
- }
- }
-
- if(!node && findOrgType(globalOrgTree.ou_type()).can_have_vols())
- node = globalOrgTree;
-
-
- /* don't show hidden orgs */
-
- if(node) {
-
- if(!isXUL() && !isTrue(node.opac_visible())) return;
-
- var row = copyRow.cloneNode(true);
- row.id = "cp_info_" + node.id();
-
- var libtd = findNodeByName( row, config.names.rdetail.lib_cell );
- var cntd = findNodeByName( row, config.names.rdetail.cn_cell );
- var cpctd = findNodeByName( row, config.names.rdetail.cp_count_cell );
- var actions = $n(row, 'rdetail_actions_cell');
-
- var p = libtd.getElementsByTagName('a')[0];
- libtd.insertBefore(text(node.name()), p);
- libtd.setAttribute("style", "padding-left: " + ((findOrgDepth(node) - 1) * 9) + "px;");
-
- if(!findOrgType(node.ou_type()).can_have_vols()) {
-
- row.removeChild(cntd);
- row.removeChild(cpctd);
- row.removeChild(actions);
- row.setAttribute('novols', '1');
-
- libtd.setAttribute("colspan", numStatuses + 3 );
- libtd.colSpan = numStatuses + 3;
- addCSSClass(row, 'copy_info_region_row');
- }
-
- copyRowParent.appendChild(row);
-
- } else { node = globalOrgTree; }
-
- for( var c in node.children() )
- _rdetailRows(node.children()[c]);
-}
function rdetailCNPrint(orgid, cn) {
var div = cpdBuildPrintWindow( record, orgid);
var localCNFound = false;
var ctr = 0;
+
+function _rdetailBuildInfoPagedRows(r) {
+
+ //alert(r.getText());
+ if (!r) return;
+ /*
+ */
+ var summary = r.getResultObject();
+ if(!summary) return;
+
+ summary.sort(callsortfn);
+ if (rdetailShowCopyLocation)
+ unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header' ) );
+
+ removeChildren(copyRowParent);
+
+ var rec_id = r.rec_id;
+ //var tot_copies = r.cpCnt;
+ var tot_copies = summary.length;
+ var cgi = new CGI();
+ var parm = cgi.param("cstart");
+ if (parm == undefined)
+ parm = 0;
+ var summaryStart = parseInt(parm);
+ parm = cgi.param("csize");
+ if (parm == undefined)
+ parm = pgDisplay;
+ var summarySize = parseInt(parm) + summaryStart;
+ if (summarySize > tot_copies)
+ summarySize = tot_copies;
+ var pgSize = parseInt(parm);
+
+ _rdetailRows(null,summaryStart, pgSize, summarySize, tot_copies);
+ var found = true;
+
+ for( var i = summaryStart; i < summary.length && i < summarySize; i++ ) {
+ var arr = summary[i];
+ globalCNCache[arr[1]] = 1;
+ var thisOrg = findOrgUnit(arr[0]);
+ var rowNode = $("cp_info_" + thisOrg.id());
+ if(!rowNode) continue;
+
+ if(rowNode.getAttribute("used")) {
+
+ if( rowNode.nextSibling ) {
+ sib = rowNode.nextSibling;
+ o ='cp_info_'+thisOrg.id()+'_';
+ /* push the new row on as the last row for this org unit */
+ while( sib && sib.id.match(o) ) {
+ sib = sib.nextSibling;
+ }
+ if(sib)
+ rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+ else
+ rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
+ } else {
+ rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
+ }
+
+ var n = findNodeByName( rowNode, config.names.rdetail.lib_cell );
+ n.appendChild(text(thisOrg.name()));
+ n.setAttribute("style", "padding-left: " + ((findOrgDepth(thisOrg) - 1) * 9) + "px;");
+ rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr);
+
+ } else {
+ rowNode.setAttribute("used", "1");
+ }
+
+ var cpc_temp = rowNode.removeChild(
+ findNodeByName(rowNode, config.names.rdetail.cp_count_cell));
+
+ var statuses = arr[2];
+ var cl = '';
+
+ var recreq = new Request( FETCH_COPIES_FROM_VOLUME, rec_id, arr[1], arr[0]);
+ recreq.request.rowNode = rowNode;
+ recreq.request.cpc_temp = cpc_temp;
+ recreq.request.statuses = statuses;
+ recreq.request.arrVal = arr[1];
+ recreq.request.thisOrg = thisOrg;
+ recreq.callback(_rdetailFL);
+ recreq.send();
+
+
+ if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
+ }
+
+ if(!found) unHideMe(G.ui.rdetail.cp_info_none);
+}
+
function _rdetailBuildInfoRows(r) {
- if (rdetailShowCopyLocation)
- unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header' ) );
+ if (rdetailShowCopyLocation)
+ unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header' ) );
+
+ removeChildren(copyRowParent);
+
+ _rdetailRows();
+
+ var summary = r.getResultObject();
+ if(!summary) return;
+ var cgi = new CGI();
+ var parm = cgi.param("cstart");
+ if (parm == undefined)
+ parm = 0;
+ var summaryStart = parseInt(parm);
+ parm = cgi.param("csize");
+ if (parm == undefined)
+ parm = 25;
+ var summarySize = parseInt(parm);
+
+ var found = false;
+ //for( var i = 0; i < summary.length; i++ ) {
+ for( var i = summaryStart; i < summary.length && i < summarySize; i++ ) {
+
+ var arr = summary[i];
+ globalCNCache[arr[1]] = 1;
+ var thisOrg = findOrgUnit(arr[0]);
+ var rowNode = $("cp_info_" + thisOrg.id());
+ if(!rowNode) continue;
+
+ if(rowNode.getAttribute("used")) {
+
+ if( rowNode.nextSibling ) {
+ sib = rowNode.nextSibling;
+ o ='cp_info_'+thisOrg.id()+'_';
+ /* push the new row on as the last row for this org unit */
+ while( sib && sib.id.match(o) ) {
+ sib = sib.nextSibling;
+ }
+ if(sib)
+ rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+ else
+ rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
+ } else {
+ rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
+ }
+
+ var n = findNodeByName( rowNode, config.names.rdetail.lib_cell );
+ n.appendChild(text(thisOrg.name()));
+ n.setAttribute("style", "padding-left: " + ((findOrgDepth(thisOrg) - 1) * 9) + "px;");
+ rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr);
+
+ } else {
+ rowNode.setAttribute("used", "1");
+ }
+
+ var cpc_temp = rowNode.removeChild(
+ findNodeByName(rowNode, config.names.rdetail.cp_count_cell));
+
+ var statuses = arr[2];
+ var cl = '';
+ if (rdetailShowCopyLocation) {
+ cl = arr[2];
+ statuses = arr[3];
+ }
+
+ rdetailApplyStatuses(rowNode, cpc_temp, statuses);
+
+ var isLocal = false;
+ if( orgIsMine( findOrgUnit(getLocation()), thisOrg ) ) {
+ found = true;
+ isLocal = true;
+ if(!localCNFound) {
+ localCNFound = true;
+ defaultCN = arr[1];
+ }
+ }
+
+ //if(isLocal) unHideMe(rowNode);
+ unHideMe(rowNode);
+
+ rdetailSetPath( thisOrg, isLocal );
+ rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, cl );
+
+ if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
+ }
- removeChildren(copyRowParent);
+ if(!found) unHideMe(G.ui.rdetail.cp_info_none);
+}
- _rdetailRows();
+function _rdetailRows(node, summaryStart, pgSize, summarySize, tot_copies) {
+
+ if( rdetailShowLocal && getLocation() != globalOrgTree.id() ) {
+ var loc = findOrgUnit(getLocation());
+ if( node ) {
+ if( !orgIsMine(node, loc) && !orgIsMine(loc,node) ) return;
+ } else {
+ for( var i = 0; i < globalOrgTree.children().length; i++ ) {
+ var org = findOrgUnit(globalOrgTree.children()[i]);
+ if( orgIsMine(org, loc) ) {
+ node = org;
+ break;
+ }
+ }
+ }
+ }
- var summary = r.getResultObject();
- if(!summary) return;
+ if(!node && findOrgType(globalOrgTree.ou_type()).can_have_vols())
+ node = globalOrgTree;
- var found = false;
- for( var i = 0; i < summary.length; i++ ) {
-
- var arr = summary[i];
- globalCNCache[arr[1]] = 1;
- var thisOrg = findOrgUnit(arr[0]);
- var rowNode = $("cp_info_" + thisOrg.id());
- if(!rowNode) continue;
-
- if(rowNode.getAttribute("used")) {
-
- if( rowNode.nextSibling ) {
- sib = rowNode.nextSibling;
- o ='cp_info_'+thisOrg.id()+'_';
- /* push the new row on as the last row for this org unit */
- while( sib && sib.id.match(o) ) {
- sib = sib.nextSibling;
- }
- if(sib)
- rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
- else
- rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
- } else {
- rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
- }
- var n = findNodeByName( rowNode, config.names.rdetail.lib_cell );
- n.appendChild(text(thisOrg.name()));
- n.setAttribute("style", "padding-left: " + ((findOrgDepth(thisOrg) - 1) * 9) + "px;");
- rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr);
+ /* don't show hidden orgs */
- } else {
- rowNode.setAttribute("used", "1");
- }
+ if(node) {
- var cpc_temp = rowNode.removeChild(
- findNodeByName(rowNode, config.names.rdetail.cp_count_cell));
+ if(!isXUL() && !isTrue(node.opac_visible())) return;
- var statuses = arr[2];
- var cl = '';
- if (rdetailShowCopyLocation) {
- cl = arr[2];
- statuses = arr[3];
- }
+ var row = copyRow.cloneNode(true);
+ row.id = "cp_info_" + node.id();
+ //alert(row.id);
+ var libtd = findNodeByName( row, config.names.rdetail.lib_cell );
+ var cntd = findNodeByName( row, config.names.rdetail.cn_cell );
+ var cpctd = findNodeByName( row, config.names.rdetail.cp_count_cell );
+ var actions = $n(row, 'rdetail_actions_cell');
- rdetailApplyStatuses(rowNode, cpc_temp, statuses);
+ var p = libtd.getElementsByTagName('a')[0];
+ libtd.insertBefore(text(node.name()), p);
- var isLocal = false;
- if( orgIsMine( findOrgUnit(getLocation()), thisOrg ) ) {
- found = true;
- isLocal = true;
- if(!localCNFound) {
- localCNFound = true;
- defaultCN = arr[1];
- }
- }
+ libtd.setAttribute("style", "padding-left: " + ((findOrgDepth(node) - 1) * 9) + "px;");
- //if(isLocal) unHideMe(rowNode);
- unHideMe(rowNode);
+ if(!findOrgType(node.ou_type()).can_have_vols()) {
- rdetailSetPath( thisOrg, isLocal );
- rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, cl );
+ row.removeChild(cntd);
+ row.removeChild(cpctd);
+ row.removeChild(actions);
+ row.setAttribute('novols', '1');
- if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
- }
+ libtd.setAttribute("colspan", numStatuses + 3 );
+ libtd.colSpan = numStatuses + 3;
+ addCSSClass(row, 'copy_info_region_row');
+ if (summaryStart!= undefined && pgSize!=undefined &&
+ summarySize != undefined && tot_copies != undefined)
+ {
+ fillOutLinks(libtd, summaryStart, pgSize, summarySize, tot_copies);
+ } //if summaryStart
+ }//if
+
+ copyRowParent.appendChild(row);
+
+ } else { node = globalOrgTree; }
+
+ for( var c in node.children() )
+ _rdetailRows(node.children()[c], summaryStart, pgSize, summarySize, tot_copies);
+}
+
+function _rdetailCL(r) {
+ if (!r) return;
+ var cl = r.getResultObject();
+ if (cl) {
+ //alert(r.arrVal + " - " + cl.location().name());
+ rdetailApplyStatuses(r.rowNode, r.cpc_temp, r.statuses);
+
+ var isLocal = false;
+ if( orgIsMine( findOrgUnit(getLocation()), r.thisOrg ) ) {
+ isLocal = true;
+ if(!localCNFound) {
+ localCNFound = true;
+ defaultCN = r.arrVal;
+ }
+ }
+
+ //if(isLocal) unHideMe(rowNode);
+ unHideMe(r.rowNode);
+
+ rdetailSetPath( r.thisOrg, isLocal);
+ rdetailBuildBrowseInfo( r.rowNode, r.arrVal, isLocal, r.thisOrg,
+ cl.location().name());
+ }//cl
+}
+function _rdetailFL(r) {
+ if (!r) return;
+ var fl = r.getResultObject();
+ if (fl) {
+ var cp_request = new Request(FETCH_FLESHED_COPY, fl);
+
+ cp_request.request.rowNode = r.rowNode;
+ cp_request.request.cpc_temp = r.cpc_temp;
+ cp_request.request.statuses = r.statuses;
+ cp_request.request.arrVal = r.arrVal;
+ cp_request.request.thisOrg = r.thisOrg;
+ cp_request.callback(_rdetailCL);
+ cp_request.send();
+ }//fl
+}
+
+/*
+ callsortfn - sorting an array of call numbers
+
+ This probably won't work for every instance, but assumes last
+ number is a year. Anyway, this is how to get into the
+ array values, it could be refined, though a better way
+ will be to set up a special opensrf that can apply
+ postgres goodness to this.
+*/
+function callsortfn(a,b) {
+ var callno1 = a[1];
+ var callno2 = b[1];
+ var callnum1 = 0;
+ var callnum2 = 0;
+
+ var marker = callno1.lastIndexOf(' ');
+ if (marker != -1)
+ callnum1 = parseInt(callno1.substring(marker));
+ marker = callno2.lastIndexOf(' ');
+ if (marker != -1)
+ callnum2 = parseInt(callno2.substring(marker));
+
+ //window.status = 'comparing ' + callnum1 + ' to ' + callnum2;
+
+ if (callnum1 < callnum2) return -1;
+ if (callnum1 > callnum2) return 1;
+ return 0;
+}
- if(!found) unHideMe(G.ui.rdetail.cp_info_none);
+function fillOutLinks(node, cpstart, cpsize, ssize, pieces) {
+ if (node) {
+ var theLink = document.location + "";
+ var marker = theLink.indexOf("&cstart");
+ if (marker > 0)
+ theLink = theLink.substring(0,marker);
+
+ var summaryStmt = '(' + (cpstart + 1) + ' to ' + ssize + ' of ' + pieces;
+ node.appendChild(document.createTextNode(summaryStmt));
+ if ((cpstart + 1) > cpsize) {
+ node.appendChild(document.createTextNode(' '));
+ var pglink = document.createElement("a");
+ pglink.appendChild(document.createTextNode('Start'));
+ pglink.setAttribute('href',theLink + '&cstart=0' +
+ '&csize=' + cpsize);
+ pglink.setAttribute('class','classic_link');
+ node.appendChild(pglink);
+ node.appendChild(document.createTextNode(' '));
+ var pglink = document.createElement("a");
+ pglink.appendChild(document.createTextNode('<<'));
+ pglink.setAttribute('href',theLink + '&cstart=' +
+ (cpstart - cpsize) + '&csize=' + cpsize);
+ pglink.setAttribute('class','classic_link');
+ node.appendChild(pglink);
+ node.appendChild(document.createTextNode(' '));
+ /*
+ */
+ }
+ if (ssize < pieces) {
+ node.appendChild(document.createTextNode(' '));
+ var pglink = document.createElement("a");
+ pglink.appendChild(document.createTextNode('>>'));
+ pglink.setAttribute('href',theLink + '&cstart=' +
+ ssize + '&csize=' + cpsize);
+ pglink.setAttribute('class','classic_link');
+ node.appendChild(pglink);
+ node.appendChild(document.createTextNode(' '));
+ var pglink = document.createElement("a");
+ pglink.appendChild(document.createTextNode('End'));
+ pglink.setAttribute('href',theLink + '&cstart=' +
+ (pieces - cpsize) + '&csize=' + cpsize);
+ pglink.setAttribute('class','classic_link');
+ node.appendChild(pglink);
+ /*
+ */
+ }
+ node.appendChild(document.createTextNode(')'));
+ /*
+ */
+ }//if node
}
function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) {
var isbnList = '';
var googleBooksLink = false;
var enableHoldsOnAvailable = false;
-var enableExtraSearchesLowHits = false;
+var enableExtraSearchesLowHits = true;
var localProxyPrefix = '';
+var suppressCopyCounts = true;
+var lookUpLimit = 25; //limit for invoking live status info
+
+function sortOutCopies(loc_id, rec_id, form_id) {
+ var copies = 0;
+ var recreq = new Request(FETCH_R_COPY_COUNTS, loc_id, rec_id, form_id);
+ recreq.send(true);
+ if (recreq) {
+ var copy_info = recreq.result();
+ for (var i in copy_info) {
+ //alert(loc_id + ' - ' + i + ' - ' + copy_info[i].available);
+ if (loc_id == copy_info[i].org_unit)
+ return copy_info[i].available;
+ }//for
+ }//if
+
+ return copies;
+}
+
+/* this was in opac_utils.js, putting here for now */
+function cleanISBN(isbn) {
+ if(isbn) {
+ isbn = isbn.toString().replace(/^\s+/,"");
+ var idx = isbn.indexOf(" ");
+ if(idx > -1) { isbn = isbn.substring(0, idx); }
+ } else isbn = "";
+ return isbn;
+}
/* an array of the extra services to which we want to direct people, in order of priority:
Properties:
/* set up the event handlers */
if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
G.evt.result.hitCountReceived.push(resultSetHitInfo);
+
+ //we don't display copy counts for consortium
//G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts);
G.evt.result.recordReceived.push(resultDisplayRecord);
- G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
+
+ //we don't display copy counts for consortium
+ //G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects,
resultDrawAuthors, resultDrawSeries, function(){unHideMe($('result_info_2'))},
fetchGoogleBooksLink);
G.ui.result.prev_link.setAttribute( "href", buildOPACLink(args));
addCSSClass(G.ui.result.prev_link, config.css.result.nav_active);
- $('prev_link2').setAttribute( "href", buildOPACLink(args));
+ //$('prev_link2').setAttribute( "href", buildOPACLink(args));
+ $('prev_link2').setAttribute( "href", buildOPACLink("/"));
addCSSClass($('prev_link2'), config.css.result.nav_active);
args[PARAM_OFFSET] = 0;
var r = table.rows[pos + 1];
var currentISBN = cleanISBN(rec.isbn());
+ var currentISSN = cleanISBN(rec.isbn());
if (googleBooksLink) {
var gbspan = $n(r, "googleBooksLink");
} catch(e){ }
*/
- var pic = $n(r, config.names.result.item_jacket);
- pic.setAttribute("src", buildISBNSrc(currentISBN));
+ var pic = $n(r, config.names.result.item_jacket);
+
+ if (currentISBN.length > 8) {
+ pic.setAttribute("src", buildISBNSrc(currentISBN));
+ } else {
+ pic.setAttribute("src", "/opac/images/blank.png");
+ }
var title_link = $n(r, config.names.result.item_title);
var author_link = $n(r, config.names.result.item_author);
+ if (currentISSN.length > 0) {
+ var issn_link = $n(r, "result_table_issn_cell");
+ issn_link.appendChild(text(currentISSN));
+ }//if
+
+ //alert(issn_link + " - " + cleanISBN(rec.isbn()));
+
if( is_mr ) {
var onlyrec = onlyrecord[ getOffset() + pos ];
if(onlyrec) {
args[PARAM_OFFSET] = 0;
args[PARAM_RID] = onlyrec;
args[PARAM_MRID] = rec.doc_id();
- pic.parentNode.setAttribute("href", buildOPACLink(args));
+ if (pic!= null)
+ pic.parentNode.setAttribute("href", buildOPACLink(args));
title_link.setAttribute("href", buildOPACLink(args));
title_link.appendChild(text(normalize(truncate(rec.title(), 65))));
args.page = RRESULT;
args[PARAM_OFFSET] = 0;
args[PARAM_MRID] = rec.doc_id();
- pic.parentNode.setAttribute("href", buildOPACLink(args));
+ if (pic != null)
+ pic.parentNode.setAttribute("href", buildOPACLink(args));
}
} else {
args.page = RDETAIL;
args[PARAM_OFFSET] = 0;
args[PARAM_RID] = rec.doc_id();
- pic.parentNode.setAttribute("href", buildOPACLink(args));
+ if (pic != null)
+ pic.parentNode.setAttribute("href", buildOPACLink(args));
//don't bother with holds at this point
/*
*/
// Stolen from trunk - (and stolen again from lul :-))
var here = findOrgUnit(getLocation());
- dojo.require('openils.BibTemplate');
- var l_cn_list = $n(r,'local_callnumber_list');
var onlyrec = rec.doc_id();
-
- dojo.addOnLoad(function () {
- new openils.BibTemplate({
- root : l_cn_list,
- record : '' + onlyrec,
- org_unit : here.shortname()
- }).render();
- unHideMe(l_cn_list);
- });
+ var copyCnt = sortOutCopies(getLocation(), onlyrec, null);
+
+ if (copyCnt <= lookUpLimit) {
+ dojo.require('openils.BibTemplate');
+ var l_cn_list = $n(r,'local_callnumber_list');
+
+ dojo.addOnLoad(function () {
+ new openils.BibTemplate({
+ root : l_cn_list,
+ record : '' + onlyrec,
+ org_unit : here.shortname()
+ }).render();
+ unHideMe(l_cn_list);
+ });
+ } else {
+ //there is probably an easier way to deal with IE on this but...
+ unHideMe( $n(r, "local_callnumber_list"));
+ var callSpot = $n(r, "local_callnumber_list").parentNode;
+ var newTd = document.createElement( 'td' )
+ //to do: internationalize this
+ newTd.appendChild(text("... " + copyCnt + " print items, please see full record for details."));
+ addCSSClass(newTd,"too_many_copies");
+ var newTr = document.createElement( 'tr' )
+ newTr.appendChild(newTd);
+ callSpot.insertBefore(newTr,
+ $n(r, "local_callnumber_list"));
+ }//if
}
buildSearchLink(STYPE_AUTHOR, rec.author(), author_link);
/* XXX Needs to understand Lasso copy counts... */
/* display the collected copy counts */
function resultDisplayCopyCounts(rec, pagePosition, copy_counts) {
- if(copy_counts == null || rec == null) return;
+ if(copy_counts == null || rec == null || suppressCopyCounts) return;
if (getLasso()) {
var copy_counts_lasso = {