[open-ils-commits] r996 - in conifer/branches/rel_1_6_1/web/opac/skin/uwin: css js xml xml/rdetail xml/result (artunit)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 17 14:11:12 EDT 2010
Author: artunit
Date: 2010-09-17 14:11:08 -0400 (Fri, 17 Sep 2010)
New Revision: 996
Modified:
conifer/branches/rel_1_6_1/web/opac/skin/uwin/css/layout.css
conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/rdetail.js
conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/result_common.js
conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar.js
conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar_extras.js
conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/footer.xml
conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/page_rdetail.xml
conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml
conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_info.xml
conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_table.xml
Log:
syncing files from comet
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/css/layout.css
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/css/layout.css 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/css/layout.css 2010-09-17 18:11:08 UTC (rev 996)
@@ -38,7 +38,9 @@
#main_left_cell { width: 20%; vertical-align: top;margin: 0px; padding: 0px;}
#main_right_cell { width: 80%; vertical-align: top; margin: 0px; padding:0px; padding-right:5px;}
+.too_many_copies {font-weight: bold; color: #000000;}
+
#content { min-height: 300px; }
.canvas { min-height: 300px; padding-left: 4px; -moz-border-radius: 6px;}
@@ -113,16 +115,16 @@
.result_table_format_cell { font-size: medium; text-align: left;}
/* style dan's supercool live status stuff */
-/* windsor's other colour is #B2BB1E */
-.live_call_cell { color: #005595; font-weight: bold; text-align: left; }
+/* windsor's colours are #005595 #B2BB1E */
+.live_call_cell { color: #000000; font-weight: bold; text-align: left; }
.live_separator_cell { font-weight: bold; text-align: left; }
-.live_location_cell { color: #005595; font-weight: bold; text-align: left; }
+.live_location_cell { color: #000000; font-weight: bold; text-align: left; }
.live_status_cell { color: #000000; font-weight: bold; text-align: left; }
.copy_count_cell { width: 0%; vertical-align: middle; text-align: center; }
.copy_count_div { width: 4em; height: 99%; vertical-align: middle; text-align: center; }
-.search_page_nav_link { color: red; margin-right: 5px; }
+.search_page_nav_link { margin-right: 5px; }
.np_nav_link { margin-right: 5px; }
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/rdetail.js
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/rdetail.js 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/rdetail.js 2010-09-17 18:11:08 UTC (rev 996)
@@ -16,6 +16,11 @@
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;
@@ -733,170 +738,418 @@
}
function rdetailBuildInfoRows() {
- var req;
- var method = FETCH_COPY_COUNTS_SUMMARY;
- if (rdetailShowCopyLocation)
- method = FETCH_COPY_LOCATION_COUNTS_SUMMARY;
+ var req;
+ var method = FETCH_COPY_COUNTS_SUMMARY;
+ var cpCnt = 0;
- if( rdetailShowLocal )
- req = new Request(method, record.doc_id(), getLocation(), getDepth())
- else
- req = new Request(method, record.doc_id());
- req.callback(_rdetailBuildInfoRows);
- req.send();
+ //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;
- }
- }
- }
- }
+function rdetailCNPrint(orgid, cn) {
+ var div = cpdBuildPrintWindow( record, orgid);
+ var template = div.removeChild($n(div, 'cnrow'));
+ var rowNode = $("cp_info_" + orgid);
+ cpdStylePopupWindow(div);
+ openWindow(div.innerHTML);
+}
- if(!node && findOrgType(globalOrgTree.ou_type()).can_have_vols())
- node = globalOrgTree;
+var localCNFound = false;
+var ctr = 0;
+function _rdetailBuildInfoPagedRows(r) {
- /* don't show hidden orgs */
+ //alert(r.getText());
+ if (!r) return;
+ /*
+ */
+ var summary = r.getResultObject();
+ if(!summary) return;
- if(node) {
+ summary.sort(callsortfn);
+ if (rdetailShowCopyLocation)
+ unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header' ) );
- if(!isXUL() && !isTrue(node.opac_visible())) return;
+ removeChildren(copyRowParent);
- var row = copyRow.cloneNode(true);
- row.id = "cp_info_" + node.id();
+ 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);
- 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');
+ _rdetailRows(null,summaryStart, pgSize, summarySize, tot_copies);
+ var found = true;
- var p = libtd.getElementsByTagName('a')[0];
- libtd.insertBefore(text(node.name()), p);
- libtd.setAttribute("style", "padding-left: " + ((findOrgDepth(node) - 1) * 9) + "px;");
+ 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(!findOrgType(node.ou_type()).can_have_vols()) {
+ if(rowNode.getAttribute("used")) {
- row.removeChild(cntd);
- row.removeChild(cpctd);
- row.removeChild(actions);
- row.setAttribute('novols', '1');
+ 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));
+ }
- libtd.setAttribute("colspan", numStatuses + 3 );
- libtd.colSpan = numStatuses + 3;
- addCSSClass(row, 'copy_info_region_row');
- }
+ 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);
- copyRowParent.appendChild(row);
+ } else {
+ rowNode.setAttribute("used", "1");
+ }
- } else { node = globalOrgTree; }
+ var cpc_temp = rowNode.removeChild(
+ findNodeByName(rowNode, config.names.rdetail.cp_count_cell));
- for( var c in node.children() )
- _rdetailRows(node.children()[c]);
-}
+ var statuses = arr[2];
+ var cl = '';
-function rdetailCNPrint(orgid, cn) {
- var div = cpdBuildPrintWindow( record, orgid);
- var template = div.removeChild($n(div, 'cnrow'));
- var rowNode = $("cp_info_" + orgid);
- cpdStylePopupWindow(div);
- openWindow(div.innerHTML);
+ 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);
}
-var localCNFound = false;
-var ctr = 0;
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);
+ removeChildren(copyRowParent);
- _rdetailRows();
+ _rdetailRows();
- var summary = r.getResultObject();
- if(!summary) return;
+ 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++ ) {
+ 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;
+ 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.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));
- }
+ 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);
+ 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");
- }
+ } else {
+ rowNode.setAttribute("used", "1");
+ }
- var cpc_temp = rowNode.removeChild(
- findNodeByName(rowNode, config.names.rdetail.cp_count_cell));
+ 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];
- }
+ var statuses = arr[2];
+ var cl = '';
+ if (rdetailShowCopyLocation) {
+ cl = arr[2];
+ statuses = arr[3];
+ }
+ rdetailApplyStatuses(rowNode, cpc_temp, statuses);
- rdetailApplyStatuses(rowNode, cpc_temp, statuses);
+ var isLocal = false;
+ if( orgIsMine( findOrgUnit(getLocation()), thisOrg ) ) {
+ found = true;
+ isLocal = true;
+ if(!localCNFound) {
+ localCNFound = true;
+ defaultCN = arr[1];
+ }
+ }
- 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);
- //if(isLocal) unHideMe(rowNode);
- unHideMe(rowNode);
+ rdetailSetPath( thisOrg, isLocal );
+ rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, cl );
- rdetailSetPath( thisOrg, isLocal );
- rdetailBuildBrowseInfo( rowNode, arr[1], isLocal, thisOrg, cl );
+ if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
+ }
- if( i == summary.length - 1 && !defaultCN) defaultCN = arr[1];
- }
+ if(!found) unHideMe(G.ui.rdetail.cp_info_none);
+}
- if(!found) unHideMe(G.ui.rdetail.cp_info_none);
+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;
+ }
+ }
+ }
+ }
+
+ 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();
+ //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');
+
+ 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');
+ 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;
+}
+
+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) {
if(local) {
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/result_common.js
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/result_common.js 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/result_common.js 2010-09-17 18:11:08 UTC (rev 996)
@@ -5,9 +5,37 @@
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:
url: will be proxied via localProxyPrefix
@@ -33,9 +61,13 @@
/* 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);
@@ -437,7 +469,8 @@
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;
@@ -513,6 +546,7 @@
var r = table.rows[pos + 1];
var currentISBN = cleanISBN(rec.isbn());
+ var currentISSN = cleanISBN(rec.isbn());
if (googleBooksLink) {
var gbspan = $n(r, "googleBooksLink");
@@ -537,12 +571,24 @@
} 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) {
@@ -553,7 +599,8 @@
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))));
@@ -565,7 +612,8 @@
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 {
@@ -576,7 +624,8 @@
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
/*
@@ -589,18 +638,34 @@
*/
// 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();
+ var copyCnt = sortOutCopies(getLocation(), onlyrec, null);
- dojo.addOnLoad(function () {
- new openils.BibTemplate({
- root : l_cn_list,
- record : '' + onlyrec,
- org_unit : here.shortname()
- }).render();
- unHideMe(l_cn_list);
- });
+ 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);
@@ -802,7 +867,7 @@
/* 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 = {
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar.js
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar.js 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar.js 2010-09-17 18:11:08 UTC (rev 996)
@@ -177,7 +177,8 @@
}
function setSidebarLinks() {
- G.ui.sidebar.home_link.setAttribute("href", buildOPACLink({page:HOME}));
+ //G.ui.sidebar.home_link.setAttribute("href", buildOPACLink({page:HOME}));
+ G.ui.sidebar.home_link.setAttribute("href", "/");
G.ui.sidebar.advanced_link.setAttribute("href", buildOPACLink({page:ADVANCED}));
G.ui.sidebar.myopac_link.setAttribute("href", buildOPACLink({page:MYOPAC}, false, true));
}
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar_extras.js
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar_extras.js 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/js/sidebar_extras.js 2010-09-17 18:11:08 UTC (rev 996)
@@ -4,6 +4,7 @@
var subjectCache = {};
var authorCache = {};
var seriesCache = {};
+var hrefList = "";
function resultBuildCaches(records) {
for( var r in records ) {
@@ -75,7 +76,9 @@
var item = normalize(truncate(items[i], 65));
var args = {};
var href = resultQuickLink( items[i], stype );
- tree.addNode( stype + "_" + items[i], treeName + 'Root', item, href );
+ if (hrefList.indexOf(href) == -1)
+ tree.addNode( stype + "_" + items[i], treeName + 'Root', item, href );
+ hrefList+=href;
// if( !IE ) resultFireXRefReq(treeName, stype, items[i]);
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/footer.xml
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/footer.xml 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/footer.xml 2010-09-17 18:11:08 UTC (rev 996)
@@ -1,50 +1,39 @@
-<div id='copyright_block'>
- <div id='footer_links'>
- <span class='footer_link'>
- <a class='classic_link'
- href='/opac/<!--#echo var="locale"-->/extras/slimpac/start.html'>&opac.basic;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.help.url;'>&footer.help;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.ejournals.url;'>&lu.footer.ejournals;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.databases.url;'>&lu.footer.databases;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.library.url;'>&lu.footer.library.about;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.archives.url;'>&lu.footer.archives;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.reserves.url;'>&lu.footer.reserves;</a>
- </span>
- <span> | </span>
- <span class='footer_link'>
- <a target='_blank' class='classic_link'
- href='&lu.footer.feedback.url;'>&lu.footer.feedback;</a>
- </span>
-
- </div>
- <div id='copyright_text'>
- <span>&footer.copyright;</span>
- </div>
- <div id='footer_logo'>&footer.logo;
- <a href='http://open-ils.org'><img style='border:none;' src='../../../../images/eg_tiny_logo.jpg'/></a>
- </div>
-</div>
+<div id='copyright_block'>
+ <div id='footer_links'>
+ <span class='footer_link'>
+ <a target='_blank' class='classic_link'
+ href='http://windsor.concat.ca/opac/en-CA/extras/slimpac/start.html'>Basic Catalogue (HTML only)</a>
+ </span>
+ <span> | </span>
+ <span class='footer_link'>
+ <a target='_blank' class='classic_link'
+ href='&uwin.footer.home.leddy.url;'>&uwin.footer.home.leddy;</a>
+ </span>
+ <span> | </span>
+ <span class='footer_link'>
+ <a target='_blank' class='classic_link'
+ href='&uwin.footer.home.law.url;'>&uwin.footer.home.law;</a>
+ </span>
+ <span> | </span>
+ <span class='footer_link'>
+ <a target='_blank' class='classic_link'
+ href='&uwin.footer.help.url;'>&uwin.footer.help;</a>
+ </span>
+ <span> | </span>
+ <span class='footer_link'>
+ <a target='_blank' class='classic_link'
+ href='&uwin.footer.journals.url;'>&uwin.footer.journals;</a>
+ </span>
+ <span> | </span>
+ <span class='footer_link'>
+ <a target='_blank' class='classic_link'
+ href='&uwin.footer.databases.url;'>&uwin.footer.databases;</a>
+ </span>
+ </div>
+ <div id='copyright_text'>
+ <span>&footer.copyright;</span>
+ </div>
+ <div id='footer_logo'>&footer.logo;
+ <a href='http://open-ils.org'><img style='border:none;' src='../../../../images/eg_tiny_logo.jpg'/></a>
+ </div>
+</div>
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/page_rdetail.xml
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/page_rdetail.xml 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/page_rdetail.xml 2010-09-17 18:11:08 UTC (rev 996)
@@ -28,10 +28,10 @@
<a class='np_nav_link classic_link hide_me' id='np_start'
href='javascript:rdetailStart();' title="&rdetail.page.results;">&rdetail.start;</a>
<a class='np_nav_link classic_link hide_me' id='np_prev'
- href='javascript:rdetailPrev();' title='&rdetail.page.previous;'>&rdetail.page.previous.short;</a>
+ href='javascript:rdetailPrev();' title='&rdetail.page.previous;'><< &rdetail.page.previous;</a>
<span> </span>
<a class='np_nav_link classic_link hide_me' id='np_next'
- href='javascript:rdetailNext();' title='&rdetail.page.next;'>&rdetail.page.next.short;</a>
+ href='javascript:rdetailNext();' title='&rdetail.page.next;'>&rdetail.page.next; >></a>
<a class='np_nav_link classic_link hide_me' id='np_end'
href='javascript:rdetailEnd();' title="&rdetail.page.last;">&rdetail.end;</a>
</span>
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml 2010-09-17 18:11:08 UTC (rev 996)
@@ -106,17 +106,23 @@
req.oncomplete = function(r) {
var msg;
dojo.forEach(r.recv().content(), function(entry) {
- if (first_issn) {
- dojo.query('#rdetail_online *').orphan();
- first_issn = false;
- }
- dojo.place('<div style="width: 100%">'
- + ' <a class="search_link" href="' + entry.target_url
- + '">' + entry.public_name + '</a> - '
- + entry.target_coverage
- + (entry.target_embargo ? (' / ' + entry.target_embargo) : '')
- + '</div>', 'rdetail_online');
- dojo.query('#rdetail_online_row').removeClass('hide_me');
+ var resolverInfo = entry.public_name + "_" + entry.target_coverage;
+ //uwin has a lot of duplicates for some reason
+ if (url_list.indexOf(resolverInfo) == -1) {
+ if (first_issn) {
+ dojo.query('#rdetail_online *').orphan();
+ first_issn = false;
+ }
+
+ dojo.place('<div style="width: 100%">'
+ + ' <a class="search_link" href="' + entry.target_url
+ + '">' + entry.public_name + '</a> - '
+ + entry.target_coverage
+ + (entry.target_embargo ? (' / ' + entry.target_embargo) : '')
+ + '</div>', 'rdetail_online');
+ dojo.query('#rdetail_online_row').removeClass('hide_me');
+ url_list += resolverInfo;
+ }//if url_list
});
}
req.send();
@@ -405,6 +411,7 @@
/* Only clear the resources box once */
var first_issn = true;
+ var url_list = "";
function subjectMe(tag, item) {
dojo.query(tag).removeClass('hide_me');
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_info.xml
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_info.xml 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_info.xml 2010-09-17 18:11:08 UTC (rev 996)
@@ -20,14 +20,14 @@
<span id='start_end_links_span' class='hide_me'
style='padding-left: 40px;' >
- <a class='search_page_nav_link' id='search_home_link'
- title="&rdetail.page.results;">&rdetail.start;</a><a class='search_page_nav_link'
- id='prev_link' title='&rdetail.page.previous;'>&rdetail.page.previous.short;</a>
+ <a class='search_link' id='search_home_link'
+ title="&rdetail.page.results;" style='padding-left: 1em;'>&rdetail.start;</a><a class='search_link'
+ id='prev_link' title='&rdetail.page.previous;' style='padding-left: 1em;'>&common.cn.previous;</a>
<span class='search_page_nav_link' id='page_numbers'> </span>
- <a class='search_page_nav_link' id='next_link'
- title='&rdetail.page.next;'>&rdetail.page.next.short;</a>
+ <a class='search_link' id='next_link'
+ title='&rdetail.page.next;' style='padding-left: 1em;'>&common.cn.next;</a>
<!--
<a class='search_page_nav_link'
id='end_link' title="&rdetail.page.last;">&rdetail.end;</a>
Modified: conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_table.xml
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_table.xml 2010-09-15 21:48:15 UTC (rev 995)
+++ conifer/branches/rel_1_6_1/web/opac/skin/uwin/xml/result/result_table.xml 2010-09-17 18:11:08 UTC (rev 996)
@@ -68,7 +68,7 @@
</tr>
<tr name="local_callnumber_list" class="result_table_title_cell hide_me">
- <td colspan="2">&result.localCallNumbers;
+ <td colspan="1">&result.localCallNumbers;
<!-- Prevent records with dozens of items attached from filling the screen -->
<span type='opac/slot-data+marcxml-full' query='volumes'>
<span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
@@ -266,11 +266,11 @@
style='padding-left: 40px;' >
<a class='search_page_nav_link' id='search_home_link2'
title="&rdetail.page.results;">&rdetail.start;</a><a class='search_page_nav_link'
- id='prev_link2' title='&rdetail.page.previous;'>&rdetail.page.previous.symbol;</a>
+ id='prev_link2' title='&rdetail.page.previous;'>&common.cn.previous;</a>
<span class='search_page_nav_link' id='page_numbers2'> </span>
<a class='search_page_nav_link' id='next_link2'
- title='&rdetail.page.next;'>&rdetail.page.next.symbol;</a>
+ title='&rdetail.page.next;'>&common.cn.next;</a>
<!--
<a class='search_page_nav_link'
id='end_link2' title="&rdetail.page.last;">&rdetail.end;</a>
More information about the open-ils-commits
mailing list