From: artunit Date: Sun, 26 Sep 2010 03:40:19 +0000 (+0000) Subject: some changes for records with many items, slight reformat of subject display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c063b9906e3f0dff6de6ca0f4c746021d192bc06;p=contrib%2FConifer.git some changes for records with many items, slight reformat of subject display git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@1007 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/web/opac/skin/uwin/README b/web/opac/skin/uwin/README new file mode 100644 index 0000000000..6bdda910f4 --- /dev/null +++ b/web/opac/skin/uwin/README @@ -0,0 +1,25 @@ +The University of Windsor has serial titles where hundreds +and even thousands of items that have been added, typically microfilm +that has been individually barcoded for interlibrary loan. This skin +has a number of workarounds to accomodate the overhead associated +with exposing extensive holdings in marcxml-format, we also add one page +definition to "config.js", usually installed at: + +/openils/var/web/opac/common/js/config.js + +anchored by the comment (/* */) sections below: + +/* pages */ +var RSDETAIL = "rsdetail"; + +/* Set up the page names */ +config.page[RSDETAIL] = "rsdetail.xml"; + +Dan Scott (dbs) came up with a much more elegant solution to +how it is handled in this layout this evening on IRC but +I have taken the route that is least disruptive to the other +skins for switching this version over to production in the +short term (since the massive multi-item problem can slurp +up a lot of cpu processing capacity). + +art rhyno, u. of windsor - Sept. 25, 2010 diff --git a/web/opac/skin/uwin/css/layout.css b/web/opac/skin/uwin/css/layout.css index 99a39d21aa..3b7c854802 100644 --- a/web/opac/skin/uwin/css/layout.css +++ b/web/opac/skin/uwin/css/layout.css @@ -273,9 +273,18 @@ table { border-collapse: collapse; } */ .search_link { - color: blue; + color: #005596; } .search_link:visited { - color: purple; + color: #005596; +} + +.search_link:hover { + color: red; + text-decoration: none; +} + +.libselect { + text-decoration: none; } diff --git a/web/opac/skin/uwin/js/bibtemplate.js b/web/opac/skin/uwin/js/bibtemplate.js new file mode 100644 index 0000000000..819281d81b --- /dev/null +++ b/web/opac/skin/uwin/js/bibtemplate.js @@ -0,0 +1,85 @@ +/* --------------------------------------------------------------------------- + * Copyright (C) 2009 Equinox Software, Inc. + * Mike Rylander + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * --------------------------------------------------------------------------- + */ + +if(!dojo._hasResource["bibtemplate"]) { + + dojo.require('dojox.data.dom'); + dojo._hasResource["bibtemplate"] = true; + dojo.provide("bibtemplate"); + dojo.declare('bibtemplate', null, { + + constructor : function(kwargs) { + this.root = kwargs.root; + this.record = kwargs.record; + this.org_unit = kwargs.org_unit || '-'; + }, + + render : function() { + var all_slots = dojo.query('*[type^=opac/slot-data]', this.root); + + var slots = {}; + dojo.forEach(all_slots, function(s){ + var datatype = 'marcxml'; + + if (s.getAttribute('type').indexOf('+') > -1) + datatype = s.getAttribute('type').split('+').reverse()[0]; + + if (!slots[datatype]) slots[datatype] = []; + slots[datatype].push(s); + }); + + for (var datatype in slots) { + + (function (slot_list,dtype,rec,org) { + + dojo.xhrGet({ + url: '/opac/extras/unapi?id=tag:opac:biblio-record_entry/' + rec + '/' + org + '&format=' + datatype, + handleAs: 'xml', + load: function (bib) { + + dojo.forEach(slot_list, function (slot) { + var joiner = slot.getAttribute('join') || ' '; + + var slot_handler = dojo.map( + dojo.query( '*[type=opac/slot-format]', slot ).orphan(), + function(x){ return dojox.data.dom.textContent(x) || x.innerHTML } + ).join(''); + + if (slot_handler) slot_handler = new Function('item', slot_handler); + else slot_handler = new Function('item','return dojox.data.dom.textContent(item);'); + + var item_list = dojo.query( + slot.getAttribute('query'), + bib + ); + + if (item_list.length) slot.innerHTML = dojo.map(item_list, slot_handler).join(joiner); + + delete(slot_handler); + + }); + } + }); + + })(slots[datatype],datatype,this.record,this.org_unit); + + } + + return true; + } + }); + +} diff --git a/web/opac/skin/uwin/js/rdetail.js b/web/opac/skin/uwin/js/rdetail.js index 60f87ededd..72b5214512 100644 --- a/web/opac/skin/uwin/js/rdetail.js +++ b/web/opac/skin/uwin/js/rdetail.js @@ -16,6 +16,9 @@ var rdetailEnableRefWorks = false; var rdetailRefWorksHost = 'http://refworks.scholarsportal.info'; var enableHoldsOnAvailable = false; +var urlCheck = true; //whether to use a url check to mask legacy urls +var urlExpr = "/ezproxy|laws/i"; //regular expression + /* threshold for paging */ var rdetailBreakUpLargeSets = true; //flag for paging support var pgThreshold = 15; //the number of items to invoke paging @@ -48,6 +51,7 @@ var rdetailNext = null; var rdetailStart = null; var rdetailEnd = null; + dojo.require("bibtemplate"); /* serials are currently the only use of Dojo strings in the OPAC */ if (rdetailDisplaySerialHoldings) { dojo.require("dijit.Menu"); @@ -374,7 +378,8 @@ function _rdetailDraw(r) { for( var i = 0; links && links.length > 0 && i < links.length; i = i + 3 ) { var href = links[i]; // avoid matching "HTTP: The Complete Reference" - if( href.match(/https?:\/|ftps?:\/|mailto:/i) ) { + //if( href.match(/https?:\/|ftps?:\/|mailto:|http?:/i) && href.match(/ezproxy|law/i )) { + if( href.match(/https?:\/|ftps?:\/|mailto:|http?:/i) && urlCheck?href.match(urlExpr):true) { unHideMe($('rdetail_online_row')); // MODS can contain a display label (used for the text of the link) // as well as a note about the URL; many legacy systems conflate the diff --git a/web/opac/skin/uwin/js/result_common.js b/web/opac/skin/uwin/js/result_common.js index 3cc5a09171..ecf7bc3d92 100644 --- a/web/opac/skin/uwin/js/result_common.js +++ b/web/opac/skin/uwin/js/result_common.js @@ -8,7 +8,7 @@ var enableHoldsOnAvailable = false; var enableExtraSearchesLowHits = true; var localProxyPrefix = ''; var suppressCopyCounts = true; -var lookUpLimit = 25; //limit for invoking live status info +var lookUpLimit = 100; //limit for invoking live status info function sortOutCopies(loc_id, rec_id, form_id) { var copies = 0; @@ -17,7 +17,6 @@ function sortOutCopies(loc_id, rec_id, form_id) { 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 @@ -521,11 +520,15 @@ function unhideGoogleBooksLink (data) { } /* riff on buildTitleDetailLink from opac_utils */ -function buildResultTitleDetailLink(rec, link) { +function buildResultTitleDetailLink(rec, link, copyCnt) { if(!rec) return; link.appendChild(text(normalize(truncate(rec.title(), 500)))); var args = {}; args.page = RDETAIL; + + if (copyCnt > lookUpLimit) + args.page = RSDETAIL; + args[PARAM_RID] = rec.doc_id(); // in IE, if the link text contains a '@', it replaces the innerHTML text // with the value of the href attribute. Wait, what? Yes. Capture the @@ -611,9 +614,11 @@ function resultDisplayRecord(rec, pos, is_mr) { } } else { - buildunAPISpan($n(r,'unapi'), 'biblio-record_entry', rec.doc_id()); + var onlyrec = rec.doc_id(); + buildunAPISpan($n(r,'unapi'), 'biblio-record_entry', onlyrec); + var copyCnt = sortOutCopies(getLocation(), onlyrec, null); - buildResultTitleDetailLink(rec, title_link); + buildResultTitleDetailLink(rec, title_link, copyCnt); var args = {}; args.page = RDETAIL; args[PARAM_OFFSET] = 0; @@ -632,8 +637,6 @@ function resultDisplayRecord(rec, pos, is_mr) { */ // Stolen from trunk - (and stolen again from lul :-)) var here = findOrgUnit(getLocation()); - var onlyrec = rec.doc_id(); - var copyCnt = sortOutCopies(getLocation(), onlyrec, null); if (copyCnt <= lookUpLimit) { dojo.require('openils.BibTemplate'); @@ -653,7 +656,7 @@ function resultDisplayRecord(rec, pos, is_mr) { 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.")); + newTd.appendChild(text("... " + copyCnt + " print items, please see full record for details on print and digital coverage.")); addCSSClass(newTd,"too_many_copies"); var newTr = document.createElement( 'tr' ) newTr.appendChild(newTd); diff --git a/web/opac/skin/uwin/js/sidebar_extras.js b/web/opac/skin/uwin/js/sidebar_extras.js index 0b4bc8bb24..db82fd308d 100644 --- a/web/opac/skin/uwin/js/sidebar_extras.js +++ b/web/opac/skin/uwin/js/sidebar_extras.js @@ -106,6 +106,9 @@ function resultFireXRefBatch(treeName, xrefCache, stype) { var topic = xrefCache[i]; query.push( [ topic.type, topic.term ] ); } + //FLAG for UWIN before SVN - art + return; + //alert(FETCH_CROSSREF_BATCH + ' - ' + query); var req = new Request(FETCH_CROSSREF_BATCH, query); var tree; eval('tree=' + treeName); diff --git a/web/opac/skin/uwin/xml/common/libselect.xml b/web/opac/skin/uwin/xml/common/libselect.xml index 0dcbeea96d..0f17dee4b4 100644 --- a/web/opac/skin/uwin/xml/common/libselect.xml +++ b/web/opac/skin/uwin/xml/common/libselect.xml @@ -4,7 +4,7 @@ &library.select; - diff --git a/web/opac/skin/uwin/xml/page_rresult.xml b/web/opac/skin/uwin/xml/page_rresult.xml index 05357b8eb7..062717ae9b 100644 --- a/web/opac/skin/uwin/xml/page_rresult.xml +++ b/web/opac/skin/uwin/xml/page_rresult.xml @@ -4,6 +4,7 @@ + diff --git a/web/opac/skin/uwin/xml/page_rsdetail.xml b/web/opac/skin/uwin/xml/page_rsdetail.xml new file mode 100644 index 0000000000..94dd235cd8 --- /dev/null +++ b/web/opac/skin/uwin/xml/page_rsdetail.xml @@ -0,0 +1,88 @@ +
+ + + + + + + + + + + + + + + + + + +
+ + + &rdetail.result; + &common.of; + + + + + &rdetail.start; + << &rdetail.page.previous; + + &rdetail.page.next; >> + &rdetail.end; + + +
+ + + + + + + + + + +
+ &rdetail.detailMain.headerLabel; + + + &opac.holds.exportRefWorks; + + + &opac.holds.placeHold; + + + + + +
+ +
+ &rdetail.record.deleted; +
+ + + + +
&rdetail.none;
+
&rdetail.bookbag.add.success;
+
&rdetail.bookbag.name;
+
&rdetail.bookbag.create.success;
+ +
diff --git a/web/opac/skin/uwin/xml/rdetail/rdetail_subset_summary.xml b/web/opac/skin/uwin/xml/rdetail/rdetail_subset_summary.xml new file mode 100644 index 0000000000..b548efb796 --- /dev/null +++ b/web/opac/skin/uwin/xml/rdetail/rdetail_subset_summary.xml @@ -0,0 +1,471 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
&opac.image_provided;
+ +
+
&common.title; + +
&common.alternate.title; + +
&common.author; + +
&common.author; + +
&common.corporate.author; + +
&common.meeting.name; + +
&common.isbn; + +
&common.issn; + +
&common.edition; + +
&common.pubdate;
&common.publisher; + +
&common.physical;
&common.format; + + +
&rdetail.detailMain.abstract; + +
&common.subject.600; + +
&common.subject.610; + +
&common.subject.611; + +
&common.subject.630; + +
&common.subject.648; + +
&common.subjects; + +
&common.subject.651; + +
&common.subject.653; + +
&common.subject.654; + +
&common.subject.655; + +
&common.subject.656; + +
&common.subject.657; + +
&common.subject.658; + +
&common.subject.662; + +
&common.general.note; + +
&common.contents.note; + +
&common.usage.restrictions; + +
&common.performer.note; + +
&common.additional.authors; + +
&common.preceding.entry; + +
&common.succeeding.entry; + +
+
+ +
+ SFX E-Journals
+
&rdetail.summary.online; + +
+ + + +
+ diff --git a/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml b/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml index 462f852303..7d2de9efa6 100644 --- a/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml +++ b/web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml @@ -431,17 +431,29 @@ var total = ''; var output = []; var list = dojo.query( 'subfield:not([code=2])', item ); + var main_subject = ''; for (var i =0; i < list.length; i++) { + var current = ""; total += dojox.data.dom.textContent(list[i]) + ' '; - var current = '' + dojox.data.dom.textContent(list[i]) + '' + if (i > 0) { + current += '">' + main_subject + dojox.data.dom.textContent(list[i]) + '' + } else { + current += '">' + dojox.data.dom.textContent(list[i]) + '' + } + + main_subject += dojox.data.dom.textContent(list[i]) + ' -- '; + current += '
'; output.push(current); } - return '' + output.join(' -- ') + '
'; + + return output.join('   '); } dojo.addOnLoad( function () { diff --git a/web/opac/skin/uwin/xml/setenv.xml b/web/opac/skin/uwin/xml/setenv.xml index e64b27020e..9bccc9c000 100644 --- a/web/opac/skin/uwin/xml/setenv.xml +++ b/web/opac/skin/uwin/xml/setenv.xml @@ -16,6 +16,9 @@ + + +