unHideMe($n(templateRow, 'holdable_label'));
}
- if (isXUL() || showDueDate) {
+ //if (isXUL() || showDueDate) {
+ if (isXUL()) {
unHideMe($n(templateRow, 'due_date_label'));
}
var print = $n(templateRow,'print');
print.onclick = function() { cpdBuildPrintPane(
- contextRow, record, callnumber, orgid, depth) };
+ contextRow, record, callnumber, orgid, depth, copy_location) };
var mainTbody = $n(templateRow, 'copies_tbody');
var extrasRow = mainTbody.removeChild($n(mainTbody, 'copy_extras_row'));
/* builds a friendly print window for this CNs data */
-function cpdBuildPrintPane(contextRow, record, callnumber, orgid, depth) {
+function cpdBuildPrintPane(contextRow, record, callnumber, orgid, depth, copy_location) {
var div = cpdBuildPrintWindow( record, orgid);
- $n(div, 'cn').appendChild(text(callnumber));
+ $n(div, 'cn').appendChild(sortOutCNmaps(orgid,callnumber,copy_location));
unHideMe($n(div, 'copy_header'));
unHideMe($n(copyrow, 'copy_holdable_td'));
}
- if(isXUL() || showDueDate) {
+ //if(isXUL() || showDueDate) {
+ if(isXUL()) {
unHideMe($n(copyrow, 'copy_due_date_td'));
}
} else {
$n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"selector": "date", "formatLength": "medium"})));
}
+ unHideMe($n(r.args.templateRow, 'due_date_label'));
+ unHideMe($n(row, 'copy_due_date_td'));
}
}
}
var rdetailShowCopyLocation = true;
var rdetailGoogleBookPreview = true;
var rdetailDisplaySerialHoldings = true;
-var rdetailEnableRefWorks = false;
+var rdetailEnableRefWorks = true;
var rdetailRefWorksHost = 'http://refworks.scholarsportal.info';
var enableHoldsOnAvailable = false;
var urlCheck = true; //whether to use a url check to mask legacy urls
var urlExpr = /webvoy|janus|resolver/i; //regular expression
+
+/* assume 1 copy unless we look for more */
+var cpCnt = 1;
/* 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
+/* used for call number checks */
+String.prototype.startsWith = function(str)
+{return (this.match("^"+str)==str)}
+
/* vars vars vars */
var record = null;
var cp_statuses = null;
var rdetailStart = null;
var rdetailEnd = null;
- dojo.require("bibtemplate");
+/*
+this does simple call number mapping for building locations,
+we use prefix information for lining up location - array
+can be left blank if not used
+
+objCN(location id, prefix, location (to be appended to call number),
+ string to use for identifying building location from call number location)
+
+for example:
+ new objCN(109, 'QA', '2nd Floor', 'circulating')
+*/
+var cnMapping = [
+ new objCN(109, 'L', '3rd Floor', 'circulating'),
+ new objCN(109, 'QA', '2nd Floor', 'circulating')
+];
+
+function objCN(locId, cnPrefix, cnLocation, locStr)
+{
+ //org id
+ this.locId = locId;
+ //prefix - what the call number starts with to indicate building location, e.g. 'QA'
+ this.cnPrefix = cnPrefix;
+ //the location string to append to the call number
+ this.cnLocation = cnLocation;
+ //this is the string from the call number location that flags material, e.g. 'circulating', 'monographs'
+ this.locStr = locStr;
+}
+
+dojo.require("bibtemplate");
/* serials are currently the only use of Dojo strings in the OPAC */
if (rdetailDisplaySerialHoldings) {
dojo.require("dijit.Menu");
function rdetailBuildInfoRows() {
var req;
var method = FETCH_COPY_COUNTS_SUMMARY;
- var cpCnt = 0;
//we figure out the number of copies
if (rdetailBreakUpLargeSets)
unHideMe(rowNode);
rdetailSetPath( thisOrg, isLocal );
- rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, cl );
+ rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, cl);
if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
}
}//if node
}
+function sortOutCNmaps(orgId, cn, cl) {
+ var cnSuffix = '';
+ for (var i = 0; i < cnMapping.length && cnSuffix.length==0; i++) {
+ if (cnMapping[i].locId == orgId) {
+ var pos = cl.indexOf(cnMapping[i].locStr);
+ if (cn.startsWith(cnMapping[i].cnPrefix)) {
+ //does call number location contain string?
+ if (cl.indexOf(cnMapping[i].locStr) != -1)
+ cnSuffix = cnMapping[i].cnLocation;
+ }//if
+ }//if
+ }//for
+ return (text(cn + ' ' + cnSuffix));
+}//sortOutCNmaps
+
function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) {
if(local) {
var depth = getDepth();
if( !local ) depth = findOrgDepth(globalOrgTree);
-
- $n(row, 'rdetail_callnumber_cell').appendChild(text(cn));
+
+ $n(row, 'rdetail_callnumber_cell').appendChild(sortOutCNmaps(orgNode.id(),cn, cl));
if (rdetailShowCopyLocation) {
var cl_cell = $n(row, 'rdetail_copylocation_cell');
);
req.send();
};
+ } else {
+ if (cpCnt <= 1)
+ eval(dHref);
}
}