From: artunit Date: Fri, 17 Sep 2010 18:11:08 +0000 (+0000) Subject: syncing files from comet X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=833edec6d6b531bf3bdd543b5d4fa59016e2c8da;p=contrib%2FConifer.git syncing files from comet git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@996 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/web/opac/skin/uwin/css/layout.css b/web/opac/skin/uwin/css/layout.css index 0a7265de94..c2b590a9ca 100644 --- a/web/opac/skin/uwin/css/layout.css +++ b/web/opac/skin/uwin/css/layout.css @@ -38,6 +38,8 @@ table { border-collapse: collapse; } #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; } @@ -113,16 +115,16 @@ table { border-collapse: collapse; } .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; } diff --git a/web/opac/skin/uwin/js/rdetail.js b/web/opac/skin/uwin/js/rdetail.js index 7f59e6d37f..60f87ededd 100644 --- a/web/opac/skin/uwin/js/rdetail.js +++ b/web/opac/skin/uwin/js/rdetail.js @@ -16,6 +16,11 @@ var rdetailEnableRefWorks = false; 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,77 +738,39 @@ function rdetailShowTOC(r) { } 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); @@ -815,86 +782,372 @@ function rdetailCNPrint(orgid, cn) { 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) { diff --git a/web/opac/skin/uwin/js/result_common.js b/web/opac/skin/uwin/js/result_common.js index 56411ef7d8..083a8c9b7c 100644 --- a/web/opac/skin/uwin/js/result_common.js +++ b/web/opac/skin/uwin/js/result_common.js @@ -5,8 +5,36 @@ var lowHitCount = 4; 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: @@ -33,9 +61,13 @@ var resultCompiledSearch = null; /* 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 @@ function resultPaginate() { 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 @@ function resultDisplayRecord(rec, pos, is_mr) { 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 @@ function resultDisplayRecord(rec, pos, is_mr) { } 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 @@ function resultDisplayRecord(rec, pos, is_mr) { 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 @@ function resultDisplayRecord(rec, pos, is_mr) { 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 @@ function resultDisplayRecord(rec, pos, is_mr) { 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 @@ function resultDisplayRecord(rec, pos, is_mr) { */ // 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); @@ -802,7 +867,7 @@ function resultHandleCopyCounts(r) { /* 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 = { diff --git a/web/opac/skin/uwin/js/sidebar.js b/web/opac/skin/uwin/js/sidebar.js index 45296e41be..9fca31cc52 100644 --- a/web/opac/skin/uwin/js/sidebar.js +++ b/web/opac/skin/uwin/js/sidebar.js @@ -177,7 +177,8 @@ function initLogin() { } 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)); } diff --git a/web/opac/skin/uwin/js/sidebar_extras.js b/web/opac/skin/uwin/js/sidebar_extras.js index cb35d886d3..0b4bc8bb24 100644 --- a/web/opac/skin/uwin/js/sidebar_extras.js +++ b/web/opac/skin/uwin/js/sidebar_extras.js @@ -4,6 +4,7 @@ var subjectCache = {}; var authorCache = {}; var seriesCache = {}; +var hrefList = ""; function resultBuildCaches(records) { for( var r in records ) { @@ -75,7 +76,9 @@ function resultDrawSidebarTrees( stype, treeName, items, wrapperNode, destNode ) 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]); diff --git a/web/opac/skin/uwin/xml/footer.xml b/web/opac/skin/uwin/xml/footer.xml index 0d2e973a19..598f6d8e8f 100644 --- a/web/opac/skin/uwin/xml/footer.xml +++ b/web/opac/skin/uwin/xml/footer.xml @@ -1,50 +1,39 @@ - + diff --git a/web/opac/skin/uwin/xml/page_rdetail.xml b/web/opac/skin/uwin/xml/page_rdetail.xml index ef55029da5..f18b4b45f5 100644 --- a/web/opac/skin/uwin/xml/page_rdetail.xml +++ b/web/opac/skin/uwin/xml/page_rdetail.xml @@ -28,10 +28,10 @@ &rdetail.start; &rdetail.page.previous.short; + href='javascript:rdetailPrev();' title='&rdetail.page.previous;'><< &rdetail.page.previous; &rdetail.page.next.short; + href='javascript:rdetailNext();' title='&rdetail.page.next;'>&rdetail.page.next; >> &rdetail.end; diff --git a/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml b/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml index e62a09c2c7..9d2369fccb 100644 --- a/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml +++ b/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml @@ -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('
' - + ' ' + entry.public_name + ' - ' - + entry.target_coverage - + (entry.target_embargo ? (' / ' + entry.target_embargo) : '') - + '
', '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('
' + + ' ' + entry.public_name + ' - ' + + entry.target_coverage + + (entry.target_embargo ? (' / ' + entry.target_embargo) : '') + + '
', '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'); diff --git a/web/opac/skin/uwin/xml/result/result_info.xml b/web/opac/skin/uwin/xml/result/result_info.xml index 902035b808..c65480e20a 100644 --- a/web/opac/skin/uwin/xml/result/result_info.xml +++ b/web/opac/skin/uwin/xml/result/result_info.xml @@ -20,14 +20,14 @@ - &rdetail.start;&rdetail.page.previous.short; + &rdetail.start;&common.cn.previous; - &rdetail.page.next.short; + &common.cn.next; &rdetail.start;&rdetail.page.previous.symbol; + id='prev_link2' title='&rdetail.page.previous;'>&common.cn.previous; &rdetail.page.next.symbol; + title='&rdetail.page.next;'>&common.cn.next;