[open-ils-commits] r1401 - in conifer/branches/rel_2_0/web/opac/skin/algoma: js xml xml/common xml/myopac xml/rdetail xml/result (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 19 16:32:43 EDT 2011
Author: dbs
Date: 2011-04-19 16:32:38 -0400 (Tue, 19 Apr 2011)
New Revision: 1401
Added:
conifer/branches/rel_2_0/web/opac/skin/algoma/js/result_common.js
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_summary.xml
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/result/
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/result/result_table.xml
Removed:
conifer/branches/rel_2_0/web/opac/skin/algoma/js/copy_details.js
conifer/branches/rel_2_0/web/opac/skin/algoma/js/myopac.js
conifer/branches/rel_2_0/web/opac/skin/algoma/js/reserves.js
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac.xml
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac/myopac_cres.xml
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/page_myopac.xml
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_cn_details.xml
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_extras.xml
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/reserves/
Modified:
conifer/branches/rel_2_0/web/opac/skin/algoma/xml/common/css_common.xml
Log:
Start syncing up algoma skin
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/js/copy_details.js
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/js/copy_details.js 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/js/copy_details.js 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,413 +0,0 @@
-var cpdTemplate;
-var cpdCounter = 0;
-var cpdNodes = {};
-
-/* showDueDate will show the due date in the OPAC */
-var showDueDate = false;
-/* showDueTime will show the due time (hours and minutes) in the OPAC;
- if showDueDate is false, then showDueTime has no effect
-*/
-var showDueTime = false;
-
-function cpdBuild( contextTbody, contextRow, record, callnumber, orgid, depth, copy_location ) {
- var i = cpdCheckExisting(contextRow);
- if(i) return i;
-
- var counter = cpdCounter++;
-
- /* yank out all of the template rows */
- if(!cpdTemplate) cpdTemplate = $('rdetail_volume_details_row');
- var templateRow = cpdTemplate.cloneNode(true);
- templateRow.id = 'cpd_row_' + counter;
-
- /* shove a dummy a tag in before the context previous sibling */
- /*
- contextTbody.insertBefore(
- elem('a',{name:'slot_'+templateRow.id}), contextRow.previousSibling);
- goTo('#slot_'+templateRow.id);
- */
-
- if(grabUser()){
- unHideMe($n(templateRow, 'copy_cres_label'));
- }
-
- if(isXUL()) {
- /* unhide before we unhide/clone the parent */
- unHideMe($n(templateRow, 'age_protect_label'));
- unHideMe($n(templateRow, 'create_date_label'));
- unHideMe($n(templateRow, 'holdable_label'));
- }
-
- if (isXUL() || showDueDate) {
- unHideMe($n(templateRow, 'due_date_label'));
- }
-
- unHideMe(templateRow);
-
- var print = $n(templateRow,'print');
- print.onclick = function() { cpdBuildPrintPane(
- contextRow, record, callnumber, orgid, depth) };
-
- var mainTbody = $n(templateRow, 'copies_tbody');
- var extrasRow = mainTbody.removeChild($n(mainTbody, 'copy_extras_row'));
-
- var req = new Request(FETCH_COPIES_FROM_VOLUME, record.doc_id(), callnumber, orgid);
- req.callback(cpdDrawCopies);
-
- req.request.args = {
- contextTbody : contextTbody, /* tbody that holds the contextrow */
- contextRow : contextRow, /* the row our new row will be inserted after */
- record : record,
- callnumber : callnumber,
- orgid : orgid,
- depth : depth,
- templateRow : templateRow, /* contains everything */
- copy_location : copy_location,
- mainTbody : mainTbody, /* holds the copy rows */
- extrasRow : extrasRow, /* wrapper row for all extras */
- counter : counter
- };
-
- if( contextRow.nextSibling )
- contextTbody.insertBefore( templateRow, contextRow.nextSibling );
- else
- contextTbody.appendChild( templateRow );
-
- req.send();
- _debug('creating new details row with id ' + templateRow.id);
- cpdNodes[templateRow.id] = { templateRow : templateRow };
- return templateRow.id;
-}
-
-
-function cpdBuildPrintWindow(record, orgid) {
- var div = $('rdetail_print_details').cloneNode(true);
- div.id = "";
-
- $n(div, 'lib').appendChild(text(findOrgUnit(orgid).name()));
- $n(div, 'title').appendChild(text(record.title()));
- $n(div, 'author').appendChild(text(record.author()));
- $n(div, 'edition').appendChild(text(record.edition()));
- $n(div, 'pubdate').appendChild(text(record.pubdate()));
- $n(div, 'publisher').appendChild(text(record.publisher()));
- $n(div, 'phys').appendChild(text(record.physical_description()));
-
- return div;
-}
-
-function cpdStylePopupWindow(div) {
- var tds = div.getElementsByTagName('td');
- for( var i = 0; i < tds.length ; i++ ) {
- var td = tds[i];
- var sty = td.getAttribute('style');
- if(!sty) sty = "";
- td.setAttribute('style', sty + 'padding: 2px; border: 1px solid #F0F0E0;');
- if( td.className && td.className.match(/hide_me/) )
- td.parentNode.removeChild(td);
- }
-}
-
-
-/* builds a friendly print window for this CNs data */
-function cpdBuildPrintPane(contextRow, record, callnumber, orgid, depth) {
-
- var div = cpdBuildPrintWindow( record, orgid);
-
- $n(div, 'cn').appendChild(text(callnumber));
-
- unHideMe($n(div, 'copy_header'));
-
- var subtbody = $n(contextRow.nextSibling, 'copies_tbody');
- var rows = subtbody.getElementsByTagName('tr');
-
- for( var r = 0; r < rows.length; r++ ) {
- var row = rows[r];
- if(!row) continue;
- var name = row.getAttribute('name');
- if( name.match(/extras_row/) ) continue; /* hide the copy notes, stat-cats */
- var clone = row.cloneNode(true);
- var links = clone.getElementsByTagName('a');
- for( var i = 0; i < links.length; i++ )
- links[i].style.display = 'none';
-
- $n(div, 'tbody').appendChild(clone);
- }
-
- cpdStylePopupWindow(div);
- openWindow( div.innerHTML);
-}
-
-
-
-/* hide any open tables and if we've already
- fleshed this cn, just unhide it */
-function cpdCheckExisting( contextRow ) {
-
- var existingid;
- var next = contextRow.nextSibling;
-
- if( next && next.getAttribute('templateRow') ) {
- var obj = cpdNodes[next.id];
- if(obj.templateRow.className.match(/hide_me/))
- unHideMe(obj.templateRow);
- else hideMe(obj.templateRow);
- existingid = next.id;
- }
-
- if(existingid) _debug('row exists with id ' + existingid);
-
- for( var o in cpdNodes ) {
- var node = cpdNodes[o];
- if( existingid && o == existingid ) continue;
- hideMe(node.templateRow);
- removeCSSClass(node.templateRow.previousSibling, 'rdetail_context_row');
- }
-
- addCSSClass(contextRow, 'rdetail_context_row');
- if(existingid) return existingid;
- return null;
-}
-
-/*
-function cpdFetchCopies(r) {
- var args = r.args;
- args.cn = r.getResultObject();
- var req = new Request(FETCH_COPIES_FROM_VOLUME, args.cn.id());
- req.request.args = args;
- req.callback(cpdDrawCopies);
- req.send();
-}
-*/
-
-function cpdDrawCopies(r) {
-
- var copies = r.getResultObject();
- var args = r.args;
- var copytbody = $n(args.templateRow, 'copies_tbody');
- var copyrow = copytbody.removeChild($n(copytbody, 'copies_row'));
-
- if(grabUser()){
- unHideMe($n(copyrow, 'copy_cres_td'));
- }
-
-
- if(isXUL()) {
- /* unhide before we unhide/clone the parent */
- unHideMe($n(copyrow, 'age_protect_value'));
- unHideMe($n(copyrow, 'create_date_value'));
- unHideMe($n(copyrow, 'copy_holdable_td'));
- }
-
- if(isXUL() || showDueDate) {
- unHideMe($n(copyrow, 'copy_due_date_td'));
- }
-
- for( var i = 0; i < copies.length; i++ ) {
- var row = copyrow.cloneNode(true);
- var copyid = copies[i];
- var req = new Request(FETCH_FLESHED_COPY, copies[i]);
- req.callback(cpdDrawCopy);
- req.request.args = r.args;
- req.request.row = row;
- req.send();
- copytbody.appendChild(row);
- }
-}
-
-function cpdDrawCopy(r) {
- var copy = r.getResultObject();
- var row = r.row;
-
- if (r.args.copy_location && copy.location().name() != r.args.copy_location) {
- hideMe(row);
- return;
- }
-
- $n(row, 'barcode').appendChild(text(copy.barcode()));
- $n(row, 'location').appendChild(text(copy.location().name()));
- $n(row, 'status').appendChild(text(copy.status().name()));
-
- if(grabUser()) {
- /* show the course reserves link */
- var creslink = $n(row, 'copy_cres_link');
- unHideMe(creslink);
- creslink.onclick = function() {
- cresInit(copy);
- }
-
- }
-
- if(isXUL()) {
- /* show the hold link */
- var l = $n(row, 'copy_hold_link');
- unHideMe(l);
- l.onclick = function() {
- holdsDrawEditor(
- {
- type : 'C',
- copyObject : copy,
- onComplete : function(){}
- }
- );
- }
-
- /* show the book now link */
- l = $n(row, 'copy_reserve_link');
- unHideMe(l);
- l.onclick = function() {
- // XXX FIXME this duplicates things in cat/util.js
- // Also needs i18n
- dojo.require("fieldmapper.Fieldmapper");
- var r = fieldmapper.standardRequest(
- ["open-ils.booking",
- "open-ils.booking.resources.create_from_copies"],
- [G.user.session, [copy.id()]]
- );
- if (!r) {
- alert("No response from server!");
- } else if (r.ilsevent != undefined) {
- alert("Error from server:\n" + js2JSON(r));
- } else {
- xulG.auth = {"session": {"key": G.user.session}};
- xulG.bresv_interface_opts = {"booking_results": r};
- location.href = "/eg/booking/reservation";
- }
- }
-
- if( copy.age_protect() )
- appendClear($n(row, 'age_protect_value'), text(copy.age_protect().name()));
-
- var cd = copy.create_date();
- cd = cd.replace(/T.*/, '');
- $n(row, 'create_date_value').appendChild(text(cd));
-
- var yes = $('rdetail.yes').innerHTML;
- var no = $('rdetail.no').innerHTML;
-
- if( isTrue(copy.holdable()) &&
- isTrue(copy.location().holdable()) &&
- isTrue(copy.status().holdable()) ) {
- $n(row, 'copy_is_holdable').appendChild(text(yes));
- } else {
- $n(row, 'copy_is_holdable').appendChild(text(no));
- }
- }
-
- if (isXUL() || showDueDate) {
- var circ;
- if( copy.circulations() ) {
- circ = copy.circulations()[0];
- if( circ ) {
- var due_time = dojo.date.stamp.fromISOString(circ.due_date());
- if( showDueTime ) {
- $n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"formatLength": "medium"})));
- } else {
- $n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"selector": "date", "formatLength": "medium"})));
- }
- }
- }
- }
-
- r.args.copy = copy;
- r.args.copyrow = row;
- cpdShowNotes(copy, r.args)
- cpdShowStats(copy, r.args);
-
-}
-
-function _cpdExtrasInit(args) {
-
- var newrid = 'extras_row_' + args.copy.barcode();
- var newrow = $(newrid);
- if(!newrow) newrow = args.extrasRow.cloneNode(true);
- var tbody = $n(newrow, 'extras_tbody');
- var rowt = $n(tbody, 'extras_row');
- newrow.id = newrid;
-
- var cr = args.copyrow;
- var nr = cr.nextSibling;
- var np = args.mainTbody;
-
- /* insert the extras row into the main table */
- if(nr) np.insertBefore( newrow, nr );
- else np.appendChild(newrow);
-
- var link = $n(args.copyrow, 'details_link');
- var link2 = $n(args.copyrow, 'less_details_link');
- var id = newrow.id;
- link.id = id + '_morelink';
- link2.id = id + '_lesslink';
- unHideMe(link);
- hideMe(link2);
-
- link.setAttribute('href',
- 'javascript:unHideMe($("'+link2.id+'")); hideMe($("'+link.id+'"));unHideMe($("'+newrow.id+'"));');
-
- link2.setAttribute('href',
- 'javascript:unHideMe($("'+link.id+'")); hideMe($("'+link2.id+'"));hideMe($("'+newrow.id+'"));');
-
- return [ tbody, rowt ];
-}
-
-function cpdShowNotes(copy, args) {
- var notes = copy.notes();
- if(!notes || notes.length == 0) return;
-
- var a = _cpdExtrasInit(args);
- var tbody = a[0];
- var rowt = a[1];
-
- for( var n in notes ) {
- var note = notes[n];
- if(!isTrue(note.pub())) continue;
- var row = rowt.cloneNode(true);
- $n(row, 'key').appendChild(text(note.title()));
- $n(row, 'value').appendChild(text(note.value()));
- unHideMe($n(row, 'note'));
- unHideMe(row);
- tbody.appendChild(row);
- }
-}
-
-
-function cpdShowStats(copy, args) {
- var entries = copy.stat_cat_entry_copy_maps();
- if(!entries || entries.length == 0) return;
-
- var visibleStatCat = false;
-
- /*
- check all copy stat cats; if we find one that's OPAC visible,
- set the flag and break the loop. If we've found one, or we're
- in the staff client, build the table. if not, we return doing
- nothing, as though the stat_cat_entry_copy_map was empty or null
- */
-
- for( var n in entries )
- {
- var entry = entries[n];
- if(isTrue(entry.stat_cat().opac_visible()))
- {
- visibleStatCat = true;
- break;
- }
- }
-
- if(!(isXUL() || visibleStatCat)) return;
-
- var a = _cpdExtrasInit(args);
- var tbody = a[0];
- var rowt = a[1];
-
- for( var n in entries ) {
- var entry = entries[n];
- if(!(isXUL() || isTrue(entry.stat_cat().opac_visible()))) continue;
- var row = rowt.cloneNode(true);
- $n(row, 'key').appendChild(text(entry.stat_cat().name()));
- $n(row, 'value').appendChild(text(entry.stat_cat_entry().value()));
- unHideMe($n(row, 'cat'));
- unHideMe(row);
- tbody.appendChild(row);
- }
-}
-
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/js/myopac.js
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/js/myopac.js 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/js/myopac.js 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,1691 +0,0 @@
-
-attachEvt("common", "run", myOPACInit );
-//attachEvt("common", "loggedIn", myOPACInit );
-attachEvt('common','locationUpdated', myopacReload );
-
-var fleshedUser = null;
-var fleshedContainers = {};
-var holdCache = {};
-var holdStatusCache = {};
-var allowPendingAddr = false;
-var myopacEnableRefWorks = false;
-var myopacRefWorksHost = 'http://www.refworks.com';
-
-
-function clearNodes( node, keepArray ) {
- if(!node) return;
- for( var n in keepArray ) node.removeChild(keepArray[n]);
- removeChildren(node);
- for( var n in keepArray ) node.appendChild(keepArray[n]);
-}
-
-function myOPACInit() {
-
- if(!(G.user && G.user.session)) {
- initLogin();
-
- } else {
-
- allowPendingAddr = fetchOrgSettingDefault(G.user.home_ou(), 'opac.allow_pending_address');
- if(allowPendingAddr)
- unHideMe($('myopac_pending_addr_td'));
- myOPACChangePage( "summary" );
- }
-
- $('myopac_holds_thaw_date_input').onkeyup =
- function(){holdsVerifyThawDateUI('myopac_holds_thaw_date_input'); }
- $('myopac_holds_thaw_date_input').onchange =
- function(){holdsVerifyThawDateUI('myopac_holds_thaw_date_input'); }
-
-}
-
-function myopacReload() {
- //swapCanvas($('myopac_reloading'));
- var a = {};
- a[PARAM_LOCATION] = getNewSearchLocation();
- a[PARAM_DEPTH] = getNewSearchDepth();
- hideMe($('canvas_main'));
- goTo(buildOPACLink(a, true));
-}
-
-
-function myOPACChangePage( page ) {
- showCanvas();
-
- var s = $("myopac_summary_td");
- var c = $("myopac_checked_td");
- var f = $("myopac_fines_td");
- var h = $("myopac_holds_td");
- var p = $("myopac_prefs_td");
- var b = $('myopac_bookbag_td');
- var r = $('myopac_cres_bookbag_td');
-
- var ss = $("myopac_summary_div");
- var cc = $("myopac_checked_div");
- var ff = $("myopac_fines_div");
- var hh = $("myopac_holds_div");
- var pp = $("myopac_prefs_div");
- var bb = $('myopac_bookbag_div');
- var rr = $('myopac_cres_div');
-
- var cls = "myopac_link";
- var acls = "myopac_link_active";
-
- hideMe(ss);
- hideMe(cc); hideMe(ff);
- hideMe(hh); hideMe(pp);
- hideMe(bb);
- hideMe(rr);
-
- removeCSSClass(s, acls );
- removeCSSClass(c, acls );
- removeCSSClass(f, acls );
- removeCSSClass(h, acls );
- removeCSSClass(p, acls );
- removeCSSClass(b, acls );
- removeCSSClass(r, acls);
-
- switch( page ) {
-
- case "summary":
- unHideMe(ss);
- addCSSClass(s, acls );
- myOPACShowSummary();
- break;
-
- case "checked":
- unHideMe(cc);
- addCSSClass(c, acls );
- myOPACShowChecked();
- break;
-
- case "holds":
- unHideMe(hh);
- addCSSClass(h, acls );
- myOPACShowHolds();
- break;
-
- case "fines":
- unHideMe(ff);
- addCSSClass(f, acls );
- myOPACShowFines();
- break;
-
- case "prefs":
- unHideMe(pp);
- addCSSClass(p, acls );
- myOPACShowPrefs();
- break;
-
- case 'bookbag':
- unHideMe(bb);
- addCSSClass(b, acls);
- myOPACShowBookbags();
- break;
-
- case 'cresbookbag':
- unHideMe(rr);
- addCSSClass(r, acls);
- myOPACCresShowBookbags();
- break;
-
- }
-}
-
-function myOPACShowChecked() {
- if(checkedDrawn) return;
- var req = new Request(FETCH_CHECKED_OUT_SUM, G.user.session, G.user.id());
- req.callback(myOPACDrawCheckedOutSlim);
- req.send();
-
- var nreq = new Request(FETCH_NON_CAT_CIRCS, G.user.session);
- nreq.callback(myOPACDrawNonCatCircs);
- nreq.send();
-}
-
-
-var checkedRowTemplate;
-var circsCache = new Array();
-var checkedDrawn = false;
-
-function moClearCheckedTable() {
- var tbody = $("myopac_checked_tbody");
- var loading = $("myopac_checked_loading");
- var none = $("myopac_checked_none");
- clearNodes( tbody, [ loading, none ] );
-}
-
-var __can_renew_one = false;
-
-function myOPACDrawCheckedOutSlim(r) {
-
- var checked = r.getResultObject();
- var tbody = $("myopac_checked_tbody");
- var loading = $("myopac_checked_loading");
- var none = $("myopac_checked_none");
-
- __can_renew_one = false;
-
- if(checkedDrawn) return;
- checkedDrawn = true;
- if(!checkedRowTemplate)
- checkedRowTemplate = tbody.removeChild($("myopac_checked_row"));
-
- moClearCheckedTable();
-
- hideMe(loading); /* remove all children and start over */
- if(!(checked && (checked.out || checked.overdue))) {
- unHideMe(none);
- return;
- }
-
- var totalAsync = checked.overdue.length + checked.out.length;
- var fetchedCircs = [];
- var collectCircs = function(r) {
- var circ = r.getResultObject();
- circ._od = r.od;
- fetchedCircs.push(circ);
- if(fetchedCircs.length < totalAsync) return;
-
- // sort by due date, oldest to newest
- fetchedCircs = fetchedCircs.sort(
- function(a, b) {
- if(a.due_date() > b.due_date()) return 1;
- return -1;
- }
- )
-
- dojo.forEach(fetchedCircs,
- function(circ) {
- myOPACDrawCheckedItem(circ, tbody);
- }
- );
- }
-
- for( var i = 0; i < checked.overdue.length; i++ ) {
- var req = new Request(FETCH_CIRC_BY_ID, G.user.session, checked.overdue[i]);
- //req.request.tbody = tbody;
- req.request.od = true;
- req.callback(collectCircs);
- req.send();
- }
-
-
- for( var i = 0; i < checked.out.length; i++ ) {
- var req = new Request(FETCH_CIRC_BY_ID, G.user.session, checked.out[i]);
- //req.request.tbody = tbody;
- req.callback(collectCircs);
- req.send();
- }
-
- appendClear($('mo_items_out_count'),
- text(new String( parseInt(checked.overdue.length) + parseInt(checked.out.length) )) );
-
- if( checked.overdue.length > 0 ) {
- addCSSClass($('mo_items_overdue_count'), 'overdue');
- appendClear($('mo_items_overdue_count'),
- text(new String( parseInt(checked.overdue.length) )) );
- }
-
-}
-
-
-//function myOPACDrawCheckedItem(r) {
-function myOPACDrawCheckedItem(circ, tbody) {
-
- //var circ = r.getResultObject();
- //var tbody = r.tbody;
- var row = checkedRowTemplate.cloneNode(true);
- row.id = 'myopac_checked_row_ ' + circ.id();
- row.setAttribute('circid', circ.id());
-
- var due = _trimTime(circ.due_date());
-
- var dlink = $n( row, "myopac_checked_due" );
- var rlink = $n( row, "myopac_checked_renewals" );
- //var rnlink = $n( row, "myopac_checked_renew_link" );
-
- //if( r.od ) due = elem('b', {style:'color:red;font-size:110%'},due);
- if( circ._od ) {
- due = elem('b', null, due);
- addCSSClass(due, 'overdue');
- } else {
- due = text(due);
- }
-
- dlink.appendChild(due);
- rlink.appendChild(text(circ.renewal_remaining()));
- unHideMe(row);
- //rnlink.setAttribute('href', 'javascript:myOPACRenewCirc("'+circ.id()+'");');
- circsCache.push(circ);
-
- if( circ.renewal_remaining() < 1 ) {
- $n(row, 'selectme').disabled = true;
- if(!__can_renew_one)
- $('mo_renew_button').disabled = true;
- } else {
- __can_renew_one = true;
- $('mo_renew_button').disabled = false;
- $n(row, 'selectme').disabled = false;
- }
-
- tbody.appendChild(row);
-
- var req = new Request(FETCH_MODS_FROM_COPY, circ.target_copy() );
- req.request.alertEvent = false;
- req.request.circ = circ.id();
- req.request.copy = circ.target_copy();
- req.callback(myOPACDrawCheckedTitle);
- req.send();
-}
-
-var __circ_titles = {};
-
-function myOPACDrawCheckedTitle(r) {
- var record = r.getResultObject();
- var circid = r.circ;
-
- if(!record || checkILSEvent(record)) {
- var req = new Request( FETCH_COPY, r.copy );
- req.request.circ = circid
- req.callback(myOPACDrawNonCatalogedItem);
- req.send();
- return;
- }
-
- var row = $('myopac_checked_row_ ' + circid);
- var tlink = $n( row, "myopac_checked_title_link" );
- var alink = $n( row, "myopac_checked_author_link" );
- buildTitleDetailLink(record, tlink);
- buildSearchLink(STYPE_AUTHOR, record.author(), alink);
- __circ_titles[circid] = record.title();
-}
-
-function myOPACDrawNonCatalogedItem(r) {
- var copy = r.getResultObject();
- var circid = r.circ;
-
- var row = $('myopac_checked_row_ ' + circid);
- var tlink = $n( row, "myopac_checked_title_link" );
- var alink = $n( row, "myopac_checked_author_link" );
-
- tlink.parentNode.appendChild(text(copy.dummy_title()));
- alink.parentNode.appendChild(text(copy.dummy_author()));
- __circ_titles[circid] = copy.dummy_title();
-}
-
-
-/*
-function myOPACRenewCirc(circid) {
-
- var circ;
- for( var i = 0; i != circsCache.length; i++ )
- if(circsCache[i].id() == circid)
- circ = circsCache[i];
-
- if(!confirm($('myopac_renew_confirm').innerHTML)) return;
-
- var req = new Request(RENEW_CIRC, G.user.session,
- { patron : G.user.id(), copyid : circ.target_copy(), opac_renewal : 1 } );
- req.request.alertEvent = false;
- req.send(true);
- var res = req.result();
-
- if(checkILSEvent(res) || checkILSEvent(res[0])) {
- alertId('myopac_renew_fail');
- return;
- }
-
- alert($('myopac_renew_success').innerHTML);
- checkedDrawn = false;
- myOPACShowChecked();
-}
-*/
-
-
-
-function myOPACShowHolds() {
- var req = new Request(FETCH_HOLDS, G.user.session, G.user.id());
- req.callback(myOPACDrawHolds);
- req.send();
- $('myopac_holds_actions_none').selected = true;
-}
-
-var holdsTemplateRowOrig;
-var holdsTemplateRow;
-var myopacForceHoldsRedraw = false;
-function myOPACDrawHolds(r) {
-
- var tbody = $("myopac_holds_tbody");
- if(holdsTemplateRow && !myopacForceHoldsRedraw) return;
- myopacForceHoldsRedraw = false;
-
- if(holdsTemplateRowOrig) {
- holdsTemplateRow = holdsTemplateRowOrig;
- removeChildren(tbody);
- } else {
- holdsTemplateRow = tbody.removeChild($("myopac_holds_row"));
- holdsTemplateRowOrig = holdsTemplateRow;
- }
-
- hideMe($('myopac_holds_loading'));
-
- var holds = r.getResultObject();
-
- if(!holds || holds.length < 1) unHideMe($('myopac_holds_none'));
- for( var i = 0; i != holds.length; i++ ) {
-
- var h = holds[i];
- holdCache[h.id()] = h;
-
- var row = holdsTemplateRow.cloneNode(true);
- row.id = "myopac_holds_row_" + h.id();
-
- var form = $n(row, "myopac_holds_formats");
- form.id = "myopac_holds_form_" + h.id();
-
- var orglink = $n(row, "myopac_holds_location");
- orglink.appendChild(text(findOrgUnit(h.pickup_lib()).name()));
-
- tbody.appendChild(row);
-
- $n(row,'myopac_holds_edit_link').setAttribute(
- 'href','javascript:myOPACEditHold("'+ h.id()+'");');
-
- if(isTrue(h.frozen())) {
- hideMe($n(row, 'myopac_hold_unfrozen_true'))
- unHideMe($n(row, 'myopac_hold_unfrozen_false'))
- if(h.thaw_date()) {
- var d = dojo.date.stamp.fromISOString(h.thaw_date());
- $n(row, 'myopac_holds_frozen_until').appendChild(text(dojo.date.locale.format(d, {selector: 'date', fullYear: true})));
- }
- } else {
- unHideMe($n(row, 'myopac_hold_unfrozen_true'))
- hideMe($n(row, 'myopac_hold_unfrozen_false'))
- }
-
- $n(row, 'myopac_holds_selected_chkbx').checked = false;
-
- var exp_date;
- if(h.expire_time()) {
- exp_date = dojo.date.stamp.fromISOString(h.expire_time().replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3"));
- $n(row, 'myopac_hold_expire_time').appendChild(
- text(dojo.date.locale.format(exp_date, {selector:'date'})));
- }
-
- unHideMe(row);
-
- var interval = fetchOrgSettingDefault(G.user.home_ou(), 'circ.hold_expire_alert_interval');
- if(interval && exp_date) {
- secs = interval_to_seconds(interval) * 1000;
- var diff = exp_date.getTime() - new Date().getTime();
- if(diff < secs)
- addCSSClass($n(row, 'myopac_hold_expire_time'), 'hold_expire_warning');
- }
-
- myOPACDrawHoldTitle(h);
- myOPACDrawHoldStatus(h);
- }
-}
-
-function myOPACEditHold(holdid) {
- var hold = holdCache[holdid];
-
- holdsDrawEditor(
- {
- editHold : hold,
- onComplete : function(){
- holdsTemplateRow = null;
- myOPACShowHolds();
- }
- }
- );
-}
-
-
-function myOPACDrawHoldStatus(hold) {
- var req = new Request(FETCH_HOLD_STATUS, G.user.session, hold.id() );
- req.callback(myOShowHoldStatus);
- req.request.hold = hold;
- req.send();
-}
-
-var myopacShowHoldEstimate = false;
-function myOShowHoldStatus(r) {
-
- var hold = r.hold;
- var qstats = r.getResultObject();
- holdStatusCache[hold.id()] = qstats;
-
- var row = $("myopac_holds_row_" + r.hold.id());
-
- if(qstats.estimated_wait || myopacShowHoldEstimate) {
- myopacShowHoldEstimate = true;
- if(qstats.estimated_wait)
- $n(row, 'myopac_holds_estimated_wait').appendChild(text(qstats.estimated_wait));
- unHideMe($('myopac_holds_estimated_wait_column'));
- unHideMe($n(row, 'myopac_holds_estimated_wait'));
- }
-
- if( qstats.status == 4 ) {
- unHideMe($n(row, 'hold_status_available'));
- hideMe($n(row, 'myopac_holds_cancel_link'));
- }
-
- if(false) {
- var node = $n(row, 'hold_qstats');
- // XXX best way to display this info + dojo i18n
- node.appendChild(text('hold #' + qstats.queue_position+' of '+qstats.queue_position+' and '+qstats.potential_copies+' item(s)'));
- unHideMe(node);
-
- } else {
- if( qstats.status < 3 )
- unHideMe($n(row, 'hold_status_waiting'));
-
- if( qstats.status == 3 )
- unHideMe($n(row, 'hold_status_transit'));
- }
-}
-
-
-function myOPACDrawHoldTitle(hold) {
- var method;
-
- if( hold.hold_type() == 'T' || hold.hold_type() == 'M' ) {
- if(hold.hold_type() == "M") method = FETCH_MRMODS;
- if(hold.hold_type() == "T") method = FETCH_RMODS;
- var req = new Request(method, hold.target());
- req.callback(myOPACFleshHoldTitle);
- req.request.hold = hold;
- req.request.alertEvent = false;
- req.send();
-
- } else {
- holdFetchObjects(hold,
- function(a) { _myOPACFleshHoldTitle(hold, a);});
- }
-}
-
-function myOPACFleshHoldTitle(r) {
- var rec = r.getResultObject();
- _myOPACFleshHoldTitle(r.hold, {recordObject: rec});
-}
-
-function _myOPACFleshHoldTitle(hold, holdObjects) {
-
- var record = holdObjects.recordObject;
- var volume = holdObjects.volumeObject;
- var copy = holdObjects.copyObject;
-
- var row = $("myopac_holds_row_" + hold.id());
- var title_link = $n(row, "myopac_holds_title_link");
- var author_link = $n(row, "myopac_holds_author_link");
-
- if(!record || checkILSEvent(record) ) {
- addCSSClass(row, 'invalid_hold');
- $n(row, 'myopac_holds_edit_link').setAttribute('href', 'javascript:void(0);');
- $n(row, 'myopac_holds_edit_link').onclick = function(){alertId('invalid_hold');};
- return;
- }
-
- buildTitleDetailLink(record, title_link);
- buildSearchLink(STYPE_AUTHOR, record.author(), author_link);
-
- if( volume ) {
- $n(row, 'volume').appendChild(text(volume.label()));
- unHideMe($n(row, 'vol_copy'));
- if(copy) $n(row, 'copy').appendChild(text(copy.barcode()));
- }
-
- var form = $("myopac_holds_form_" + hold.id());
-
- if(form) {
- var mods_formats = record.types_of_resource();
-
- if( hold.hold_type() == 'M' ) {
- var data = holdsParseMRFormats(hold.holdable_formats());
- mods_formats = data.mods_formats;
- }
-
- for( var i = 0; i < mods_formats.length; i++ ) {
- var img = elem("img");
- setResourcePic(img, mods_formats[i]);
- form.appendChild(img);
- }
- }
-}
-
-var finesShown = false;
-function myOPACShowFines() {
- if(finesShown) return; finesShown = true;
- var req = new Request(FETCH_FINES_SUMMARY, G.user.session, G.user.id() );
- req.callback(_myOPACShowFines);
- req.send();
-}
-
-function _myOPACShowFines(r) {
- hideMe($('myopac_fines_summary_loading'));
- unHideMe($('myopac_fines_summary_row'));
-
- var summary = r.getResultObject();
- var total = "0.00"; /* localization? */
- var paid = "0.00";
- var balance = "0.00";
- if( instanceOf(summary,mous) ) {
-
- total = _finesFormatNumber(summary.total_owed());
- paid = _finesFormatNumber(summary.total_paid());
- balance = _finesFormatNumber(summary.balance_owed());
-
- var req = new Request(FETCH_TRANSACTIONS, G.user.session, G.user.id() );
- req.callback(myOPACShowTransactions);
- req.send();
- }
-
- $('myopac_fines_summary_total').appendChild(text(total));
- $('myopac_fines_summary_paid').appendChild(text(paid));
- $('myopac_fines_summary_balance').appendChild(text(balance));
-}
-
-function _finesFormatNumber(num) {
- if(isNull(num)) num = 0;
- num = num + "";
- if(num.length < 2 || !num.match(/\./)) num += ".00";
- if(num.match(/\./) && num.charAt(num.length-2) == '.') num += "0";
- return num;
-}
-
-//function _trimTime(time) { if(!time) return ""; return time.replace(/\ .*/,""); }
-function _trimTime(time) {
- if(!time) return "";
- time = time.replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3");
- var d = dojo.date.stamp.fromISOString(time);
- if(!d) return ""; /* date parse failed */
- return d.iso8601Format('YMD');
-}
-
-function _trimSeconds(time) {
- if(!time) return "";
- var d = dojo.date.stamp.fromISOString(time.replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3"));
- if(!d) return ""; /* date parse failed */
- return d.iso8601Format('YMDHM',null,true,true);
-}
-
-function myOPACShowTransactions(r) {
-
- if(myopacGenericTransTemplate || myopacCircTransTemplate) return;
-
- var transactions = r.getResultObject();
-
- for( var idx in transactions ) {
-
- var trans = transactions[idx].transaction;
- var record = transactions[idx].record;
- var circ = transactions[idx].circ;
-
- if(trans.xact_type() == 'circulation')
- myOPACShowCircTransaction(trans, record, circ);
-
- else if(trans.xact_type() == 'grocery' )
- myopacShowGenericTransaction( trans );
-
-/* XXX need to copy circulation output function here
- else if(trans.xact_type() == 'reservation' )
- myopacShowReservationTransaction( trans );
-*/
-
- }
-}
-
-var myopacGenericTransTemplate;
-function myopacShowGenericTransaction( trans ) {
- var tbody = $('myopac_trans_tbody');
-
- if(!myopacGenericTransTemplate) {
- myopacGenericTransTemplate =
- tbody.removeChild($('myopac_trans_row'));
- removeChildren(tbody);
- }
-
- var row = myopacGenericTransTemplate.cloneNode(true);
-
- $n(row,'myopac_trans_start').appendChild(
- text(_trimSeconds(trans.xact_start())));
-
- $n(row,'myopac_trans_last_payment').appendChild(
- text(_trimSeconds(trans.last_payment_ts())));
-
- $n(row,'myopac_trans_init_amount').appendChild(
- text(_finesFormatNumber(trans.total_owed())));
-
- $n(row,'myopac_trans_total_paid').appendChild(
- text(_finesFormatNumber(trans.total_paid())));
-
- $n(row,'myopac_trans_balance').appendChild(
- text(_finesFormatNumber(trans.balance_owed())));
-
- var req = new Request(FETCH_MONEY_BILLING, G.user.session, trans.id());
- req.send(true);
- var bills = req.result();
- if(bills && bills[0])
- $n(row,'myopac_trans_bill_type').appendChild(
- text(bills[0].billing_type()));
-
- tbody.appendChild(row);
- unHideMe($('myopac_trans_div'));
-}
-
-
-
-/* draws a circulation transaction summary */
-var myopacCircTransTemplate;
-function myOPACShowCircTransaction(trans, record, circ) {
- var tbody = $('myopac_circ_trans_tbody');
-
- if(!myopacCircTransTemplate) {
- myopacCircTransTemplate = tbody.removeChild($('myopac_circ_trans_row'));
- removeChildren(tbody);
- }
-
- var row = myopacCircTransTemplate.cloneNode(true);
-
- if(record) {
- buildTitleDetailLink(record, $n(row,'myopac_circ_trans_title'));
-
- $n(row,'myopac_circ_trans_author').appendChild(text(
- normalize(truncate(record.author(), 65))));
-
- } else {
-
- var req = new Request( FETCH_COPY, circ.target_copy() );
- req.alertEvents = false;
- req.send(true);
- var copy = req.result();
- if( copy ) {
- $n(row,'myopac_circ_trans_title').appendChild(text(copy.dummy_title()));
- $n(row,'myopac_circ_trans_author').appendChild(text(copy.dummy_author()));
- }
- }
-
-
- $n(row,'myopac_circ_trans_start').
- appendChild(text(_trimTime(trans.xact_start())));
- var due = _trimTime(circ.due_date());
- var checkin = _trimTime(circ.stop_fines_time());
-
- $n(row,'myopac_circ_trans_due').appendChild(text(due))
- if(checkin)
- appendClear($n(row,'myopac_circ_trans_finished'), text(checkin));
- if(circ.stop_fines() == 'LOST')
- appendClear($n(row,'myopac_circ_trans_finished'), text(circ.stop_fines()));
- if(circ.stop_fines() == 'CLAIMSRETURNED')
- appendClear($n(row,'myopac_circ_trans_finished'), text(""));
-
-
- $n(row,'myopac_circ_trans_balance').
- appendChild(text(_finesFormatNumber(trans.balance_owed())));
-
- tbody.appendChild(row);
- unHideMe($('myopac_circ_trans_div'));
-}
-
-
-function myOPACSavePrefs() {
- G.user.prefs[PREF_HITS_PER] = getSelectorVal($('prefs_hits_per'));
- G.user.prefs[PREF_DEF_FONT] = getSelectorVal($('prefs_def_font'));
- G.user.prefs[PREF_HOLD_NOTIFY] = getSelectorVal($('prefs_hold_notify'));
- G.user.prefs[PREF_DEF_DEPTH] = getSelectorVal($('prefs_def_range'));
-
- if( $('myopac_pref_home_lib').checked == true )
- G.user.prefs[PREF_DEF_LOCATION] = null;
- else
- G.user.prefs[PREF_DEF_LOCATION] = getSelectorVal($('prefs_def_location'));
-
- if(commitUserPrefs())
- alert($('prefs_update_success').innerHTML);
- else alert($('prefs_update_failure').innerHTML);
-}
-
-
-function myOPACShowDefFont() {
- var font;
- if(G.user.prefs[PREF_DEF_FONT])
- font = G.user.prefs[PREF_DEF_FONT];
- else font = "regular";
- setSelector($('prefs_def_font'), font);
-}
-
-function myOPACShowHoldNotify() {
- var pref = G.user.prefs[PREF_HOLD_NOTIFY];
-
- if(pref) {
- if(pref.match(/email/i) && pref.match(/phone/i)) {
- setSelector($('prefs_hold_notify'), 'phone:email');
- } else if( pref.match(/email/i) ) {
- setSelector($('prefs_hold_notify'), 'email');
- } else if( pref.match(/phone/i) ) {
- setSelector($('prefs_hold_notify'), 'phone');
- }
-
- } else {
- setSelector($('prefs_hold_notify'), 'phone:email');
- }
-}
-
-function myOPACShowPrefs() {
- grabUserPrefs();
- myOPACShowHitsPer();
- myOPACShowDefFont();
- myOPACShowHoldNotify();
- myOPACShowDefLocation();
- hideMe($('myopac_prefs_loading'));
-}
-
-var defSearchLocationDrawn = false;
-var defDepthIndex = 0;
-function myOPACShowDefLocation() {
-
- var selector = $('prefs_def_location');
- var rsel = $('prefs_def_range');
-
- if(!defSearchLocationDrawn) {
-
- defSearchLocationDrawn = true;
-
- var org = G.user.prefs[PREF_DEF_LOCATION];
-
- if(!org) {
- $('myopac_pref_home_lib').checked = true;
- $('prefs_def_location').disabled = true;
- org = G.user.home_ou();
- }
-
- buildOrgSel(selector, globalOrgTree, 0);
-
- globalOrgTypes = globalOrgTypes.sort(
- function(a, b) {
- if( a.depth() < b.depth() ) return -1;
- return 1;
- }
- );
-
- iterate(globalOrgTypes,
- function(t) {
- if( t.depth() <= findOrgDepth(org) ) {
- setSelectorVal(rsel, defDepthIndex++, t.opac_label(), t.depth());
- if( t.depth() == findOrgDepth(org) )
- setSelector(rsel, t.depth());
- }
- }
- );
- }
-
- setSelector(selector, org);
-}
-
-function myOPACShowHitsPer() {
- var hits = 10;
- if(G.user.prefs[PREF_HITS_PER])
- hits = G.user.prefs[PREF_HITS_PER];
- var hitsSel = $('prefs_hits_per');
- setSelector(hitsSel, hits);
-}
-
-var userShown = false;
-function myOPACShowSummary() {
- if(userShown) return; userShown = true;
- var req = new Request(FETCH_FLESHED_USER,G.user.session, G.user.id());
- req.callback(_myOPACSummaryShowUer);
- req.send();
-}
-
-var addrRowTemplate;
-var notesTemplate;
-function _myOPACSummaryShowUer(r) {
-
- var user = r.getResultObject();
- fleshedUser = user;
- if(!user) return;
-
- var expireDate = dojo.date.stamp.fromISOString(user.expire_date());
- if( expireDate < new Date() ) {
- appendClear($('myopac.expired.date'), expireDate.iso8601Format('YMD'));
- unHideMe($('myopac.expired.alert'));
- }
-
- var iv1 = user.ident_value()+'';
- if (iv1.length > 4 && iv1.match(/\d{4}/)) iv1 = iv1.substring(0,4) + '***********';
-
-
- appendClear($('myopac_summary_prefix'),text(user.prefix()));
- appendClear($('myopac_summary_first'),text(user.first_given_name()));
- appendClear($('myopac_summary_middle'),text(user.second_given_name()));
- appendClear($('myopac_summary_dayphone'),text(user.day_phone()));
- appendClear($('myopac_summary_eveningphone'),text(user.evening_phone()));
- appendClear($('myopac_summary_otherphone'),text(user.other_phone()));
- appendClear($('myopac_summary_last'),text(user.family_name()));
- appendClear($('myopac_summary_suffix'),text(user.suffix()));
- appendClear($('myopac_summary_username'),text(user.usrname()));
- appendClear($('myopac_summary_email'),text(user.email()));
- appendClear($('myopac_summary_barcode'),text(user.card().barcode()));
- appendClear($('myopac_summary_ident1'),text(iv1));
- appendClear($('myopac_summary_homelib'),text(findOrgUnit(user.home_ou()).name()));
- appendClear($('myopac_summary_create_date'),text(_trimTime(user.create_date())));
-
- var req = new Request(
- FETCH_USER_NOTES, G.user.session, {pub:1, patronid:G.user.id()});
- req.callback(myopacDrawNotes);
- req.send();
-
-
- var tbody = $('myopac_addr_tbody');
- var template;
-
- if(addrRowTemplate) {
- template = addrRowTemplate;
- } else {
- template = tbody.removeChild($('myopac_addr_row'));
- addrRowTemplate = template;
- }
- removeChildren(tbody);
-
- var addrs = user.addresses();
- for( var a in addrs ) {
- var addr = addrs[a];
- if(!allowPendingAddr && isTrue(addr.pending()))
- continue;
- if(addr.replaces() != null) continue;
- var row = template.cloneNode(true);
- myOPACDrawAddr(row, addr, addrs);
- tbody.appendChild(row);
- }
-}
-
-
-function myopacDrawNotes(r) {
- var notes = r.getResultObject();
- var tbody = $('myopac.notes.tbody');
- if(!notesTemplate)
- notesTemplate = tbody.removeChild($('myopac.notes.tr'));
- removeChildren(tbody);
-
- iterate(notes,
- function(note) {
- unHideMe($('myopac.notes.div'));
- var row = notesTemplate.cloneNode(true);
- $n(row, 'title').appendChild(text(note.title()));
- $n(row, 'value').appendChild(text(note.value()));
- tbody.appendChild(row);
- }
- );
-}
-
-
-
-function myOPACDrawAddr(row, addr, addrs) {
- appendClear($n(row, 'myopac_addr_type'),text(addr.address_type()));
- appendClear($n(row, 'myopac_addr_street'),text(addr.street1()));
- appendClear($n(row, 'myopac_addr_street2'),text(addr.street2()));
- appendClear($n(row, 'myopac_addr_city'),text(addr.city()));
- appendClear($n(row, 'myopac_addr_county'),text(addr.county()));
- appendClear($n(row, 'myopac_addr_state'),text(addr.state()));
- appendClear($n(row, 'myopac_addr_country'),text(addr.country()));
- appendClear($n(row, 'myopac_addr_zip'),text(addr.post_code()));
-
- if(!allowPendingAddr) return;
-
- $n(row, 'myopac_addr_edit_link').onclick = function(){myopacEditAddress(addr)};
- unHideMe($n(row, 'myopac_addr_edit_td'));
-
- /* if we have a replacement address, plop it into the table next to this addr */
- var repl = grep(addrs,
- function(a) {
- return a.replaces() == addr.id();
- }
- );
-
- $n(row, 'myopac_pending_addr_td').id = 'myopac_pending_addr_td_' + addr.id();
-
- if(repl) {
- hideMe($n(row, 'myopac_addr_edit_td')); // hide the edit link
- repl = repl[0];
- myopacSetAddrInputs(row, repl);
- }
-}
-
-function myopacEditAddress(addr) {
- var td = $('myopac_pending_addr_td_' + addr.id());
- var row = td.parentNode;
- myopacSetAddrInputs(row, addr);
-}
-
-function myopacSetAddrInputs(row, addr, prefix) {
- unHideMe($n(row, 'myopac_pending_addr_td'));
- $n(row, 'myopac_pending_addr_type').value = addr.address_type();
- $n(row, 'myopac_pending_addr_street').value = addr.street1();
- $n(row, 'myopac_pending_addr_street2').value = addr.street2();
- $n(row, 'myopac_pending_addr_city').value = addr.city();
- $n(row, 'myopac_pending_addr_county').value = addr.county();
- $n(row, 'myopac_pending_addr_state').value = addr.state();
- $n(row, 'myopac_pending_addr_country').value = addr.country();
- $n(row, 'myopac_pending_addr_zip').value = addr.post_code();
- $n(row, 'myopac_pending_addr_edit_link').onclick = function(){myopacSaveAddress(row, addr)};
- $n(row, 'myopac_pending_addr_del_link').onclick = function(){myopacSaveAddress(row, addr, true)};
-}
-
-// if no pending addr exists, this is called with the original address
-function myopacSaveAddress(row, addr, deleteMe) {
-
- if(addr.replaces() == null) {
- // we are editing a non-pending address. create a pending address to manage that
- var repl = new aua();
- repl.usr(addr.usr());
- repl.address_type(addr.address_type());
- repl.within_city_limits(addr.within_city_limits());
- repl.replaces(addr.id());
- repl.pending('t');
- repl.isnew(true);
- repl.id(null);
- addr = repl;
- }
-
- if(deleteMe) {
- if(addr.id() == null) {
- hideMe($n(row, 'myopac_pending_addr_td'));
- return;
- }
- addr.isdeleted(true);
- } else {
- addr.address_type($n(row, 'myopac_pending_addr_type').value);
- addr.street1($n(row, 'myopac_pending_addr_street').value);
- addr.street2($n(row, 'myopac_pending_addr_street2').value);
- addr.city($n(row, 'myopac_pending_addr_city').value);
- addr.county($n(row, 'myopac_pending_addr_county').value);
- addr.state($n(row, 'myopac_pending_addr_state').value);
- addr.country($n(row, 'myopac_pending_addr_country').value);
- addr.post_code($n(row, 'myopac_pending_addr_zip').value);
- }
-
- var req = new Request(
- 'open-ils.actor:open-ils.actor.user.address.pending.cud',
- G.user.session, addr);
-
- req.callback(
- function(r) {
- var resp = r.getResultObject();
-
- if(addr.isnew()) {
- // new, add to list of addrs
- addr.id(resp);
- fleshedUser.addresses().push(addr);
-
- } else {
- // deleted, remove from list of addrs
- if(addr.isdeleted()) {
- hideMe($n(row, 'myopac_pending_addr_td'));
- var addrs = [];
- for(var i in fleshedUser.addresses()) {
- var a = fleshedUser.addresses()[i];
- if(a.id() != addr.id())
- addrs.push(a);
- }
- fleshedUser.addresses(addrs);
- }
- }
- alertId('myopac_addr_changes_saved');
- }
- );
- req.send();
-};
-
-
-function myOPACUpdateUsername() {
- var username = $('myopac_new_username').value;
- if(username == null || username == "") {
- alert($('myopac_username_error').innerHTML);
- return;
- }
-
- if( username.match(/.*\s.*/) ) {
- alert($('myopac_invalid_username').innerHTML);
- return;
- }
-
- r = fetchOrgSettingDefault(globalOrgTree.id(), 'opac.barcode_regex');
- if(r) REGEX_BARCODE = new RegExp(r);
-
- if(username.match(REGEX_BARCODE)) {
- alert($('myopac_invalid_username').innerHTML);
- return;
- }
-
- /* first see if the requested username is taken */
- var req = new Request(CHECK_USERNAME, G.user.session, username);
- req.send(true);
- var res = req.result();
- /* If the username does not already exist, res will be null;
- * we can move on to updating the username.
- *
- * If the username does exist, then res will be the user ID.
- * G.user.id() gives us the currently authenticated user ID.
- * If res == G.user.id(), we try to update the username anyways.
- */
- if( res !== null && res != G.user.id() ) {
- alertId('myopac_username_dup');
- return;
- }
-
- var req = new Request(UPDATE_USERNAME, G.user.session, username );
- req.send(true);
- if(req.result()) {
-
- var evt;
- var res = req.result();
- if(evt = checkILSEvent(res)) {
- alertILSEvent(res);
- return;
- }
-
- G.user.usrname(username);
- hideMe($('myopac_update_username_row'));
- userShown = false;
- alertId('myopac_username_success');
- myOPACShowSummary();
- return;
- }
-
- alert($('myopac_username_failure').innerHTML);
-}
-
-function myOPACUpdateEmail() {
- var email = $('myopac_new_email').value;
- if(email == null || email == "") {
- alert($('myopac_email_error').innerHTML);
- return;
- }
-
- var req = new Request(UPDATE_EMAIL, G.user.session, email );
- req.send(true);
- if(req.result()) {
- G.user.email(email);
- hideMe($('myopac_update_email_row'));
- userShown = false;
- alertId('myopac_email_success');
- myOPACShowSummary();
- return;
- }
-
- alert($('myopac_email_failure').innerHTML);
-}
-
-
-function myOPACUpdatePassword() {
- var curpassword = $('myopac_current_password').value;
- var password = $('myopac_new_password').value;
- var password2 = $('myopac_new_password2').value;
-
- if( curpassword == null || curpassword == "" ||
- password == null || password == "" ||
- password2 == null || password2 == "" || password != password2 ) {
- alert($('myopac_password_error').innerHTML);
- return;
- }
-
- if(!strongPassword(password, true)) return;
-
- var req = new Request(UPDATE_PASSWORD, G.user.session, password, curpassword );
- req.send(true);
- if(req.result()) {
- hideMe($('myopac_update_password_row'));
- userShown = false;
- alertId('myopac_password_success');
- myOPACShowSummary();
- return;
- }
-
- alert($('myopac_password_failure').innerHTML);
-}
-
-
-
-
-var containerTemplate;
-function myOPACShowBookbags(force) {
-
- var tbody =$('myopac_bookbag_tbody') ;
-
- if(!containerTemplate)
- containerTemplate = tbody.removeChild($('myopac_bookbag_tr'));
- else if(!force) return;
-
- removeChildren(tbody);
-
- var containers = containerFetchAll();
-
- var found = false;
- for( var i in containers ) {
- found = true;
- var cont = containers[i];
- var row = containerTemplate.cloneNode(true);
- row.id = 'myopac_bookbag_row_' + cont.id();
- var link = $n(row, 'myopac_expand_bookbag');
- var dlink = $n(row, 'myopac_container_delete');
- link.appendChild( text(cont.name()) );
- link.setAttribute('href',
- 'javascript:myOPACExpandBookbag("' + cont.id() + '","' + cont.name() + '");');
- myOPACFetchBBItems( cont.id(), row );
- dlink.setAttribute('href', 'javascript:myOPACDeleteBookbag("'+cont.id()+'");');
-
- if( isTrue(cont.pub()) ) {
- unHideMe($n(row, 'myopac_bb_published_yes'));
- var link = $n(row, 'myopac_bb_published_view');
- link.setAttribute('href', buildExtrasLink( 'feed/bookbag/html-full/'+cont.id(), false));
- link.setAttribute('target', '_blank' );
- unHideMe(link);
-
- link = $n(row, 'myopac_bb_published_atom');
- link.setAttribute('href', buildExtrasLink( 'feed/bookbag/rss2-full/'+cont.id(), false));
- link.setAttribute('target', '_blank' );
- unHideMe(link);
-
- link = $n(row, 'myopac_bb_make_unpublished');
- link.setAttribute('href', 'javascript:myOPACMakeBBPublished("'+cont.id()+'", true);');
- unHideMe(link);
-
- var RW = $n(row, 'myopac_bb_exp_refworks');
- if (RW && myopacEnableRefWorks) {
- var here = (findOrgUnit(getLocation())).name();
- var org_name = here.replace(" ", "+");
- var cgi = new CGI();
-
- RW.setAttribute('href',
- myopacRefWorksHost + '/express/expressimport.asp?vendor='
- + org_name
- + '&filter=MARC+Format&database=All+MARC+Formats&encoding=65001&url=http%3A%2F%2F'
- + cgi.server_name + '/opac/extras/feed/bookbag/marctxt-full/'
- + cont.id()
- );
- RW.setAttribute('target', 'RefWorksMain');
- unHideMe($n(row, 'myopac_bb_exp_refworks'));
- }
- } else {
- unHideMe($n(row, 'myopac_bb_published_no'));
- var link = $n(row, 'myopac_bb_make_published');
- link.setAttribute('href', 'javascript:myOPACMakeBBPublished("'+cont.id()+'");');
- unHideMe(link);
- }
-
- tbody.appendChild(row);
- }
-
- if(!found) unHideMe($('myopac_bookbags_none'));
- else unHideMe($('myopac_bookbag_table'));
-}
-
-function myOPACMakeBBPublished(bbid, hideme) {
-
- var bb = fleshedContainers[bbid];
-
- if(hideme) {
- if(!confirm($('myopac_make_unpublished_confirm').innerHTML)) return;
- bb.pub('f');
- } else {
- if(!confirm($('myopac_make_published_confirm').innerHTML)) return;
- bb.pub('t');
- }
-
- var result = containerUpdate(bb);
-
- var code = checkILSEvent(result);
- if(code) { alertILSEvent(result); return; }
-
- alert($('myopac_bb_update_success').innerHTML);
- myOPACShowBookbags(true);
-}
-
-
-
-function myOPACDeleteBookbag(id) {
- if( confirm( $('myopac_delete_bookbag_warn').innerHTML ) ) {
- var result = containerDelete(id);
- var code = checkILSEvent(result);
- if(code) { alertILSEvent(result); return; }
- alert($('myopac_bb_update_success').innerHTML);
- hideMe($('myopac_bookbag_items_table'));
- hideMe($('myopac_bookbag_items_name'));
- hideMe($('myopac_bookbag_no_items'));
- myOPACShowBookbags(true);
- }
-}
-
-function myOPACFetchBBItems( id, row, block ) {
- if(!block) {
- containerFlesh( id, _myOPACSetBBItems, { row: row } );
- } else {
- var cont = containerFlesh(id);
- myOPACSetBBItems( cont, row );
- }
-}
-
-function _myOPACSetBBItems(r) { myOPACSetBBItems( r.getResultObject(), r.args.row ); }
-
-function myOPACSetBBItems( container, row ) {
- fleshedContainers[container.id()] = container;
- var node = $n(row, 'myopac_bookbag_item_count');
- removeChildren(node);
- node.appendChild( text(container.items().length) );
-}
-
-var BBItemsRow;
-function myOPACExpandBookbag( id, name ) {
-
- var tbody = $('myopac_bookbag_items_tbody');
- if(!BBItemsRow) BBItemsRow = tbody.removeChild($('myopac_bookbag_items_row'));
- removeChildren(tbody);
- removeChildren($('myopac_bookbag_items_name'));
-
- $('myopac_bookbag_items_name').appendChild(text(name));
-
- if( fleshedContainers[id] ) {
- var len = fleshedContainers[id].items().length;
-
- if( len == 0 ) {
- unHideMe($('myopac_bookbag_no_items'));
- hideMe($('myopac_bookbag_items_table'));
- return;
- }
-
- hideMe($('myopac_bookbag_no_items'));
- unHideMe($('myopac_bookbag_items_table'));
-
- for( var i = 0; i != len; i++ ) {
- var row = BBItemsRow.cloneNode(true);
- found = true;
-
- var item = fleshedContainers[id].items()[i];
- var tlink = $n(row,'myopac_bookbag_items_title');
- var alink = $n(row,'myopac_bookbag_items_author');
-
- var req = new Request( FETCH_RMODS, item.target_biblio_record_entry() );
- req.request.tlink = tlink;
- req.request.alink = alink;
- req.callback(myOPACShowBBItem);
- req.send();
-
- var clink = $n(row, 'myopac_bookbag_items_remove');
- clink.setAttribute('href', 'javascript:myOPACRemoveBBItem("'+item.id()+'","'+id+'","'+name+'");');
-
- tbody.appendChild(row);
- }
- }
-}
-
-function myOPACRemoveBBItem( id, containerid, container_name ) {
- if(!confirm($('myopac_remove_bb_item_confirm').innerHTML)) return;
- var stat = containerRemoveItem( id );
- if(stat) alert($('myopac_bb_update_success').innerHTML);
- myOPACFetchBBItems( containerid, $('myopac_bookbag_row_' + containerid), true);
- myOPACExpandBookbag( containerid, container_name );
-}
-
-function myOPACShowBBItem(r) {
- var record = r.getResultObject();
- buildTitleDetailLink(record, r.tlink);
- buildSearchLink(STYPE_AUTHOR, record.author(), r.alink);
-}
-
-function myOPACCreateBookbag() {
- var name = $('myopac_bookbag_new_name').value;
- if(!name) return;
-
- var exists = false;
- for( var c in fleshedContainers ) { exists = true; break; }
-
- /* let them know what they are getting into... */
- if(!exists) if(!confirm($('bb_create_warning').innerHTML)) return;
-
- var result = containerCreate( name, $('bb_public_yes').checked );
- var code = checkILSEvent(result);
- if(code) { alertILSEvent(result); return; }
- if(result) alert($('myopac_bb_update_success').innerHTML);
- myOPACShowBookbags(true);
-}
-
-
-/* ---------------------------------------------------------------------- */
-/* Non cat circs */
-/* ---------------------------------------------------------------------- */
-
-var nonCatCircIds;
-var nonCatTypes;
-/* if we have some circs, grab the non-cat types */
-function myOPACDrawNonCatCircs(r) {
- var ids = r.getResultObject();
- if(ids.length == 0) return;
- nonCatCircIds = ids;
- unHideMe($('non_cat_circs_div'));
- var req = new Request(FETCH_NON_CAT_TYPES, G.user.home_ou());
- req.callback(myOPACDrawNonCatCircs2);
- req.send();
-}
-
-
-/* now we have circs and the types.. draw each one */
-var nonCatTbody;
-var nonCatRow;
-function myOPACDrawNonCatCircs2(r) {
- nonCatTypes = r.getResultObject();
- nonCatTbody = $('non_cat_circs_tbody');
- if(!nonCatRow) nonCatRow =
- nonCatTbody.removeChild($('non_cat_circs_row'));
- removeChildren(nonCatTbody);
- for( var i in nonCatCircIds ) {
- var req = new Request(FETCH_NON_CAT_CIRC, G.user.session, nonCatCircIds[i]);
- req.callback(myOPACDrawNonCatCirc);
- req.send();
- }
-}
-
-
-/* draw a single circ */
-function myOPACDrawNonCatCirc(r) {
- var circ = r.getResultObject();
-
-
- var type = grep(nonCatTypes,
- function(i){
- return (i.id() == circ.item_type());
- }
- )[0];
-
-
- var row = nonCatTbody.appendChild(nonCatRow.cloneNode(true));
- appendClear($n(row, 'circ_lib'), text(findOrgUnit(circ.circ_lib()).name()));
- appendClear($n(row, 'item_type'), text(type.name()));
-
- var duration = interval_to_seconds(type.circ_duration());
- duration = parseInt(duration + '000');
-
- var dtf = circ.circ_time();
- var start = dojo.date.stamp.fromISOString(circ.circ_time().replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3"));
- var due = new Date( start.getTime() + duration );
- appendClear($n(row, 'circ_time'), text(due.iso8601Format('YMDHM', null, true, true)));
-}
-
-
-
-
-function myopacSelectAllChecked() {
- __myopacSelectChecked(true);
-}
-
-function myopacSelectNoneChecked() {
- __myopacSelectChecked(false);
-}
-
-function __myopacSelectChecked(value) {
- var rows = myopacGetCheckedOutRows();
- for( var i = 0; i < rows.length; i++ ) {
- var row = rows[i];
- var box = $n(row, 'selectme');
- if( box && ! box.disabled )
- box.checked = value;
- }
-}
-
-function myopacGetCheckedOutRows() {
- var rows = [];
- var tbody = $('myopac_checked_tbody');
- var children = tbody.childNodes;
- for( var i = 0; i < children.length; i++ ) {
- var child = children[i];
- if( child.nodeName.match(/^tr$/i) )
- if( $n(child, 'selectme') )
- rows.push(child);
- }
- return rows;
-}
-
-var __renew_circs = [];
-
-/* true if 1 renewal succeeded */
-var __success_count = 0;
-
-/* renews all selected circulations */
-function myOPACRenewSelected() {
- var rows = myopacGetCheckedOutRows();
- if(!confirm($('myopac_renew_confirm').innerHTML)) return;
- __success_count = 0;
-
- for( var i = 0; i < rows.length; i++ ) {
-
- var row = rows[i];
- if( ! $n(row, 'selectme').checked ) continue;
- var circ_id = row.getAttribute('circid');
-
- var circ;
- for( var j = 0; j != circsCache.length; j++ )
- if(circsCache[j].id() == circ_id)
- circ = circsCache[j];
-
- __renew_circs.push(circ);
- }
-
- if( __renew_circs.length == 0 ) return;
-
- unHideMe($('my_renewing'));
- moClearCheckedTable();
-
- for( var i = 0; i < __renew_circs.length; i++ ) {
- var circ = __renew_circs[i];
- moRenewCirc( circ.target_copy(), G.user.id(), circ );
- }
-}
-
-
-/* renews a single circulation */
-function moRenewCirc(copy_id, user_id, circ) {
-
- _debug('renewing circ ' + circ.id() + ' with copy ' + copy_id);
- var req = new Request(RENEW_CIRC, G.user.session,
- { patron : user_id,
- copyid : copy_id,
- opac_renewal : 1
- }
- );
-
- req.request.alertEvent = false;
- req.callback(myHandleRenewResponse);
- req.request.circ = circ;
- req.send();
-}
-
-
-
-/* handles the circ renew results */
-function myHandleRenewResponse(r) {
- var res = r.getResultObject();
- var circ = r.circ;
-
- /* remove this circ from the list of circs to renew */
- __renew_circs = grep(__renew_circs, function(i) { return (i.id() != circ.id()); });
-
- _debug("handling renew result for " + circ.id());
-
- if(checkILSEvent(res) || checkILSEvent(res[0]))
- alertIdText('myopac_renew_fail', __circ_titles[circ.id()]);
- else __success_count++;
-
- if(__renew_circs) return; /* more to come */
-
- __renew_circs = [];
-
- if( __success_count > 0 )
- alertIdText('myopac_renew_success', __success_count);
-
- hideMe($('my_renewing'));
- checkedDrawn = false;
- myOPACShowChecked();
-}
-
-/** ---- batch hold processing ------------ */
-
-
-/* myopac_holds_checkbx */
-function myopacSelectAllHolds() {
- var rows = getTableRows($("myopac_holds_tbody"));
- for(var i = 0; i < rows.length; i++) {
- cb = $n(rows[i], 'myopac_holds_selected_chkbx');
- if(cb) cb.checked = true;
- }
-}
-
-function myopacSelectNoneHolds() {
- var rows = getTableRows($("myopac_holds_tbody"));
- for(var i = 0; i < rows.length; i++) {
- cb = $n(rows[i], 'myopac_holds_selected_chkbx');
- if(cb) cb.checked = false;
- }
-}
-
-function myopacSelectedHoldsRows() {
- var r = [];
- var rows = getTableRows($("myopac_holds_tbody"));
- for(var i = 0; i < rows.length; i++) {
- cb = $n(rows[i], 'myopac_holds_selected_chkbx');
- if(cb && cb.checked)
- r.push(rows[i]);
- }
- return r;
-}
-
-var myopacProcessedHolds = 0;
-var myopacHoldsToProcess = 0;
-function myopacDoHoldAction() {
-
- var selectedRows = myopacSelectedHoldsRows();
- action = getSelectorVal($('myopac_holds_actions'));
- $('myopac_holds_actions_none').selected = true;
- if(selectedRows.length == 0) return;
-
- myopacProcessedHolds = 0;
-
- if(!confirmId('myopac.holds.'+action+'.confirm')) return;
- myopacSelectNoneHolds(); /* clear the selection */
-
-
- /* first, let's collect the holds that actually need processing and
- collect the full process count while we're at it */
- var holds = [];
- for(var i = 0; i < selectedRows.length; i++) {
- hold = holdCache[myopacHoldIDFromRow(selectedRows[i])];
- var qstats = holdStatusCache[hold.id()];
- switch(action) {
- case 'cancel':
- holds.push(hold);
- break;
- case 'thaw_date':
- case 'thaw':
- if(isTrue(hold.frozen()))
- holds.push(hold);
- break;
- case 'freeze':
- if(!isTrue(hold.frozen()) && qstats.status < 3)
- holds.push(hold);
- break;
- }
- }
- myopacHoldsToProcess = holds;
- if(myopacHoldsToProcess.length == 0) return;
-
- if(action == 'thaw_date' || action == 'freeze')
- myopacDrawHoldThawDateForm();
- else
- myopacProcessHolds(action);
-}
-
-
-function myopacProcessHolds(action, thawDate) {
-
- myopacShowHoldProcessing();
- /* now we process them */
- for(var i = 0; i < myopacHoldsToProcess.length; i++) {
-
- hold = myopacHoldsToProcess[i];
-
- var req;
- switch(action) {
-
- case 'cancel':
- req = new Request(CANCEL_HOLD, G.user.session, hold.id());
- break;
-
- case 'thaw':
- hold.frozen('f');
- hold.thaw_date(null);
- req = new Request(UPDATE_HOLD, G.user.session, hold);
- break;
-
- case 'thaw_date':
- case 'freeze':
- hold.frozen('t');
- hold.thaw_date(thawDate);
- req = new Request(UPDATE_HOLD, G.user.session, hold);
- break;
- //thawDate = prompt($('myopac.holds.freeze.select_thaw').innerHTML);
-
- }
-
- req.callback(myopacBatchHoldCallback);
- req.send();
- req = null;
- }
-}
-
-function myopacDrawHoldThawDateForm() {
- hideMe($('myopac_holds_main_table'));
- unHideMe($('myopac_holds_thaw_date_form'));
- $('myopac_holds_thaw_date_input').focus();
-}
-
-function myopacApplyThawDate() {
- var dateString = dijit.byId('myopac_holds_thaw_date_input').getValue();
- if(dateString) {
- dateString = dojo.date.stamp.toISOString(dateString);
- if(dateString) {
- dateString = holdsVerifyThawDate(dateString);
- if(!dateString) return;
- } else {
- dateString = null;
- }
- }
- myopacProcessHolds('freeze', dateString);
-}
-
-function myopacHoldIDFromRow(row) {
- return row.id.replace(/.*_(\d+)$/, '$1');
-}
-
-function myopacShowHoldProcessing() {
- unHideMe($('myopac_holds_processing'));
- hideMe($('myopac_holds_main_table'));
-}
-
-function myopacHideHoldProcessing() {
- hideMe($('myopac_holds_processing'));
- unHideMe($('myopac_holds_main_table'));
- hideMe($('myopac_holds_thaw_date_form'));
-}
-
-function myopacBatchHoldCallback(r) {
- if(r) /* force load any exceptions */
- r.getResultObject();
- if(++myopacProcessedHolds >= myopacHoldsToProcess.length) {
- myopacHideHoldProcessing();
- holdCache = {};
- holdStatusCache = {};
- myopacForceHoldsRedraw = true;
- myOPACShowHolds();
- }
-}
-
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/js/reserves.js
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/js/reserves.js 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/js/reserves.js 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,413 +0,0 @@
-
-dojo.require("dijit.form.TextBox");
-dojo.require("dijit.Dialog");
-dojo.require('openils.PermaCrud');
-dojo.require("dijit.form.Button");
-dojo.require("dijit.form.FilteringSelect");
-
-dojo.require('fieldmapper.AutoIDL'); //reads /openils/var/reports/fm_IDL.xml to generate a list of class properties
-dojo.require('fieldmapper.dojoData'); //seems to provide a store for Evergreen data accessed via Dojo
-dojo.require('fieldmapper.Fieldmapper'); //converts the list of class properties into actual classes.
-dojo.require('openils.Util');
-dojo.require('openils.Event');
-
-/*
-===== Bookbag manipulation =====
-*/
-
-function containerCresDoRequest( req, callback, args ) {
-
- if( callback ) {
- req.callback( callback );
- req.request.args = args;
- req.send();
- return null;
- }
-
- req.send(true);
- return req.result();
-}
-
-function containerCresFetchAll( callback, args ) {
-
- var req = new Request(
- FETCH_CONTAINERS, G.user.session, G.user.id(), 'copy', 'cres' );
-
- return containerCresDoRequest( req, callback, args );
-}
-
-function containerCresFlesh( id, callback, args ) {
-
- var req = new Request( FLESH_CONTAINER, G.user.session, 'copy', id );
- return containerCresDoRequest( req, callback, args );
-}
-
-function containerCresDelete( id, callback, args ) {
-
- var len = cresFleshedContainers[id].items().length;
-
- if (len != 0){
- for( var i = 0; i != len; i++ ) {
- var itm = cresFleshedContainers[id].items()[i].id();
- containerCresRemoveItem( itm );
- }
-
- }
- var req = new Request( DELETE_CONTAINER, G.user.session, 'copy', id );
- return containerCresDoRequest(req, callback, args );
-}
-
-function containerCresCreate( name, pub, callback, args ) {
-
- var container = new ccb();
- container.name(name);
- container.btype('cres');
-
- container.owner( G.user.id() );
- if(pub) container.pub('t');
- else container.pub('f');
-
- var req = new Request(
- CREATE_CONTAINER, G.user.session, 'copy', container );
- return containerCresDoRequest( req, callback, args );
-}
-
-function containerCresUpdate( container, callback, args ) {
-
- var req = new Request(UPDATE_CONTAINER, G.user.session, 'copy', container);
- return containerCresDoRequest(req, callback, args);
-}
-
-
-function containerCresCreateItem( containerId, target, callback, args ) {
-
- var item = new ccbi();
- item.target_copy(target);
- item.bucket(containerId);
-
- var req = new Request( CREATE_CONTAINER_ITEM,
- G.user.session, 'copy', item );
-
- return containerCresDoRequest( req, callback, args );
-}
-
-
-function containerCresRemoveItem( id, callback, args ) {
-
- var search = {'item':id};
- var pcrudnote = new openils.PermaCrud({"authtoken":G.user.session});
- note = pcrudnote.search('ccbin', search);
- var oldparams = dojo.fromJson(note[0].note());
-
- var pcrudcpy = new openils.PermaCrud({"authtoken":G.user.session});
- var cpy = pcrudcpy.retrieve("acp", oldparams.id);
- cpy.location(oldparams.location);
- cpy.circ_modifier(oldparams.circ_modifier);
- pcrudcpy.update(cpy);
-
- var req = new Request( DELETE_CONTAINER_ITEM, G.user.session, 'copy', id );
- return containerCresDoRequest( req, callback, args );
-}
-
-function containerCresCreateNote(itemId, circ_mod, copy_location) {
-
- var oldparams = {'id': cresCopy.id(), 'location': cresCopy.location().id(), 'circ_modifier': cresCopy.circ_modifier()};
- var joldparams = dojo.toJson(oldparams);
-
- var pcrudcpy = new openils.PermaCrud({"authtoken":G.user.session});
- var cpy = pcrudcpy.retrieve("acp", cresCopy.id());
- cpy.location(copy_location);
- cpy.circ_modifier(circ_mod);
- pcrudcpy.update(cpy);
-
- var pcrudnote = new openils.PermaCrud({"authtoken":G.user.session});
- var note = new ccbin();
- note.note(joldparams);
- note.item(itemId);
- pcrudnote.create(note);
-
- return true;
-}
-
-/*
-===== reserves dialog stuff =====
-*/
-
-var cresCopy;
-function cresInit(currentCopy){
-
- cresCopy = currentCopy;
-
- var cresDlg = dijit.byId("cresSelectorDlg");
- cresBuildSelector();
- cresDlg.show();
-}
-
-function cresCreate( pub, callback, args ) {
-
- var name = dijit.byId("cresNewName");
- containerCresCreate(name.value);
- cresBuildSelector();
- name.attr("value", "");
-}
-
-function cresBuildSelector() {
-
- var req = new Request(
- FETCH_CONTAINERS, G.user.session, G.user.id(), 'copy', 'cres' );
- req.callback(cresAddBookbags);
- req.send();
-}
-
-
-function cresAddBookbags(r) {
-/*yeah, this sucks. Need to replace this.
-need to refresh the drop down otherwise it duplicates values
-everytime the dialog is given focus.
-Easiest way to do this likely is to use a dijit list, I can
-then use it's reset property
-*/
-$('cresSelector').options.length = 0;
-$('cresSelector').options[0] = new Option("Add to Reserve", "start");
-$('cresSelector').options[1] = new Option("--------------");
-$('cresSelector').options[1].disabled = true;
-$('cresSelector').options[2] = new Option("Add to Reserve");
-$('cresSelector').options[2].disabled = true;
-$('cresSelector').options[3] = new Option("--------------");
-$('cresSelector').options[3].disabled = true;
-
- var containers = r.getResultObject();
- var selector = $('cresSelector');
- var found = false;
- var index = 3;
- doSelectorActions(selector);
-
-
- for( var i = 0; i != containers.length; i++ ) {
- found = true;
- var container = containers[i];
- insertSelectorVal( selector, index++, container.name(),
- "container_" + container.id(), cresAddToBookbag, 1 );
- }
-
- nextContainerIndex = index;
-}
-
-
-function cresAddToBookbag() {
-
- var selector = $('cresSelector');
- var id = selector.options[selector.selectedIndex].value;
- setSelector( selector, 'start' );
- var circModSelector = $('cresCircModSelector');
- var circMod = circModSelector.options[circModSelector.selectedIndex].value;
- var loc = $('cresLocSelector').value;
-
- var cresInsert = containerCresCreateItem( id.substring(10), cresCopy.id() )
-
- if ( cresInsert ) {
- if ( containerCresCreateNote(cresInsert, circMod, loc)) { alert($('rdetail_bb_item_success').innerHTML);}
- }
-
-}
-
-function cresShowManager() {
-
- var cresManageDlg = dijit.byId('cresManageDialog');
- cresManageDlg.show();
-
-}
-
-/*
-===== "My Reserves" interface stuff =====
-*/
-
-var cresFleshedContainers = {};
-var cresContainerTemplate;
-
-function myOPACCresShowBookbags(force) {
-
- var tbody =$('myopac_cres_bookbag_tbody') ;
-
- if(!cresContainerTemplate)
- cresContainerTemplate = tbody.removeChild($('myopac_cres_bookbag_tr'));
- else if(!force) return;
-
- removeChildren(tbody);
-
- var containers = containerCresFetchAll();
-
- var found = false;
- for( var i in containers ) {
- found = true;
- var cont = containers[i];
- var row = cresContainerTemplate.cloneNode(true);
- row.id = 'myopac_cres_bookbag_row_' + cont.id();
- var link = $n(row, 'myopac_cres_expand_bookbag');
- var dlink = $n(row, 'myopac_cres_container_delete');
- link.appendChild( text(cont.name()) );
- link.setAttribute('href',
- 'javascript:myOPACCresExpandBookbag("' + cont.id() + '","' + cont.name() + '");');
- myOPACCresFetchBBItems( cont.id(), row );
- dlink.setAttribute('href', 'javascript:myOPACCresDeleteBookbag("'+cont.id()+'");');
-
- if( isTrue(cont.pub()) ) {
- unHideMe($n(row, 'myopac_cres_bb_published_yes'));
- var link = $n(row, 'myopac_cres_bb_published_view');
- link.setAttribute('href', buildExtrasLink( 'feed/bookbag/html-full/'+cont.id(), false));
- link.setAttribute('target', '_blank' );
- unHideMe(link);
- link = $n(row, 'myopac_cres_bb_published_atom');
- link.setAttribute('href', buildExtrasLink( 'feed/bookbag/rss2-full/'+cont.id(), false));
- link.setAttribute('target', '_blank' );
- unHideMe(link);
-
- link = $n(row, 'myopac_cres_bb_make_unpublished');
- link.setAttribute('href', 'javascript:myOPACCresMakeBBPublished("'+cont.id()+'", true);');
- unHideMe(link);
-
- var RW = $n(row, 'myopac_cres_bb_exp_refworks');
- if (RW && myopacEnableRefWorks) {
- var here = (findOrgUnit(getLocation())).name();
- var org_name = here.replace(" ", "+");
- var cgi = new CGI();
-
- RW.setAttribute('href',
- myopacRefWorksHost + '/express/expressimport.asp?vendor='
- + org_name
- + '&filter=MARC+Format&database=All+MARC+Formats&encoding=65001&url=http%3A%2F%2F'
- + cgi.server_name + '/opac/extras/feed/bookbag/marctxt-full/'
- + cont.id()
- );
- RW.setAttribute('target', 'RefWorksMain');
- unHideMe($n(row, 'myopac_cres_bb_exp_refworks'));
- }
- } else {
- unHideMe($n(row, 'myopac_cres_bb_published_no'));
- var link = $n(row, 'myopac_cres_bb_make_published');
- link.setAttribute('href', 'javascript:myOPACCresMakeBBPublished("'+cont.id()+'");');
- unHideMe(link);
- }
- tbody.appendChild(row);
- }
-
- if(!found) unHideMe($('myopac_cres_bookbags_none'));
- else unHideMe($('myopac_cres_bookbag_table'));
-}
-
-
-function myOPACCresMakeBBPublished(bbid, hideme) {
-
- var bb = cresFleshedContainers[bbid];
-
- if(hideme) {
- if(!confirm($('myopac_make_unpublished_confirm').innerHTML)) return;
- bb.pub('f');
- } else {
- if(!confirm($('myopac_make_published_confirm').innerHTML)) return;
- bb.pub('t');
- }
-
- var result = containerCresUpdate(bb, 'copy');
-
- var code = checkILSEvent(result);
- if(code) { alertILSEvent(result); return; }
-
- alert($('myopac_bb_update_success').innerHTML);
- myOPACCresShowBookbags(true);
-}
-
-function myOPACCresDeleteBookbag(id) {
- if( confirm( $('myopac_cres_delete_bookbag_warn').innerHTML ) ) {
- var result = containerCresDelete(id);
- var code = checkILSEvent(result);
- if(code) { alertILSEvent(result); return; }
- alert($('myopac_cres_bb_update_success').innerHTML);
- hideMe($('myopac_cres_bookbag_items_table'));
- hideMe($('myopac_cres_bookbag_items_name'));
- hideMe($('myopac_cres_bookbag_no_items'));
- myOPACCresShowBookbags(true);
- }
-}
-
-function myOPACCresFetchBBItems( id, row, block ) {
- if(!block) {
- containerCresFlesh( id, _myOPACCresSetBBItems, { row: row } );
- } else {
- var cont = containerCresFlesh( id );
- myOPACCresSetBBItems( cont, row );
- }
-}
-
-function _myOPACCresSetBBItems(r) { myOPACCresSetBBItems( r.getResultObject(), r.args.row ); }
-
-function myOPACCresSetBBItems( container, row ) {
- cresFleshedContainers[container.id()] = container;
- var node = $n(row, 'myopac_cres_bookbag_item_count');
- removeChildren(node);
- node.appendChild( text(container.items().length) );
-}
-
-var cresBBItemsRow;
-function myOPACCresExpandBookbag( id, name ) {
-
- var tbody = $('myopac_cres_bookbag_items_tbody');
- if(!cresBBItemsRow) cresBBItemsRow = tbody.removeChild($('myopac_cres_bookbag_items_row'));
- removeChildren(tbody);
- removeChildren($('myopac_cres_bookbag_items_name'));
-
- $('myopac_cres_bookbag_items_name').appendChild(text(name));
-
- if( cresFleshedContainers[id] ) {
- var len = cresFleshedContainers[id].items().length;
-
- if( len == 0 ) {
- unHideMe($('myopac_cres_bookbag_no_items'));
- hideMe($('myopac_cres_bookbag_items_table'));
- return;
- }
-
- hideMe($('myopac_cres_bookbag_no_items'));
- unHideMe($('myopac_cres_bookbag_items_table'));
-
- for( var i = 0; i != len; i++ ) {
- var row = cresBBItemsRow.cloneNode(true);
- found = true;
-
- var item = cresFleshedContainers[id].items()[i];
- var tlink = $n(row,'myopac_cres_bookbag_items_title');
- var alink = $n(row,'myopac_cres_bookbag_items_author');
-
- var req = new Request( FETCH_RMODS, item.target_copy() );
- req.request.tlink = tlink;
- req.request.alink = alink;
- req.callback(myOPACCresShowBBItem);
- req.send();
-
- var clink = $n(row, 'myopac_cres_bookbag_items_remove');
- clink.setAttribute('href', 'javascript:myOPACCresRemoveBBItem("'+item.id()+'","'+id+'","'+name+'");');
-
- tbody.appendChild(row);
- }
- }
-}
-
-function myOPACCresRemoveBBItem( id, containerid, container_name ) {
- if(!confirm($('myopac_cres_remove_bb_item_confirm').innerHTML)) return;
- var stat = containerCresRemoveItem( id );
- if(stat) alert($('myopac_cres_bb_update_success').innerHTML);
- myOPACCresFetchBBItems( containerid, $('myopac_cres_bookbag_row_' + containerid), true);
- myOPACCresExpandBookbag( containerid, container_name );
-}
-
-function myOPACCresShowBBItem(r) {
- var record = r.getResultObject();
- buildTitleDetailLink(record, r.tlink);
- buildSearchLink(STYPE_AUTHOR, record.author(), r.alink);
-}
-
-/*
-function myOPACCresCreateBookbag() {
-
-}
- */
Copied: conifer/branches/rel_2_0/web/opac/skin/algoma/js/result_common.js (from rev 1399, conifer/branches/rel_2_0/web/opac/skin/lul/js/result_common.js)
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/js/result_common.js (rev 0)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/js/result_common.js 2011-04-19 20:32:38 UTC (rev 1401)
@@ -0,0 +1,904 @@
+dojo.require('openils.BibTemplate');
+dojo.requireLocalization("openils.opac", "opac");
+var opac_strings = dojo.i18n.getLocalization("openils.opac", "opac");
+
+var recordsHandled = 0;
+var recordsCache = [];
+var lowHitCount = 4;
+var isbnList = '';
+var googleBooksLink = false;
+
+var resultFetchAllRecords = false;
+var resultCompiledSearch = null;
+var allRecordsReceivedAndProcessed = false;
+
+var enableHoldsOnAvailable = false;
+var enableExtraSearchesLowHits = true;
+var localProxyPrefix = 'http://librweb.laurentian.ca/login?url=';
+
+/* an array of the extra services to which we want to direct people, in order of priority:
+Properties:
+ url: will be proxied via localProxyPrefix
+ description: will be used in the OPAC display
+ termTransform: a function name that transforms Evergreen compiled searches to the target search format
+*/
+var externalSearchServices = [
+ {
+ "url": "http://books.scholarsportal.info/search.html?searchField=All+Fields&limit=full_text&sortBy=relevance&collection=all&searchTerm=",
+ "description": "Search ScholarsPortal ebooks",
+ "termTransform": "allKeywords"
+ },
+ {
+ "url": "http://scholar.google.com/scholar?q=",
+ "description": "Search Google Scholar",
+ "termTransform": "allKeywords"
+ }
+];
+
+/* set up the event handlers */
+if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
+ G.evt.result.hitCountReceived.push(resultSetHitInfo);
+ G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts);
+ G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
+ G.evt.result.allRecordsReceived.push( function(){unHideMe($('result_info_2'))}, fetchGoogleBooksLink, function() { allRecordsReceivedAndProcessed = true; }, fetchChiliFreshReviews);
+
+ attachEvt('result','lowHits',resultLowHits);
+ attachEvt('result','zeroHits',resultZeroHits);
+ attachEvt( "common", "locationUpdated", resultSBSubmit );
+ /* do this after we have ID's so the rank for mr pages will be correct */
+ attachEvt("result", "preCollectRecords", resultPaginate);
+}
+
+function resultSBSubmit(){searchBarSubmit();}
+
+/* returns the last 'index' postion ocurring in this page */
+function resultFinalPageIndex() {
+ if(getHitCount() < (getOffset() + getDisplayCount()))
+ return getHitCount() - 1;
+ return getOffset() + getDisplayCount() - 1;
+}
+
+
+
+
+/* generic search method */
+function resultCollectSearchIds( type, method, handler ) {
+
+ var sort = (getSort() == SORT_TYPE_REL) ? null : getSort();
+ var sortdir = (sort) ? ((getSortDir()) ? getSortDir() : SORT_DIR_ASC) : null;
+
+ var item_type;
+ var item_form;
+ var args = {};
+
+ if( type ) {
+ var form = parseForm(getForm());
+ item_type = form.item_type;
+ item_form = form.item_form;
+
+ } else {
+ item_type = (getItemType()) ? getItemType().split(/,/) : null;
+ item_form = (getItemForm()) ? getItemForm().split(/,/) : null;
+ }
+
+ var limit = (resultFetchAllRecords) ? 1000 : getDisplayCount();
+
+ if( getOffset() > 0 ) {
+ if( getHitCount() > 0 && (getOffset() + getDisplayCount()) > getHitCount() )
+ limit = getHitCount() - getOffset();
+ }
+
+ var lasso = getLasso();
+
+ if (lasso) args.org_unit = -lasso;
+ else args.org_unit = getLocation();
+
+ args.depth = getDepth();
+ args.limit = limit;
+ args.offset = getOffset();
+ args.visibility_limit = 3000;
+ args.default_class = getStype();
+
+ if(sort) args.sort = sort;
+ if(sortdir) args.sort_dir = sortdir;
+ if(item_type) args.item_type = item_type;
+ if(item_form) args.item_form = item_form;
+ if(getAvail()) args.available = 1;
+
+
+ if(getFacet()) args.facets = getFacet();
+
+ if(getAudience()) args.audience = getAudience().split(/,/);
+ if(getLitForm()) args.lit_form = getLitForm().split(/,/);
+ if(getLanguage()) args.language = getLanguage().split(/,/);
+ if(getBibLevel()) args.bib_level = getBibLevel().split(/,/);
+ if(getCopyLocs()) args.locations = getCopyLocs().split(/,/);
+ if(getPubdBefore()) args.before = getPubdBefore();
+ else if(getPubdAfter()) args.after = getPubdAfter();
+ else if(getPubdBetween()) args.between = getPubdBetween().split(/,/);
+
+ _debug('Search args: ' + js2JSON(args));
+ _debug('Raw query: ' + getTerm());
+
+ var atomfeed = "/opac/extras/opensearch/1.1/" + findOrgUnit(args.org_unit).shortname() + "/atom-full/" + getStype() + '?searchTerms=' + getTerm();
+ if (args.facets) { atomfeed += ' ' + args.facets; }
+ if (sort) { atomfeed += '&searchSort=' + sort; }
+ if (sortdir) { atomfeed += '&searchSortDir=' + sortdir; }
+ dojo.create('link', {"rel":"alternate", "href":atomfeed, "type":"application/atom+xml"}, dojo.query('head')[0]);
+
+ var req = new Request(method, args, getTerm(), 1);
+ req.callback(handler);
+ req.send();
+}
+
+
+
+
+
+/* set the search result info, number of hits, which results we're
+ displaying, links to the next/prev pages, etc. */
+function resultSetHitInfo() {
+
+ var lasso = getLasso();
+ if (!lasso) {
+ /* tell the user where the results are coming from */
+ var baseorg = findOrgUnit(getLocation());
+ var depth = getDepth();
+ var mydepth = findOrgDepth(baseorg);
+ if( findOrgDepth(baseorg) != depth ) {
+ var tmporg = baseorg;
+ while( mydepth > depth ) {
+ mydepth--;
+ tmporg = findOrgUnit(tmporg.parent_ou());
+ }
+ unHideMe($('including_results_for'));
+ $('including_results_location').appendChild(text(tmporg.name()));
+ }
+ }
+
+
+ try{searchTimer.stop()}catch(e){}
+
+ //if( findCurrentPage() == MRESULT ) {
+ if( findCurrentPage() == MRESULT ||
+
+ (findCurrentPage() == RRESULT &&
+ (
+ getRtype() == RTYPE_TITLE ||
+ getRtype() == RTYPE_AUTHOR ||
+ getRtype() == RTYPE_SUBJECT ||
+ getRtype() == RTYPE_SERIES ||
+ getRtype() == RTYPE_KEYWORD
+ )
+
+ ) ) {
+
+ if(getHitCount() <= lowHitCount && getTerm())
+ runEvt('result', 'lowHits');
+ }
+
+ if(getHitCount() == 0) {
+ runEvt('result', 'zeroHits');
+ return;
+ }
+
+
+ var pages = getHitCount() / getDisplayCount();
+ if(pages % 1) pages = parseInt(pages) + 1;
+
+
+
+ var cpage = (getOffset()/getDisplayCount()) + 1;
+
+ G.ui.result.current_page.appendChild(text(cpage));
+ G.ui.result.num_pages.appendChild(text(pages + ")")); /* the ) is dumb */
+
+ $('current_page2').appendChild(text(cpage));
+ $('num_pages2').appendChild(text(pages + ")")); /* the ) is dumb */
+
+ /* set the offsets */
+ var offsetEnd = getDisplayCount() + getOffset();
+ if( getDisplayCount() > (getHitCount() - getOffset()))
+ offsetEnd = getHitCount();
+
+ G.ui.result.offset_end.appendChild(text(offsetEnd));
+ G.ui.result.offset_start.appendChild(text(getOffset() + 1));
+
+ $('offset_end2').appendChild(text(offsetEnd));
+ $('offset_start2').appendChild(text(getOffset() + 1));
+
+ G.ui.result.result_count.appendChild(text(getHitCount()));
+ unHideMe(G.ui.result.info);
+
+ $('result_count2').appendChild(text(getHitCount()));
+ unHideMe($('result_info_div2'));
+}
+
+function resultLowHits() {
+ showCanvas();
+ unHideMe($('result_low_hits'));
+ if(getHitCount() > 0)
+ unHideMe($('result_low_hits_msg'));
+
+ var words = [];
+ for(var key in resultCompiledSearch.searches)
+ words.push(resultCompiledSearch.searches[key].term);
+
+ var sreq = new Request(CHECK_SPELL, words.join(' '));
+ sreq.callback(resultSuggestSpelling);
+ sreq.send();
+
+ for(var key in resultCompiledSearch.searches) {
+ var areq = new Request(FETCH_CROSSREF, key, resultCompiledSearch.searches[key].term);
+ areq.callback(resultLowHitXRef);
+ areq.send();
+ }
+
+ if( !(getForm() == null || getForm() == 'all' || getForm() == "") ) {
+ var a = {};
+ a[PARAM_FORM] = "all";
+ $('low_hits_remove_format_link').setAttribute('href',buildOPACLink(a));
+ unHideMe($('low_hits_remove_format'));
+ }
+
+ resultSuggestSearchClass();
+
+ if (enableExtraSearchesLowHits) {
+ resultSuggestExtraSearches();
+ }
+
+ if(getTerm()) resultExpandSearch(); /* advanced search */
+}
+
+var lowHitsXRefSet = {};
+var lowHitsXRefLink;
+var lowHitsXRefLinkParent;
+function resultLowHitXRef(r) {
+ if(!lowHitsXRefLink){
+ lowHitsXRefLinkParent = $('low_hits_xref_link').parentNode;
+ lowHitsXRefLink = lowHitsXRefLinkParent.removeChild($('low_hits_xref_link'));
+ }
+ var res = r.getResultObject();
+ var arr = res.from;
+ arr.concat(res.also);
+ if(arr && arr.length > 0) {
+ unHideMe($('low_hits_cross_ref'));
+ var word;
+ var c = 0;
+ while( word = arr.shift() ) {
+
+ if (lowHitsXRefSet[word] == 1) continue;
+ lowHitsXRefSet[word] = 1;
+
+ if(c++ > 20) break;
+ var a = {};
+ a[PARAM_TERM] = word;
+ var template = lowHitsXRefLink.cloneNode(true);
+ template.setAttribute('href',buildOPACLink(a));
+ template.appendChild(text(word));
+ lowHitsXRefLinkParent.appendChild(template);
+ lowHitsXRefLinkParent.appendChild(text(' '));
+ }
+ }
+}
+
+function resultZeroHits() {
+ showCanvas();
+ unHideMe($('result_low_hits'));
+ unHideMe($('result_zero_hits_msg'));
+ //if(getTerm()) resultExpandSearch(); /* advanced search */
+}
+
+function resultExpandSearch() {
+ var top = findOrgDepth(globalOrgTree);
+
+ /* We don't want to expand the scope to Everywhere in Conifer, that's just confusing */
+ if(getDepth() == top || getDepth() - 1 == top) return;
+ unHideMe($('low_hits_expand_range'));
+ var par = $('low_hits_expand_link').parentNode;
+ var template = par.removeChild($('low_hits_expand_link'));
+
+ var bottom = getDepth();
+ while( top < bottom ) {
+ var a = {};
+ a[PARAM_DEPTH] = top;
+ var temp = template.cloneNode(true);
+ temp.appendChild(text(findOrgTypeFromDepth(top).opac_label()))
+ temp.setAttribute('href',buildOPACLink(a));
+ par.appendChild(temp);
+ top++;
+ }
+}
+
+/* Generate links to our extra search services */
+function resultSuggestExtraSearches() {
+ dojo.forEach(externalSearchServices, function(esItem) {
+ var extraSearchStuff = this[esItem.termTransform].apply(this, [esItem.url]);
+ dojo.place("<div style='text-align: center; width: 100%; margin-left: auto; margin-right: auto;'><strong>" +
+ esItem.description + "</strong>: <a class='classic_link' href='" +
+ extraSearchStuff.searchTerms + "'>" + extraSearchStuff.displayTerms + "</a><div>", "result_low_hits", "child"
+ );
+ });
+}
+
+/* Transform everything in the Evergreen search to plain old keywords */
+function allKeywords(esUrl) {
+ var ebook_search = localProxyPrefix + esUrl;
+ var ebook_terms = '';
+ for (var key in resultCompiledSearch.searches) {
+ ebook_search += resultCompiledSearch.searches[key].term + '+';
+ ebook_terms += resultCompiledSearch.searches[key].term + ' ';
+ }
+ ebook_search = ebook_search.replace(/ /g, '+');
+ ebook_search = ebook_search.replace(/\%20/g, '+');
+ ebook_search = ebook_search.replace(/\+$/g, '');
+ ebook_terms = ebook_terms.replace(/ $/g, '');
+ var extraSuggestion = {"displayTerms": ebook_terms, "searchTerms": ebook_search};
+ return extraSuggestion;
+}
+
+function resultSuggestSearchClass() {
+ var stype = getStype();
+ if(stype == STYPE_KEYWORD) return;
+ var a = {}; var ref;
+ unHideMe($('low_hits_search_type'));
+ if(stype != STYPE_TITLE) {
+ ref = $('low_hits_title_search');
+ unHideMe(ref);
+ a[PARAM_STYPE] = STYPE_TITLE;
+ ref.setAttribute('href',buildOPACLink(a));
+ }
+ if(stype != STYPE_AUTHOR) {
+ ref = $('low_hits_author_search');
+ unHideMe(ref);
+ a[PARAM_STYPE] = STYPE_AUTHOR;
+ ref.setAttribute('href',buildOPACLink(a));
+ }
+ if(stype != STYPE_SUBJECT) {
+ ref = $('low_hits_subject_search');
+ unHideMe(ref);
+ a[PARAM_STYPE] = STYPE_SUBJECT;
+ ref.setAttribute('href',buildOPACLink(a));
+ }
+ if(stype != STYPE_KEYWORD) {
+ ref = $('low_hits_keyword_search');
+ unHideMe(ref);
+ a[PARAM_STYPE] = STYPE_KEYWORD;
+ ref.setAttribute('href',buildOPACLink(a));
+ }
+ if(stype != STYPE_SERIES) {
+ ref = $('low_hits_series_search');
+ unHideMe(ref);
+ a[PARAM_STYPE] = STYPE_SERIES;
+ ref.setAttribute('href',buildOPACLink(a));
+ }
+}
+
+function resultSuggestSpelling(r) {
+ var res = r.getResultObject();
+ var phrase = getTerm();
+ var words = phrase.split(/ /);
+
+ var newterm = "";
+
+ for( var w = 0; w < words.length; w++ ) {
+ var word = words[w];
+ var blob = grep(res, function(i){return (i.word == word);});
+ if( blob ) blob = blob[0];
+ else continue;
+ if( blob.word == word ) {
+ if( blob.suggestions && blob.suggestions[0] ) {
+ newterm += " " + blob.suggestions[0];
+ unHideMe($('did_you_mean'));
+ } else {
+ newterm += " " + word;
+ }
+ }
+ }
+
+ var arg = {};
+ arg[PARAM_TERM] = newterm;
+ $('spell_check_link').setAttribute('href', buildOPACLink(arg));
+ $('spell_check_link').appendChild(text(newterm));
+}
+
+
+function resultPaginate() {
+ var o = getOffset();
+
+ if( !( ((o) + getDisplayCount()) >= getHitCount()) ) {
+
+ var args = {};
+ args[PARAM_OFFSET] = o + getDisplayCount();
+ args[PARAM_SORT] = SORT;
+ args[PARAM_SORT_DIR] = SORT_DIR;
+ args[PARAM_RLIST] = new CGI().param(PARAM_RLIST);
+
+ G.ui.result.next_link.setAttribute("href", buildOPACLink(args));
+ addCSSClass(G.ui.result.next_link, config.css.result.nav_active);
+
+ $('next_link2').setAttribute("href", buildOPACLink(args));
+ addCSSClass($('next_link2'), config.css.result.nav_active);
+
+ args[PARAM_OFFSET] = getHitCount() - (getHitCount() % getDisplayCount());
+
+ /* when hit count is divisible by display count, we have to adjust */
+ if( getHitCount() % getDisplayCount() == 0 )
+ args[PARAM_OFFSET] -= getDisplayCount();
+
+ /*
+ G.ui.result.end_link.setAttribute("href", buildOPACLink(args));
+ addCSSClass(G.ui.result.end_link, config.css.result.nav_active);
+
+ $('end_link2').setAttribute("href", buildOPACLink(args));
+ addCSSClass($('end_link2'), config.css.result.nav_active);
+ */
+ }
+
+ if( o > 0 ) {
+
+ var args = {};
+ args[PARAM_SORT] = SORT;
+ args[PARAM_SORT_DIR] = SORT_DIR;
+ args[PARAM_RLIST] = new CGI().param(PARAM_RLIST);
+
+ args[PARAM_OFFSET] = o - getDisplayCount();
+ 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));
+ addCSSClass($('prev_link2'), config.css.result.nav_active);
+
+ args[PARAM_OFFSET] = 0;
+ G.ui.result.home_link.setAttribute( "href", buildOPACLink(args));
+ addCSSClass(G.ui.result.home_link, config.css.result.nav_active);
+
+ $('search_home_link2').setAttribute( "href", buildOPACLink(args));
+ addCSSClass($('search_home_link2'), config.css.result.nav_active);
+ }
+
+ if(getDisplayCount() < getHitCount()) {
+ unHideMe($('start_end_links_span'));
+ unHideMe($('start_end_links_span2'));
+ }
+
+ showCanvas();
+ try{searchTimer.stop()}catch(e){}
+}
+
+function buildunAPISpan (span, type, id) {
+ var cgi = new CGI();
+ var d = new Date();
+
+ addCSSClass(span,'unapi-id');
+
+ span.setAttribute(
+ 'title',
+ 'tag:' + cgi.server_name + ',' +
+ d.getFullYear() +
+ ':' + type + '/' + id
+ );
+}
+
+function unhideGoogleBooksLink (data) {
+ for ( var i in data ) {
+ //if (data[i].preview == 'noview') continue;
+
+ var gbspan = $n(document.documentElement, 'googleBooksLink-' + i);
+ var gba = $n(gbspan, "googleBooks-link");
+
+ gba.setAttribute(
+ 'href',
+ data[i].info_url
+ );
+ removeCSSClass( gbspan, 'hide_me' );
+ }
+}
+
+/* display the record info in the record display table 'pos' is the
+ zero based position the record should have in the display table */
+function resultDisplayRecord(rec, pos, is_mr) {
+
+ fieldmapper.IDL.load(['mvr']);
+ if(rec == null) rec = new mvr(); /* so the page won't die if there was an error */
+ recordsHandled++;
+ recordsCache.push(rec);
+
+ var r = table.rows[pos + 1];
+ var currentISBN = cleanISBN(rec.isbn());
+
+ if (googleBooksLink) {
+ var gbspan = $n(r, "googleBooksLink");
+ if (currentISBN) {
+ gbspan.setAttribute(
+ 'name',
+ gbspan.getAttribute('name') + '-' + currentISBN
+ );
+
+ if (isbnList) isbnList += ', ';
+ isbnList += currentISBN;
+ }
+ }
+
+ if (currentISBN && chilifresh && chilifresh != '(none)') {
+ var cfrow = $n(r, "chilifreshReview");
+ if (cfrow) {
+ removeCSSClass( cfrow, 'hide_me' );
+ }
+ var cflink = $n(r, "chilifreshReviewLink");
+ if (cflink) {
+ cflink.setAttribute(
+ 'id',
+ 'isbn_' + currentISBN
+ );
+ }
+ var cfdiv = $n(r, "chilifreshReviewResult");
+ if (cfdiv) {
+ cfdiv.setAttribute(
+ 'id',
+ 'chili_review_' + currentISBN
+ )
+ }
+ }
+
+/*
+ try {
+ var rank = parseFloat(ranks[pos + getOffset()]);
+ rank = parseInt( rank * 100 );
+ var relspan = $n(r, "relevancy_span");
+ relspan.appendChild(text(rank));
+ unHideMe(relspan.parentNode);
+ } catch(e){ }
+*/
+
+ var pic = $n(r, config.names.result.item_jacket);
+ pic.setAttribute("src", buildISBNSrc(currentISBN));
+
+ var title_link = $n(r, config.names.result.item_title);
+ var author_link = $n(r, config.names.result.item_author);
+
+ var onlyrec;
+ if( is_mr ) {
+ onlyrec = onlyrecord[ getOffset() + pos ];
+ if(onlyrec) {
+ buildunAPISpan($n(r,'unapi'), 'biblio-record_entry', onlyrec);
+
+ var args = {};
+ args.page = RDETAIL;
+ args[PARAM_OFFSET] = 0;
+ args[PARAM_RID] = onlyrec;
+ args[PARAM_MRID] = rec.doc_id();
+ pic.parentNode.setAttribute("href", buildOPACLink(args));
+ title_link.setAttribute("href", buildOPACLink(args));
+ title_link.appendChild(text(normalize(truncate(rec.title(), 65))));
+
+ } else {
+ buildunAPISpan($n(r,'unapi'), 'metabib-metarecord', rec.doc_id());
+
+ buildTitleLink(rec, title_link);
+ var args = {};
+ args.page = RRESULT;
+ args[PARAM_OFFSET] = 0;
+ args[PARAM_MRID] = rec.doc_id();
+ pic.parentNode.setAttribute("href", buildOPACLink(args));
+ }
+
+ if (enableHoldsOnAvailable) {
+ unHideMe($n(r,'place_hold_span'));
+ $n(r,'place_hold_link').setAttribute(
+ 'href','javascript:holdsDrawEditor({record:"'+rec.doc_id()+'",type:"M"});');
+ }
+
+ } else {
+ onlyrec = rec.doc_id();
+ buildunAPISpan($n(r,'unapi'), 'biblio-record_entry', rec.doc_id());
+
+ buildTitleDetailLink(rec, title_link);
+ var args = {};
+ args.page = RDETAIL;
+ args[PARAM_OFFSET] = 0;
+ args[PARAM_RID] = rec.doc_id();
+ pic.parentNode.setAttribute("href", buildOPACLink(args));
+
+ if (enableHoldsOnAvailable) {
+ unHideMe($n(r,'place_hold_span'));
+ $n(r,'place_hold_link').setAttribute(
+ 'href','javascript:holdsDrawEditor({record:"'+rec.doc_id()+'",type:"T"});');
+ }
+
+ }
+
+ buildSearchLink(STYPE_AUTHOR, rec.author(), author_link);
+
+ if(! is_mr ) {
+
+ $n(r, "recid_holder").appendChild( text( rec.doc_id()) );
+ if(!isNull(rec.edition())) {
+ unHideMe( $n(r, "result_table_extra_span"));
+ $n(r, "result_table_edition_span").appendChild( text( rec.edition()) );
+ }
+ if(!isNull(rec.pubdate())) {
+ unHideMe( $n(r, "result_table_extra_span"));
+ unHideMe($n(r, "result_table_pub_span"));
+ $n(r, "result_table_pub_span").appendChild( text( rec.pubdate() ));
+ }
+ if(!isNull(rec.publisher()) ) {
+ unHideMe( $n(r, "result_table_extra_span"));
+ unHideMe($n(r, "result_table_pub_span"));
+ $n(r, "result_table_pub_span").appendChild( text( " " + rec.publisher() ));
+ }
+
+ if(!isNull(rec.physical_description()) ) {
+ unHideMe( $n(r, "result_table_extra_span"));
+ var t = " " + rec.physical_description();
+ //$n(r, "result_table_phys_span").appendChild( text(t.replace(/:.*/g,'')));
+ $n(r, "result_table_phys_span").appendChild( text(t));
+ }
+
+ }
+
+ resultBuildFormatIcons( r, rec, is_mr );
+
+ var bt_params = {
+ sync : false,
+ root : r,
+ subObjectLimit : 10,
+ org_unit : findOrgUnit(getLocation()).shortname(),
+ depth : getDepth()
+ };
+
+ if (!is_mr) {
+ bt_params = dojo.mixin( bt_params, { record : onlyrec } );
+ } else {
+ bt_params = dojo.mixin( bt_params, { metarecord : onlyrec } );
+ }
+
+ if (findOrgType(findOrgUnit(getLocation()).ou_type()).can_have_vols())
+ unHideMe($n(r,'local_callnumber_list'));
+
+ new openils.BibTemplate( bt_params ).render();
+
+ unHideMe(r);
+
+ runEvt("result", "recordDrawn", rec.doc_id(), title_link);
+
+ /*
+ if(resultPageIsDone()) {
+ runEvt('result', 'allRecordsReceived', recordsCache);
+ }
+ */
+}
+
+function _resultFindRec(id) {
+ for( var i = 0; i != recordsCache.length; i++ ) {
+ var rec = recordsCache[i];
+ if( rec && rec.doc_id() == id )
+ return rec;
+ }
+ return null;
+}
+
+
+function resultBuildFormatIcons( row, rec, is_mr ) {
+
+ var ress = rec.types_of_resource();
+
+ for( var i in ress ) {
+
+ var res = ress[i];
+ if(!res) continue;
+
+ var link = $n(row, res + "_link");
+ link.title = res;
+ var img = link.getElementsByTagName("img")[0];
+ removeCSSClass( img, config.css.dim );
+
+ var f = getForm();
+ if( f != "all" ) {
+ if( f == modsFormatToMARC(res) )
+ addCSSClass( img, "dim2_border");
+ }
+
+ var args = {};
+ args[PARAM_OFFSET] = 0;
+
+ if(is_mr) {
+ args.page = RRESULT;
+ args[PARAM_TFORM] = modsFormatToMARC(res);
+ args[PARAM_MRID] = rec.doc_id();
+
+ } else {
+ args.page = RDETAIL
+ args[PARAM_RID] = rec.doc_id();
+ }
+
+ link.setAttribute("href", buildOPACLink(args));
+
+ }
+}
+
+function fetchGoogleBooksLink () {
+ if (allRecordsReceivedAndProcessed) { return; }
+
+ if (isbnList && googleBooksLink) {
+ var scriptElement = document.createElement("script");
+ scriptElement.setAttribute("id", "jsonScript");
+ scriptElement.setAttribute("src",
+ "http://books.google.com/books?bibkeys=" +
+ escape(isbnList) + "&jscmd=viewapi&callback=unhideGoogleBooksLink");
+ scriptElement.setAttribute("type", "text/javascript");
+ // make the request to Google Book Search
+ document.documentElement.firstChild.appendChild(scriptElement);
+ }
+}
+
+function fetchChiliFreshReviews() {
+ if (chilifresh && chilifresh != '(none)') {
+ try { chili_init(); } catch(E) { console.log(E + '\n'); }
+ }
+}
+
+function resultPageIsDone(pos) {
+
+ return (recordsHandled == getDisplayCount()
+ || recordsHandled + getOffset() == getHitCount());
+}
+
+var resultCCHeaderApplied = false;
+
+/* -------------------------------------------------------------------- */
+/* dynamically add the copy count rows based on the org type 'countsrow'
+ is the row into which we will add TD's to hold the copy counts
+ This code generates copy count cells with an id of
+ 'copy_count_cell_<depth>_<pagePosition>' */
+function resultAddCopyCounts(rec, pagePosition) {
+
+ var r = table.rows[pagePosition + 1];
+ var countsrow = $n(r, config.names.result.counts_row );
+ var ccell = $n(countsrow, config.names.result.count_cell);
+
+ var nodes = orgNodeTrail(findOrgUnit(getLocation()));
+ var start_here = 0;
+ var orgHiding = checkOrgHiding();
+ if (orgHiding) {
+ for (var i = 0; i < nodes.length; i++) {
+ if (orgHiding.depth == findOrgDepth(nodes[i])) {
+ start_here = i;
+ }
+ }
+ }
+
+ var node = nodes[start_here];
+ var type = findOrgType(node.ou_type());
+ ccell.id = "copy_count_cell_" + type.depth() + "_" + pagePosition;
+ ccell.title = type.opac_label();
+ //addCSSClass(ccell, config.css.result.cc_cell_even);
+
+ var lastcell = ccell;
+ var lastheadcell = null;
+
+ var cchead = null;
+ var ccheadcell = null;
+ if(!resultCCHeaderApplied && !getLasso()) {
+ ccrow = $('result_thead_row');
+ ccheadcell = ccrow.removeChild($n(ccrow, "result_thead_ccell"));
+ var t = ccheadcell.cloneNode(true);
+ lastheadcell = t;
+ t.appendChild(text(type.opac_label()));
+ ccrow.appendChild(t);
+ resultCCHeaderApplied = true;
+ }
+
+ if(nodes[start_here+1]) {
+
+ var x = start_here+1;
+ var d = findOrgDepth(nodes[start_here+1]);
+ var d2 = findOrgDepth(nodes[nodes.length -1]);
+
+ for( var i = d; i <= d2 ; i++ ) {
+
+ ccell = ccell.cloneNode(true);
+
+ //if((i % 2)) removeCSSClass(ccell, "copy_count_cell_even");
+ //else addCSSClass(ccell, "copy_count_cell_even");
+
+ var node = nodes[x++];
+ var type = findOrgType(node.ou_type());
+
+ ccell.id = "copy_count_cell_" + type.depth() + "_" + pagePosition;
+ ccell.title = type.opac_label();
+ countsrow.insertBefore(ccell, lastcell);
+ lastcell = ccell;
+
+ if(ccheadcell) {
+ var t = ccheadcell.cloneNode(true);
+ t.appendChild(text(type.opac_label()));
+ ccrow.insertBefore(t, lastheadcell);
+ lastheadcell = t;
+ }
+ }
+ }
+
+ unHideMe($("search_info_table"));
+}
+
+/* collect copy counts for a record using method 'methodName' */
+function resultCollectCopyCounts(rec, pagePosition, methodName) {
+ if(rec == null || rec.doc_id() == null) return;
+
+ var loc = getLasso();
+ if (loc) loc = -loc;
+ else loc= getLocation();
+
+ var req = new Request(methodName, loc, rec.doc_id(), getForm() );
+ req.request.userdata = [ rec, pagePosition ];
+ req.callback(resultHandleCopyCounts);
+ req.send();
+}
+
+function resultHandleCopyCounts(r) {
+ runEvt('result', 'copyCountsReceived', r.userdata[0], r.userdata[1], r.getResultObject());
+}
+
+
+/* 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 (getLasso()) {
+ var copy_counts_lasso = {
+ transcendant : null,
+ count : 0,
+ unshadow : 0,
+ available : 0,
+ depth : -1,
+ org_unit : getLasso()
+ };
+
+ for (var i in copy_counts) {
+ copy_counts_lasso.transcendant = copy_counts[i].transcendant;
+ copy_counts_lasso.count += parseInt(copy_counts[i].count);
+ copy_counts_lasso.unshadow += parseInt(copy_counts[i].unshadow);
+ copy_counts_lasso.available += parseInt(copy_counts[i].available);
+ }
+
+ copy_counts = [ copy_counts_lasso ];
+ }
+
+ var i = 0;
+ while(copy_counts[i] != null) {
+ var cell = $("copy_count_cell_" + i +"_" + pagePosition);
+ if (cell) {
+ var cts = copy_counts[i];
+ cell.appendChild(text(cts.available + " / " + cts.count));
+
+ if (!enableHoldsOnAvailable && (i == (copy_counts.length - 1))) {
+ var resultTBody = findParentByNodeName(cell, 'TBODY');
+ if (cts.available == 0 && cts.count > 0 && !metarecords) {
+ dojo.query('[name="place_hold_span"]', resultTBody).removeClass('hide_me');
+ } else {
+ dojo.query('[name="place_hold_span"]', resultTBody).addClass('hide_me');
+ }
+ }
+
+ if(isXUL()) {
+ /* here we style opac-invisible records for xul */
+
+ if( cts.depth == 0 ) {
+ if(cts.transcendant == null && cts.unshadow == 0) {
+ _debug("found an opac-shadowed record: " + rec.doc_id());
+ var row = cell.parentNode.parentNode.parentNode.parentNode.parentNode;
+ if( cts.count == 0 )
+ addCSSClass( row, 'no_copies' );
+ else
+ addCSSClass( row, 'shadowed' );
+ }
+ }
+ }
+ }
+ i++;
+ }
+}
+
+
Modified: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/common/css_common.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/common/css_common.xml 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/common/css_common.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -13,12 +13,11 @@
<!-- OpenSearch auto discovery -->
<link type="application/opensearchdescription+xml"
- rel='search' title="Evergreen"
- href="http://<!--#echo var='SERVER_NAME'-->/opac/extras/opensearch/1.1/-/osd.xml" />
+ rel='search' title="Algoma University Library"
+ href="http://<!--#echo var='SERVER_NAME'-->/opac/extras/opensearch/1.1/OSTMA/OSTMA/osd.xml" />
<!-- enable Dojo date picker -->
<style type="text/css">
@import '/js/dojo/dojo/resources/dojo.css';
@import '/js/dojo/dijit/themes/tundra/tundra.css';
- @import '/js/dojo/dijit/themes/tundra/tundra_rtl.css';
</style>
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac/myopac_cres.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac/myopac_cres.xml 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac/myopac_cres.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,141 +0,0 @@
-
-<div id='myopac_cres_div' class='hide_me' xmlns:xi="http://www.w3.org/2001/XInclude" >
- <script language="javascript" type="text/javascript" src="<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/reserves.js"></script>
- <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/container.js'> </script>
-
- <div id='myopac_cres_delete_bookbag_warn' class='hide_me'>
- &myopac.delete.bookbag;
- </div>
-
- <div style='text-align: center; font-weight: bold;'
- class='hide_me' id='myopac_cres_bookbags_none'>&myopac.no.bookbags;</div>
-
- <div style='width: 99%; text-align: center; margin-bottom: 10px;'>
- <b>&myopac.bookbags.title;</b>
- <!--
- <a class='classic_link' style='margin-left: 5px; font-size: 8pt;'
- href='javascript:alert($("myopac_bb_what_are").innerHTML);'>(What are Bookbags?)</a>
- -->
- </div>
-
- <table width='100%' class='data_grid data_grid_center hide_me' id='myopac_cres_bookbag_table'>
- <thead>
- <tr><td>&common.name;</td><td>&myopac.bookbag.items;</td><td>&myopac.bookbag.shared;</td><td>&myopac.bookbag.toggle;</td><td>&myopac.bookbag.delete;</td></tr>
- </thead>
- <tbody id='myopac_cres_bookbag_tbody'>
- <tr id='myopac_cres_bookbag_tr'>
- <td>
- <a href='javascript:void(0);' class='classic_link' name='myopac_cres_expand_bookbag'> </a>
- </td>
- <td><span name='myopac_cres_bookbag_item_count'> </span> <span> &myopac.items;</span></td>
- <td>
- <span name='myopac_cres_bb_published_no' class='hide_me'>&common.no;</span>
- <span name='myopac_cres_bb_published_yes' class='hide_me'>&common.yes;</span>
- <a name='myopac_cres_bb_published_view' class='classic_link hide_me'>&myopac.view;</a>
- <a name='myopac_cres_bb_published_atom' class='unadorned_link hide_me'>
- <img border="0" src="/opac/images/small-rss.png" title="&myopac.atom.feed;" alt="&myopac.atom.feed;"/>
- </a>
- <br/><a name='myopac_cres_bb_exp_refworks' class='classic_link hide_me'>&myopac.bookbag.refworks;</a>
- </td>
-
- <td>
- <a name='myopac_cres_bb_make_unpublished' class='classic_link hide_me'>&myopac.bookbag.hide;</a>
- <a name='myopac_cres_bb_make_published' class='classic_link hide_me'>&myopac.bookbag.share;</a>
- </td>
-
- <td>
- <a class='classic_link' href='javascript:void(0);' name='myopac_cres_container_delete'>&myopac.delete;</a>
- </td>
- </tr>
- </tbody>
- </table>
-
- <table width='100%' class='data_grid data_grid_center' style='margin-top: 10px;'>
- <thead>
- <tr><td>&myopac.bookbag.create;</td></tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <span style='padding-right: 5px;'>&myopac.bookbag.naming;</span>
- <input id='myopac_cres_bookbag_new_name' type='text' />
- </td>
- </tr>
- <!--tr>
- <td>
- <span style='padding: 5px;'>&myopac.bookbag.share;</span>
- <a class='classic_link' href='javascript:alert($("bb_publish_text").innerHTML);'><b>&common.help;</b></a>
- <span>&common.yes;</span> <input type='radio' name='bb_public' id='bb_public_yes'/>
- <span>&common.no;</span> <input type='radio' name='bb_public' id='bb_public_no' checked='checked'/>
- <input style='padding-left: 10px;' onclick='myOPACCreateBookbag();'
- type='submit' value='&common.submit;' />
- </td>
-
- </tr -->
- <tr>
- <td> <input onclick="initDialog('new');" type='submit' name='reserves' value='Manage Reserves' /> </td>
- </tr>
-
- </tbody>
- </table>
-
- <!--
- <div style='overflow: auto; max-height: 200px;' class='hide_me'>
- -->
- <div style='width: 99%; text-align: center'> <b id='myopac_cres_bookbag_items_name'> </b></div>
-
- <div class='hide_me' style='width: 100%; text-align: center; font-weight: 700; margin-top: 10px;'
- id='myopac_cres_bookbag_no_items'>&myopac.bookbag.no.items;</div>
-
- <table width='100%' class='hide_me data_grid data_grid_center' id='myopac_cres_bookbag_items_table'>
- <thead>
- <tr> <td>&common.title;</td> <td>&common.authors;</td> <td>&myopac.bookbag.remove;</td> </tr>
- </thead>
- <tbody id='myopac_cres_bookbag_items_tbody'>
- <tr id='myopac_cres_bookbag_items_row'>
- <td> <a name='myopac_cres_bookbag_items_title' class='classic_link'> </a> </td>
- <!--
- <td> <a name='myopac_bookbag_items_author' class='classic_link'> </a> </td>
- -->
- <td name='myopac_cres_bookbag_items_author'> </td>
- <td><a name='myopac_cres_bookbag_items_remove' class='classic_link'>&myopac.remove.link;</a></td>
- </tr>
- </tbody>
- </table>
- <!--</div>-->
-
- <span id='bb_cres_publish_text' class='hide_me'>
- &myopac.publish.text;
- </span>
-
- <span id='myopac_cres_remove_bb_item_confirm' class='hide_me'>
- &myopac.item.confirm;
- </span>
-
- <span id='myopac_cres_make_published_confirm' class='hide_me'>
- &myopac.publish.confirm;
- </span>
-
- <span id='myopac_cres_make_unpublished_confirm' class='hide_me'>
- &myopac.unpublish.confirm;
- </span>
-
- <span id='myopac_cres_bb_update_success' class='hide_me'>
- &myopac.update.success;
- </span>
-
- <span id='bb_cres_create_warning' class='hide_me'>
- &myopac.create.warning;
- </span>
-
- <span id='myopac_cres_bb_what_are' class='hide_me'>
- &myopac.describe.bookbags;
- </span>
-
- <span class='hide_me' id='bb_cres_update_success'>
- &myopac.updated.success;
- </span>
-
-</div>
-
-
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac.xml 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/myopac.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Loads the environment -->
-<!--#include virtual="setenv.xml"-->
-
-<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
- <!--#include virtual="/opac/locale/${locale}/opac.dtd"-->
-]>
-
-
-<html xmlns='http://www.w3.org/1999/xhtml'>
- <!--#include virtual="header.xml"-->
- <!--#include virtual="reserves/reserves.xml"-->
- <!--#if expr="$OILS_PAGE='index.xml'"-->
- <!--#include virtual="home/index_body.xml"-->
- <!--#else-->
- <!--#include virtual="body.xml"-->
- <!--#endif-->
-</html>
-
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/page_myopac.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/page_myopac.xml 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/page_myopac.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,74 +0,0 @@
-<div id='canvas_main' class='canvas hide_me'>
-
- <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/myopac.js'></script>
- <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/DP_DateExtensions.js'></script>
-
- <script language='javascript' type='text/javascript'> config.ids.altcanvas.myopac_reload = 'myopac_reloading'; </script>
- <div id='myopac_reloading' class='hide_me canvas'> &common.loading; </div>
-
- <script language='javascript' type='text/javascript'>
- config.ids.myopac = {};
- config.css.myopac = {};
- config.names.myopac = {};
- </script>
-
- <br/>
- <table style='width: 98%; text-align: center;'>
- <tbody>
- <tr id='myopac_nav_row'>
-
- <td class='myopac_link border_6' id='myopac_summary_td' >
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("summary");'>&myopac.account;</a>
- </td>
-
- <td class='myopac_link border_6' id='myopac_checked_td' >
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("checked");'>&myopac.checkouts;</a>
- </td>
-
- <td class='myopac_link border_6' id='myopac_holds_td' >
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("holds");'>&myopac.holds;</a>
- </td>
-
- <td class='myopac_link border_6' id='myopac_fines_td' >
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("fines");'>&myopac.fines;</a>
- </td>
-
- <td class='myopac_link border_6' id='myopac_prefs_td' >
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("prefs");'>&myopac.preferences;</a>
- </td>
-
- <td class='myopac_link border_6' id='myopac_bookbag_td' nowrap='nowrap'>
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("bookbag");'>&myopac.bookbags;</a>
-
- </td>
- <td class='myopac_link border_6' id='myopac_cres_bookbag_td' nowrap='nowrap'>
- <a href='javascript:void(0);'
- onclick='myOPACChangePage("cresbookbag");'>My Reserves</a>
-
- </td>
-
- </tr>
- </tbody>
- </table>
-
- <br/>
-
- <div id='myopac_main_div'>
- <!--#include virtual="myopac/myopac_summary.xml"-->
- <!--#include virtual="myopac/myopac_checked.xml"-->
- <!--#include virtual="myopac/myopac_holds.xml"-->
- <!--#include virtual="myopac/myopac_fines.xml"-->
- <!--#include virtual="myopac/myopac_prefs.xml"-->
- <!--#include virtual="myopac/myopac_bookbags.xml"-->
- <!--#include virtual="myopac/myopac_cres.xml"-->
- </div>
-
-</div>
-
-
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_cn_details.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_cn_details.xml 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_cn_details.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,113 +0,0 @@
-<table class='hide_me'>
- <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/copy_details.js'></script>
- <script language='javascript' type='text/javascript' src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/Date.W3CDTF.js'></script>
- <tbody>
- <tr style='border: 3px solid #E0E0E0;' id='rdetail_volume_details_row' templateRow='1'>
- <td colspan='10'>
- <div style='text-align: center; margin-top: 6px; margin-bottom: 6px'>
-
- <a name='print' href='javascript:void(0);' class='classic_link'>&rdetail.print;</a>
- <table class='data_grid data_grid_center' style='width: 100%'>
- <thead>
- <tr>
- <td width='33%'>&rdetail.cn.barcode;</td>
- <td>&common.status;</td>
- <td>&rdetail.cn.location;</td>
- <td name='age_protect_label' class='hide_me'>&rdetail.cn.hold.age;</td>
- <td name='create_date_label' class='hide_me'>&rdetail.cn.genesis;</td>
- <td name='holdable_label' class='hide_me'>&rdetail.cn.holdable;</td>
- <td name='due_date_label' class='hide_me'>&rdetail.cn.due;</td>
- <td name='copy_cres_label' class='hide_me'>Reserves</td>
- </tr>
- </thead>
- <tbody name='copies_tbody' class='copy_details_table' width='100%'>
-
- <tr name='copies_row'>
-
- <td>
- <span name='barcode'> </span>
- <a class='hide_me classic_link copy_more_info' name='details_link'>&rdetail.cn.more;</a>
- <a class='hide_me classic_link copy_more_info' name='less_details_link'>&rdetail.cn.less;</a>
- <a class='hide_me classic_link copy_more_info' name='copy_hold_link'
- href='javascript:void(0);'>&rdetail.cn.hold;</a>
- <a class='hide_me classic_link copy_more_info' name='copy_reserve_link'
- href='javascript:void(0);'>&rdetail.cn.reserve;</a>
- </td>
-
- <td name='status'> </td>
- <td name='location'> </td>
- <td name='age_protect_value' class='hide_me'>&rdetail.cn.disabled;</td>
- <td name='create_date_value' class='hide_me'> </td>
-
- <td name='copy_holdable_td' class='hide_me'>
- <span name='copy_is_holdable'> </span>
- </td>
-
- <td name='copy_due_date_td' class='hide_me'>
- <span name='copy_due_date'> </span>
- </td>
-
- <td name='copy_cres_td' class='hide_me'>
- <span name='copy_cres'>
- <a name='copy_cres_link' class='hide_me classic_link copy_more_info'
- href='javascript:void(0);'>Add to reserve</a>
- </span>
- </td>
-
- </tr>
-
- <tr name='copy_extras_row' class='hide_me'>
- <td colspan='10'>
- <table width='100%' class='data_grid'>
- <tbody name='extras_tbody'>
- <tr name='extras_row' class='hide_me'>
- <td name='type' width='20%'>
- <span name='note' class='hide_me'><b>&rdetail.cn.note;</b></span>
- <span name='cat' class='hide_me'><b>&rdetail.cn.category;</b></span>
- </td>
- <td>
- <span name='key'> </span> : <span name='value'> </span>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
-
- </tbody>
- </table>
- </div>
- </td>
- </tr>
- </tbody>
-</table>
-
-<span class='hide_me' id='rdetail.yes'>&common.yes;</span>
-<span class='hide_me' id='rdetail.no'>&common.no;</span>
-
-
-<div id='rdetail_print_details' class='hide_me'>
- <div style='text-align: center; padding: 20px; width: 100%'>
- <div style='width:100%; border: 2px solid #E0F0E0; margin-bottom: 20px;'>
- <input type='submit' value='&rdetail.cn.print;' onclick='window.print();'> </input>
- </div>
- <div name='body'>
- <table>
- <tbody name='tbody'>
- <tr><td>&common.library;</td><td colspan='2' name='lib'></td></tr>
- <tr><td>&common.title;</td><td colspan='2' name='title'></td></tr>
- <tr><td>&common.author;</td><td colspan='2' name='author'></td></tr>
- <tr><td>&common.edition;</td><td colspan='2' name='edition'></td></tr>
- <tr><td>&common.pubdate;</td><td colspan='2' name='pubdate'></td></tr>
- <tr><td>&common.publisher;</td><td colspan='2' name='publisher'></td></tr>
- <tr><td>&common.physical;</td><td colspan='2' name='phys'></td></tr>
- <tr>
- <td colspan='3' style='background: #E0F0E0;'> </td>
- </tr>
- <tr name='cnrow'><td><b>&common.callnumber;</b></td><td><b colspan='2' name='cn'></b></td></tr>
- </tbody>
- </table>
- </div>
- </div>
-</div>
-
Deleted: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_extras.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_extras.xml 2011-04-19 20:20:12 UTC (rev 1400)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_extras.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -1,105 +0,0 @@
-
-<div xmlns:xi="http://www.w3.org/2001/XInclude">
-
- <table class='rdetails_extra_links'>
- <thead>
- <tr>
- <td id='rdetail_copy_info_link' class='rdetail_extras_td rdetail_extras_selected'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("copyinfo");'
- class='classic_link'>&rdetail.extras.summary;</a>
- </td>
-
- <td id='rdetail_viewcn_link' class='rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("cn");'
- class='classic_link'>&rdetail.extras.browser;</a>
- </td>
-
- <td id='rdetail_reviews_link' class='hide_me rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("reviews");'
- class='classic_link'>&rdetail.extras.reviews;</a>
- </td>
-
- <td id='rdetail_toc_link' class='hide_me rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("toc");'
- class='classic_link'>&rdetail.extras.toc;</a>
- </td>
-
- <td id='rdetail_excerpt_link' class='hide_me rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("excerpt");'
- class='classic_link'>&rdetail.extras.excerpt;</a>
- </td>
-
- <td id='rdetail_anotes_link' class='hide_me rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("anotes");'
- class='classic_link'>&rdetail.extras.author.notes;</a>
- </td>
-
-
- <td id='rdetail_annotation_link' class='hide_me rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("annotation");'
- class='classic_link'>&rdetail.extras.annotation;</a>
- </td>
-
- <td id='rdetail_viewmarc_link' class='rdetail_extras_td'
- style='padding-right: 15px; padding-left: 15px;' >
- <a href='javascript:rdetailShowExtra("marc");'
- class='classic_link'>&rdetail.extras.marc;</a>
- </td>
-
-
- </tr>
- </thead>
- </table>
-
- <div id='rdetail_extras_div' style='width: 95%;'>
- <div id='rdetail_extras_loading' class='hide_me'
- style='padding: 10px;'>&common.loading;</div>
- <!--#include virtual="rdetail_copyinfo.xml"-->
-
- <div id='rdetail_reviews_div' class='rdetail_extras_div hide_me'>
- <div id='rdetail_review_container'/>
- <!--
- <div id='rdetail_review_template' style='width: 100%;'>
- <div name='review_header' style='width: 100%; padding: 15px; border: 1px solid #E0E0E0;'> </div>
- <div name='review_text' style='width: 100%; padding: 15px; border: 1px solid #E0E0E0;'> </div>
- </div>
- -->
- </div>
-
- <div id='rdetail_toc_div' class='rdetail_extras_div hide_me'> </div>
-
- <div id='rdetail_excerpt_div' class='rdetail_extras_div hide_me'> </div>
-
- <div id='rdetail_anotes_div' class='rdetail_extras_div hide_me'> </div>
-
- <div id='rdetail_marc_div' class='rdetail_extras_div hide_me'>
- <div id='rdetail_view_marc_box'> </div>
- </div>
-
- <div id='rdetail_cn_browse_div' style='text-align: center;' class='hide_me'>
-
- <div id='cn_browse_none' class='hide_me color_4' style='width: 90%; text-align: center; margin: 10px;'>
- &rdetail.extras.call.null;
- </div>
-
- <div id='rdetail_cn_browse_select_div'
- style='width: 100%; border: 1px solid black; padding: 6px; margin-top: 5px;'>
- <span>&rdetail.extras.call.local; </span>
- <select id='cn_browse_selector'>
- </select>
- </div>
-
- <!--#include virtual="../common/cn_browse.xml"-->
- </div>
-
- <!--#include virtual="rdetail_cn_details.xml"-->
-
- </div>
-</div>
Copied: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_summary.xml (from rev 1399, conifer/branches/rel_2_0/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml)
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_summary.xml (rev 0)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/rdetail/rdetail_summary.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -0,0 +1,522 @@
+
+<abbr name="unapi" class="unapi-id" title='tag:<!--#echo var="HTTP_HOST"-->,<!--#echo var="OILS_TIME_YEAR"-->:biblio-record_entry/<!--#echo var="OILS_OPAC_RID"-->'></abbr>
+<!-- This holds the record summary information -->
+<div>
+ <!-- Hack to give IE somewhere to put these things; should just rip out from rdetail.js -->
+ <span class='hide_me' id='rdetail_title'></span>
+ <span class='hide_me' id='rdetail_isbn'></span>
+ <span class='hide_me' id='rdetail_publisher'></span>
+ <span class='hide_me' id='rdetail_abstract'></span>
+ <span class='hide_me' id='rdetail_edition'></span>
+ <table id='rdetail_details_table'>
+ <tbody id='rdetail_details_tbody'>
+
+ <tr>
+ <td id='rdetail_image_cell' rowspan='40'>
+ <a id='rdetail_img_link'>
+ <img style='border: none;' id='rdetail_image'
+ onerror='
+ hideMe($("rdetail.jacket_attrib_div"));
+ hideMe($("rdetail_img_link"));'/>
+ </a>
+ <!-- vendor attribution link -->
+ <div class='jacket_attrib hide_me' id='rdetail.jacket_attrib_div'>
+ <div>&opac.image_provided;</div>
+ <div><a target='_blank' href='&vendor.base_link;'
+ class='classic_link' id='rdetail.jacket_attrib_link'>&vendor.name;</a></div>
+ </div>
+ </td>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>
+ <td type='opac/slot-data' query='datafield[tag=245]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ var rdetail_bib_title = BT.textContent(item);
+ var title_node = dojo.query('head title');
+ dojo.addOnLoad(function() {dojo.place('<title>' + rdetail_bib_title + '</title>', title_node[0], 'replace');});
+ return '<span>' + rdetail_bib_title + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+
+ <tr class='hide_me' id='tag246'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.alternate.title;</td>
+ <td type='opac/slot-data' query='datafield[tag=246] subfield[code=a]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag246').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag247'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.former.title;</td>
+ <td type='opac/slot-data' query='datafield[tag="247"]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag247').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+
+ <tr class='hide_me'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.author;</td>
+ <td class='rdetail_item'>
+ <a title='&rdetail.author.search;' id='rdetail_author'> </a>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag100'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.author;</td>
+ <td type='opac/slot-data' query='datafield[tag=100]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag100').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag110'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.corporate.author;</td>
+ <td type='opac/slot-data' query='datafield[tag=110]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag110').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag111'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.meeting.name;</td>
+ <td type='opac/slot-data' query='datafield[tag=111]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag111').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag020'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.isbn;</td>
+ <td type='opac/slot-data' query='datafield[tag=020]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag020').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+
+ </tr>
+ <tr class='hide_me' id='tag022'>
+ <td nowrap='nowrap' class='rdetail_desc' id='issn_title'>&common.issn;</td>
+ <td type='opac/slot-data' query='datafield[tag=022]' class='rdetail_item' id='rdetail_issn'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag022').removeClass('hide_me');
+ var issn_raw = dojo.trim(BT.textContent(item));
+
+ // textContent returns multiple subfields concatenated with linefeeds,
+ // so our regex needs to match against linefeeds. "." does not match
+ // linefeeds, so get \s into the mix
+ var issn = issn_raw.replace(/^(\s|.)*?(\d{4}).(\d{3,4}[xX]?)(\s|.)*/, "$2-$3");
+
+ var ses = new OpenSRF.ClientSession('open-ils.resolver');
+ var req = ses.request('open-ils.resolver.resolve_holdings.raw', 'issn', issn, 'http://sfx.scholarsportal.info/algoma');
+ 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');
+ });
+ }
+ req.send();
+
+ return '<span>' + issn + '</span><br/>';
+ ]]></script>
+ </td>
+
+ </tr>
+
+ <tr class='hide_me' id='tag250'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.edition;</td>
+ <td type='opac/slot-data' query='datafield[tag=250]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag250').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+
+ <tr class='hide_me'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.pubdate;</td>
+ <td class='rdetail_item' id='rdetail_pubdate'> </td>
+ </tr>
+
+ <tr class='hide_me' id='tag260'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.publisher;</td>
+ <td type='opac/slot-data' query='datafield[tag=260]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag260').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.physical;</td>
+ <td class='rdetail_item' id='rdetail_physical_desc'> </td>
+ </tr>
+
+ <tr>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.format;</td>
+ <td class='rdetail_item'>
+ <img id='rdetail_tor_pic' class='tor_pic' />
+ <span id='rdetail_tor' style='padding-left: 5px;'> </span>
+ </td>
+ </tr>
+
+ <tr class='hide_me' id='tag520'>
+ <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.abstract;</td>
+ <td type='opac/slot-data' query='datafield[tag=520]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag520').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+
+ </tr>
+
+ <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
+ *** summary screen with complex information, such as new search links on subjects. -->
+ <tr class='hide_me' id='tag600'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.600;</td>
+ <td type='opac/slot-data' query='datafield[tag^=600]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag600', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag610'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.610;</td>
+ <td type='opac/slot-data' query='datafield[tag^=610]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag610', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag611'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.611;</td>
+ <td type='opac/slot-data' query='datafield[tag^=611]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag611', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag630'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.630;</td>
+ <td type='opac/slot-data' query='datafield[tag^=630]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag630', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag648'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.648;</td>
+ <td type='opac/slot-data' query='datafield[tag^=648]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag648', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag650'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subjects;</td>
+ <td type='opac/slot-data' query='datafield[tag^=650]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag650', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag651'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.651;</td>
+ <td type='opac/slot-data' query='datafield[tag^=651]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag651', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag653'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.653;</td>
+ <td type='opac/slot-data' query='datafield[tag^=653]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag653', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag654'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.654;</td>
+ <td type='opac/slot-data' query='datafield[tag^=654]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag654', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag655'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.655;</td>
+ <td type='opac/slot-data' query='datafield[tag^=655]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag655', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag656'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.656;</td>
+ <td type='opac/slot-data' query='datafield[tag^=656]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag656', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag657'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.657;</td>
+ <td type='opac/slot-data' query='datafield[tag^=657]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag657', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag658'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.658;</td>
+ <td type='opac/slot-data' query='datafield[tag^=658]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag658', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag662'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.662;</td>
+ <td type='opac/slot-data' query='datafield[tag^=662]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag662', item);
+ ]]></script>
+ </td>
+ </tr>
+
+ <tr class='hide_me' id='tag500'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.general.note;</td>
+ <td type='opac/slot-data' query='datafield[tag=500]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag500').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag505'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.contents.note;</td>
+ <td type='opac/slot-data' query='datafield[tag=505]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag505').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag506'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.usage.restrictions;</td>
+ <td type='opac/slot-data' query='datafield[tag=506] subfield[code=a]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag506').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span> ';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag511'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.performer.note;</td>
+ <td type='opac/slot-data' query='datafield[tag=511]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag511').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag700'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.additional.authors;</td>
+ <td type='opac/slot-data' query='datafield[tag=700]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag700').removeClass('hide_me');
+ var text = '';
+ var list = dojo.query( 'subfield:not([code=4])', item );
+ for (var i =0; i < list.length; i++) {
+ text += BT.textContent(list[i]) + ' ';
+ }
+ return '<span>' + text + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag780'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.preceding.entry;</td>
+ <td type='opac/slot-data' query='datafield[tag=780]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag780').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag785'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.succeeding.entry;</td>
+ <td type='opac/slot-data' query='datafield[tag=785]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag785').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='rdetail_online_row'>
+ <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
+ *** summary screen with complex information, such as location-specific URIs (856$9). -->
+ <td nowrap='nowrap' class='rdetail_desc'>&rdetail.summary.online;</td>
+ <td class='rdetail_item' id='rdetail_online' type='opac/slot-data' query='volumes volume uris uri'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('*:not([type^=opac])', 'rdetail_online').orphan();
+ var uri = new Object;
+ uri.href = item.getAttribute('href');
+ uri.label = item.getAttribute('label');
+ uri.use = item.getAttribute('use_restriction');
+ if (uri.href == uri.label) {
+ if (uri.use && uri.use != uri.label) {
+ uri.label = uri.use;
+ uri.use = null;
+ }
+ }
+ var link = '<a class="search_link" href="' + uri.href + '">' + uri.label + '</a>';
+ if (uri.use) {
+ link += ' (' + uri.use + ')';
+ }
+ return '<span>' + link + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+ <tr name="serial_holdings_label"
+ class="result_table_title_cell hide_me">
+ <td class="rdetail_desc">&rdetail.summary.issues_held;</td>
+ <td templated="true" type="opac/slot-data"
+ query="datafield[tag='901'] subfield[code='c']"
+ class="rdetail_item">
+ ${holdingsStatement}
+ <span class="hide_me" name="holdingsStatement" type="opac/template-value"><![CDATA[
+ if (fetchOrgSettingDefault(
+ getLocation(),
+ "opac.fully_compressed_serial_holdings"
+ )) {
+ var bibid = BT.textContent(item_list[0]);
+ var blob = fieldmapper.standardRequest(
+ ["open-ils.serial",
+ "open-ils.serial.bib.summary_statements"],
+ [bibid, {
+ "orgid": getLocation(), "depth": getDepth()
+ }]
+ );
+
+ var fake = dojo.create("td");
+ var something = false;
+
+ for (var i in blob) {
+ if (!blob[i].length) continue;
+ if (something) dojo.create("br", null, fake);
+ something = true;
+
+ var a = dojo.create(
+ "a", {
+ "innerHTML": "[+]",
+ "href": "javascript:void(0);",
+ "onclick":
+ "rdetailDrawExpandedHoldings(this,"+
+ bibid + ",'" + i + "');",
+ "style": {"marginRight": "1.5em"}
+ }, fake
+ );
+ dojo.create(
+ "span", {
+ "innerHTML": blob[i].join(", ")
+ }, fake
+ );
+ dojo.create(
+ "span", {"id": "holding_type_" + i}, fake
+ );
+ }
+
+ if (something)
+ unHideMe(slot.parentNode);
+
+ return fake.innerHTML;
+ } else {
+ return "";
+ }
+ ]]></span>
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <script language='javascript' type='text/javascript'><![CDATA[
+
+ config.ids.rdetail.details_body = 'rdetail_details_body';
+ config.ids.rdetail.title = 'rdetail_title';
+ config.ids.rdetail.author = 'rdetail_author';
+ config.ids.rdetail.isbn = 'rdetail_isbn';
+ config.ids.rdetail.edition = 'rdetail_edition';
+ config.ids.rdetail.pubdate = 'rdetail_pubdate';
+ config.ids.rdetail.publisher = 'rdetail_publisher';
+ config.ids.rdetail.tor = 'rdetail_tor';
+ config.ids.rdetail.abstr = 'rdetail_abstract';
+ config.ids.rdetail.image = 'rdetail_image';
+ config.ids.rdetail.tor_pic = 'rdetail_tor_pic';
+
+ /* Only clear the resources box once */
+ var first_issn = true;
+
+ function subjectMe(tag, item) {
+ dojo.query(tag).removeClass('hide_me');
+ var cgi = new CGI();
+ var other_params = [ 'd', 'l', 'r', 'av', 's', 'sd' ];
+ var total = '';
+ var output = [];
+ dojo.query( 'subfield:not([code=2])', item ).forEach( function (onesub) {
+ var subtext = '';
+ try {
+ if (dojo.isIE) {
+ subtext = onesub.firstChild.nodeValue;
+ } else {
+ subtext = onesub.textContent;
+ }
+ total += subtext + ' ';
+ } catch (e) {
+ return;
+ }
+ var current = '<a class="search_link" href="rresult.xml?rt=subject&tp=subject&t=' + total;
+ for (var p in other_params) {
+ if (cgi.param(other_params[p]))
+ current += '&' + other_params[p] + '=' + cgi.param(other_params[p]);
+ }
+ current += '">' + subtext + '</a>'
+ output.push(current);
+ });
+ return '<span>' + output.join(' -- ') + '</span><br/>';
+ }
+
+ dojo.addOnLoad( function () {
+ setTimeout( function () {
+ var here = findOrgUnit(getLocation());
+ if (getDepth() > 0 || getDepth === 0 ) {
+ while (getDepth() < findOrgDepth(here))
+ here = findOrgUnit( here.parent_ou() );
+ }
+
+ dojo.require('openils.BibTemplate');
+ new openils.BibTemplate({ record : new CGI().param('r'), org_unit : here.shortname() }).render();
+ }, 0);
+ });
+ ]]></script>
+
+</div> <!-- details_body -->
+
Copied: conifer/branches/rel_2_0/web/opac/skin/algoma/xml/result/result_table.xml (from rev 1399, conifer/branches/rel_2_0/web/opac/skin/lul/xml/result/result_table.xml)
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/algoma/xml/result/result_table.xml (rev 0)
+++ conifer/branches/rel_2_0/web/opac/skin/algoma/xml/result/result_table.xml 2011-04-19 20:32:38 UTC (rev 1401)
@@ -0,0 +1,415 @@
+<!-- Search results are spit into this table -->
+
+<div id='result_table_div' xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <table id='res_table'>
+
+ <!-- for some reason, this is the only way i can force the cell widths -->
+ <thead id='result_thead'>
+ <tr>
+ <td class='result_table_pic_header'></td>
+ <td> </td>
+ </tr>
+ </thead>
+
+ <tbody id='result_table'>
+ <tr>
+
+ <td class='result_table_row'>
+ <!--#include virtual="result_info.xml"-->
+ </td>
+ </tr>
+
+ <!-- Template for displaying a search result. This row template is cloned and inserted
+ for each result returned -->
+
+ <tr id='result_table_template' class='hide_me'>
+
+ <!-- Jacket image goes here -->
+
+ <td class='result_table_row' align='left'>
+ <table class='result_table_subtable'>
+ <tbody class='result_table_subtbody'>
+
+ <tr style='height: 1em' name='counts_row'>
+
+ <td rowspan='6' class='result_table_pic_header'>
+ <a><img name='item_jacket' class='result_table_pic'/></a>
+ </td>
+
+ <td class='result_table_title_cell' name='result_table_title_cell'>
+ <!-- Title goes here -->
+ <a title="&result.table.keyword;" name='item_title' class='search_link'>
+ <!-- Title goes here -->
+ </a>
+ </td>
+
+ <!-- Copy this td for each copy count appended -->
+ <td rowspan='5' nowrap='nowrap' name="copy_count_cell" class='copy_count_cell'>
+ </td>
+
+ </tr>
+
+ <tr style='height: 1em' >
+ <td class='result_table_author_cell'>
+ <a title="&result.table.author;" name='item_author' class='search_link'>
+ <!-- Author goes here -->
+ </a>
+ <div>
+ <span name='result_table_extra_span' class='hide_me'>
+ <span name='result_table_pub_box' style='padding-left: 10px;'>
+ <span name='result_table_edition_span' style='padding-left: 10px;'></span> |
+ <span name='result_table_pub_span'> </span> |
+ <span name='result_table_phys_span'> </span>
+ </span>
+ </span>
+ </div>
+ </td>
+ </tr>
+
+
+ <!--
+ there is probably a more elegant way to achieve this but what
+ happens here is that the record id is used to place resolver
+ info in the correct place in the results list - the id is
+ placed here from the js layer
+ -->
+ <tr id='result_table_recid' class='result_table_title_cell hide_me'>
+ <td class='sfx_display'>
+ <span name='result_table_recid_span' class='recid'>
+ <span name='recid_holder' class='hide_me'></span>
+ </span>
+ </td>
+ <td></td>
+ </tr>
+
+ <tr name="local_callnumber_list" class="result_table_title_cell">
+ <td>
+ <!--
+ we snag the record id from the 901 field, and then use it
+ for lining up the resolver content
+ -->
+ <span
+ type='opac/slot-data' query='datafield[tag="901"] subfield[code="c"]' class='hide_me'>
+ <span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
+ curr_title_id = dojo.trim(BT.textContent(item));
+ ]]></span>
+ </span>
+ <!--
+ this is very close to the layout in rdetail, we need to find the
+ record id in order to place the resolver info in the right spot
+ -->
+ <span
+ type='opac/slot-data' query='datafield[tag="022"] subfield' class='hide_me'>
+ <span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
+ var this_title_id = curr_title_id;
+ var issn = '';
+ issn = BT.textContent(item) + '';
+ issn = issn.replace(/^(\s|.)*?(\d{4}).(\d{3,4}[xX]?)(\s|.)*/, "$2-$3");
+ if (issn.length > 0) {
+ try {
+ var ses = new OpenSRF.ClientSession('open-ils.resolver');
+ var req = ses.request('open-ils.resolver.resolve_holdings.raw', 'issn', issn);
+ req.oncomplete = function(r) {
+ var resolverInfo = "";
+ dojo.forEach(r.recv().content(), function(entry) {
+ resolverInfo = entry.public_name + "_" + entry.target_coverage;
+ if (title_list.indexOf(this_title_id) == -1) {
+ url_list = "";
+ }
+ if (url_list.indexOf(resolverInfo) == -1) {
+ var resolverNode = null;
+ dojo.query('.recid').forEach(function(recinfo) {
+ if (parseFloat(dojo.trim(BT.textContent(recinfo))) == parseFloat(this_title_id)) {
+ resolverNode = recinfo;
+ }
+ });
+ url_list += resolverInfo;
+ var output = null;
+ if (resolverNode != null) {
+ var parent = resolverNode.parentNode;
+ if (parent) {
+ parent = parent.parentNode;
+ }
+ if (parent) {
+ dojo.removeClass(parent,'hide_me');
+ }
+ output = dojo.create('div',{"style":"background-color:#EEFFEE;"},resolverNode,"last");
+ dojo.addClass(output,"result_table_sfx_cell");
+ title_list += this_title_id;
+ var link = dojo.create('a', {"style": "margin-left: 1em;", "class":"search_link", "href": entry.target_url});
+ var link_text = dojo.doc.createTextNode( entry.public_name);
+ link.appendChild(link_text);
+ output.appendChild(link);
+ var coverage_text = dojo.doc.createTextNode(' - ' + entry.target_coverage
+ + (entry.target_embargo ? (' / ' + entry.target_embargo) : ''));
+ output.appendChild(coverage_text);
+ resolved[this_title_id] = true;
+ }
+ }
+ });
+ };
+ req.send();
+ } catch (err) { alert(err.message);}
+ }
+ ]]></span>
+ </span>
+ <!-- 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[
+ var output = dojo.create('span');
+
+ var item_cnt = 0;
+ var max_items = 4;
+
+
+ dojo.query('volume', item).forEach(function(vol) {
+ if (item_cnt >= max_items) {
+ return output.innerHTML;
+ }
+ dojo.query('copy', vol).forEach(function (cp) {
+ if (cp.getAttribute('deleted') == 't') {
+ return;
+ }
+ var cp_entry = dojo.create('div');
+ var loc_id;
+ var vol_appended = false;
+ dojo.query('location', cp).forEach(function (location) {
+ loc_id = parseInt(location.getAttribute('ident'));
+ if (loc_id != 8 && loc_id != 20 && loc_id != 185 && loc_id != 156) {
+ if (!vol_appended) {
+ var cn = dojo.create('span', { style: "font-weight: bold;" }, cp_entry);
+ var cn_txt = dojo.doc.createTextNode(vol.getAttribute('label'));
+ cn.appendChild(cn_txt);
+ vol_appended = true;
+ }
+ var loc = dojo.create('span', { "style": "font-weight: bold;"}, cp_entry);
+ var loc_txt = dojo.doc.createTextNode(' - ' + BT.textContent(location));
+ loc.appendChild(loc_txt);
+ }
+ });
+ if (loc_id == 8 || loc_id == 20 || loc_id == 185 || loc_id == 156) {
+ return;
+ }
+ dojo.query('circ_lib', cp).forEach(function (circ_lib) {
+ var cp_lib = dojo.create('span', { "style": "font-weight: bold;" }, cp_entry, "first");
+ var cp_lib_txt = dojo.doc.createTextNode(circ_lib.getAttribute('name') + ' - ');
+ cp_lib.appendChild(cp_lib_txt);
+ });
+ dojo.query('status', cp).forEach(function (status) {
+ var cp_status = dojo.create('span', { "style": "font-weight: bold;" }, cp_entry);
+ var cp_status_txt = dojo.doc.createTextNode(' (' + BT.textContent(status) + ')');
+ cp_status.appendChild(cp_status_txt);
+ });
+
+ item_cnt++;
+ if (item_cnt >= max_items) {
+ dojo.create('br', null, cp_entry);
+ cp_entry.appendChild(dojo.doc.createTextNode('... more print items listed in full record'));
+ }
+ output.appendChild(cp_entry);
+ });
+ });
+
+ return output.innerHTML;
+ ]]></span>
+ </span>
+
+ <!-- Be lenient in what we accept; disabled until we figure out how to prevent both URIs and SFX -->
+ <span type='opac/slot-data+marcxml-full' query='record'>
+ <span class='hide_me' type='opac/slot-format'><![CDATA[
+ var found_issn = false;
+ dojo.query('datafield[tag="022"]', item).forEach(function(issn) {
+ found_issn = true;
+ });
+ if (found_issn) { return; }
+
+ var output = dojo.create('span');
+ dojo.query('volumes volume uris uri', item).forEach(function(xitem) {
+ var this_title_id = curr_title_id;
+ if (resolved[this_title_id]) { return; }
+ var uri = new Object;
+ uri.href = xitem.getAttribute('href');
+ uri.label = xitem.getAttribute('label');
+ uri.use = xitem.getAttribute('use_restriction');
+ if (uri.href == uri.label) {
+ if (uri.use && uri.use != uri.label) {
+ uri.label = uri.use;
+ uri.use = null;
+ }
+ }
+ var link = dojo.create('a', {"class":"search_link", "href": uri.href});
+ var link_text = dojo.doc.createTextNode(uri.label);
+ link.appendChild(link_text);
+ output.appendChild(link);
+
+ if (uri.use) {
+ var use_text = dojo.doc.createTextNode(' (' + uri.use + ')');
+ output.appendChild(use_text);
+ }
+ dojo.create('br', null, output);
+ });
+ return output.innerHTML;
+ ]]></span>
+ </span>
+ </td>
+ </tr>
+
+ <tr style='height:1em;' >
+ <td name='result_table_format_cell' class='result_table_format_cell'>
+
+ <a name='text_link' class='search_link'>
+ <img src='../../../../images/tor/text.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='sound recording-nonmusical_link' class='search_link'>
+ <img src='../../../../images/tor/sound recording-nonmusical.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='moving image_link' class='search_link'>
+ <img src='../../../../images/tor/moving image.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='software, multimedia_link' class='search_link'>
+ <img src='../../../../images/tor/software, multimedia.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='sound recording-musical_link' class='search_link'>
+ <img src='../../../../images/tor/sound recording-musical.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='cartographic_link' class='search_link'>
+ <img src='../../../../images/tor/cartographic.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='mixed material_link' class='search_link'>
+ <img src='../../../../images/tor/mixed material.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='notated music_link' class='search_link'>
+ <img src='../../../../images/tor/notated music.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='sound recording_link' class='search_link'>
+ <img src='../../../../images/tor/sound recording.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='still image_link' class='search_link'>
+ <img src='../../../../images/tor/still images.jpg' class='dim tor_pic' />
+ </a>
+
+ <a name='three dimensional object_link' class='search_link'>
+ <img src='../../../../images/tor/three dimensional object.jpg' class='dim tor_pic' />
+ </a>
+
+ <span class='hide_me'
+ style='color: #9999FF; padding-left: 10px; font-size: 7pt; font-weight: 300;'>
+ <span>&common.relevancy; </span><span name='relevancy_span'> </span>
+ </span>
+
+ <span class='hide_me' name='place_hold_span'>
+ <a style='padding-left: 8px;' href='javascript:void(0);'
+ class='classic_link' name='place_hold_link'>&opac.holds.placeHold;</a>
+ </span>
+
+ <!-- Empty span used for creating unAPI links -->
+ <abbr style='padding-left: 8px;' name="unapi" class="unapi-id">
+ <!-- unAPI URI goes here -->
+ </abbr>
+
+ <!-- Empty span used for creating Google Book Search-->
+ <span name="googleBooksLink" class="hide_me">
+ <a style='padding-left: 8px;' class='classic_link' name="googleBooks-link">&result.googleBooks.browse;</a>
+ </span>
+
+
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+ <!-- ====================== -->
+ <table style='width: 100%; margin-top: 12px;' id='result_info_2' class='hide_me'>
+ <tbody>
+
+ <tr class='color_4' style='height: 1em;'>
+
+ <td style='vertical-align: top;' id='next_prev_links2'>
+
+ <span class='hide_me' id='result_info_div2' style='font-size: 9pt;'>
+ <span> &common.results; </span>
+ <b id='offset_start2'> </b>
+ <span> - </span>
+ <b id='offset_end2'> </b>
+ <span> &common.ofAtLeast; </span>
+ <b id='result_count2'> </b>
+ <span style='padding-left: 6px;'> (page </span>
+ <span id='current_page2'> </span>
+ <span> &common.of; </span>
+ <span id='num_pages2'> </span>
+ </span>
+
+ <span id='start_end_links_span2' class='hide_me'
+ 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>
+
+ <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>
+ <!--
+ <a class='search_page_nav_link'
+ id='end_link2' title="&rdetail.page.last;">&rdetail.end;</a>
+ -->
+ </span>
+
+ </td>
+
+ <td colspan='5'
+ style='padding-bottom: 4px; text-align:center; vertical-align: top; border-bottom: 1px solid #E0E0E0;'>
+ <!--
+ <span id='search_info_table2' style='font-size: 8pt;'>
+ <b>Available copies / Total copies </b>
+ </span>
+ -->
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- ====================== -->
+
+
+ <script language='javascript' type='text/javascript'>
+ config.names.result.format_cell = 'result_table_format_cell';
+ config.names.result.format_link = 'resource_link'
+ config.names.result.format_pic = 'format_pic'
+ var url_list = "";
+ var title_list = "";
+ var curr_title_id = "";
+ var resolved = {};
+ </script>
+
+ <!-- ChiliFresh setup -->
+ <script language='javascript' type='text/javascript'>
+ var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
+ if (chilifresh=='(none)') { chilifresh = false; }
+ </script>
+ <!--if expr="${OILS_CHILIFRESH_ACCOUNT} && ${OILS_CHILIFRESH_ACCOUNT}!='(none)'"-->
+ <input type="hidden" id="chilifresh_account" name="chilifresh_account"
+ value="<!--#echo var='OILS_CHILIFRESH_ACCOUNT'-->" />
+ <input type="hidden" id="chilifresh_profile" name="chilifresh_profile"
+ value="<!--#echo var='OILS_CHILIFRESH_PROFILE'-->" />
+ <input type="hidden" id="chilifresh_version" name="chilifresh_version" value="onsite_v1" />
+ <input type="hidden" id="chilifresh_type" name="chilifresh_type" value="search" />
+ <script language="javascript" type="text/javascript" src="<!--#echo var='OILS_CHILIFRESH_URL'-->"></script>
+ <!--endif-->
+
+</div>
+
More information about the open-ils-commits
mailing list