From bc9291926a9bb8c430653417300954449fbea31a Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Fri, 13 Apr 2012 11:30:37 -0400 Subject: [PATCH] Forking tadlv2 to tadlv3 skin Breaking ground on tadlv3 skin, starting with what is currently the tadlv2 skin. Signed-off-by: Jeff Godin --- Open-ILS/web/opac/skin/tadlv3/css/tadl_colors.css | 117 ++ Open-ILS/web/opac/skin/tadlv3/css/tadl_layout.css | 35 + Open-ILS/web/opac/skin/tadlv3/js/grpl_utils.js | 24 + Open-ILS/web/opac/skin/tadlv3/js/myopac.js | 1710 ++++++++++++++++++++ Open-ILS/web/opac/skin/tadlv3/js/rdetail.js | 1421 ++++++++++++++++ Open-ILS/web/opac/skin/tadlv3/js/result_common.js | 880 ++++++++++ Open-ILS/web/opac/skin/tadlv3/js/rresult.js | 363 +++++ .../skin/tadlv3/xml/advanced/adv_global_row.xml | 36 + .../skin/tadlv3/xml/advanced/advanced_global.xml | 309 ++++ .../skin/tadlv3/xml/advanced/advanced_marc.xml | 46 + .../skin/tadlv3/xml/advanced/advanced_quick.xml | 30 + Open-ILS/web/opac/skin/tadlv3/xml/body.xml | 42 + .../web/opac/skin/tadlv3/xml/common/altcanvas.xml | 37 + .../web/opac/skin/tadlv3/xml/common/cn_browse.xml | 34 + .../web/opac/skin/tadlv3/xml/common/css_common.xml | 25 + Open-ILS/web/opac/skin/tadlv3/xml/common/fonts.xml | 25 + .../skin/tadlv3/xml/common/format_selector.xml | 11 + Open-ILS/web/opac/skin/tadlv3/xml/common/holds.xml | 251 +++ .../web/opac/skin/tadlv3/xml/common/ilsevents.xml | 14 + .../web/opac/skin/tadlv3/xml/common/js_common.xml | 76 + .../web/opac/skin/tadlv3/xml/common/libselect.xml | 15 + Open-ILS/web/opac/skin/tadlv3/xml/common/login.xml | 115 ++ Open-ILS/web/opac/skin/tadlv3/xml/common/logo.xml | 4 + .../web/opac/skin/tadlv3/xml/common/orgtree.xml | 27 + .../web/opac/skin/tadlv3/xml/common/searchbar.xml | 96 ++ .../web/opac/skin/tadlv3/xml/common/sidebar.xml | 178 ++ .../web/opac/skin/tadlv3/xml/common/statusbar.xml | 28 + .../skin/tadlv3/xml/common/stypes_selector.xml | 8 + Open-ILS/web/opac/skin/tadlv3/xml/common/tips.xml | 8 + Open-ILS/web/opac/skin/tadlv3/xml/footer.xml | 16 + Open-ILS/web/opac/skin/tadlv3/xml/header.xml | 15 + .../web/opac/skin/tadlv3/xml/home/homesearch.xml | 135 ++ .../web/opac/skin/tadlv3/xml/home/index_body.xml | 49 + Open-ILS/web/opac/skin/tadlv3/xml/html_xsl.xml | 10 + Open-ILS/web/opac/skin/tadlv3/xml/index.xml | 21 + .../skin/tadlv3/xml/myopac/myopac_bookbags.xml | 136 ++ .../opac/skin/tadlv3/xml/myopac/myopac_checked.xml | 107 ++ .../opac/skin/tadlv3/xml/myopac/myopac_fines.xml | 106 ++ .../opac/skin/tadlv3/xml/myopac/myopac_holds.xml | 123 ++ .../opac/skin/tadlv3/xml/myopac/myopac_prefs.xml | 105 ++ .../opac/skin/tadlv3/xml/myopac/myopac_summary.xml | 311 ++++ .../web/opac/skin/tadlv3/xml/page_advanced.xml | 14 + .../web/opac/skin/tadlv3/xml/page_cnbrowse.xml | 6 + Open-ILS/web/opac/skin/tadlv3/xml/page_mresult.xml | 9 + Open-ILS/web/opac/skin/tadlv3/xml/page_myopac.xml | 67 + Open-ILS/web/opac/skin/tadlv3/xml/page_rdetail.xml | 94 ++ Open-ILS/web/opac/skin/tadlv3/xml/page_rresult.xml | 9 + .../skin/tadlv3/xml/rdetail/rdetail_altcanvas.xml | 28 + .../skin/tadlv3/xml/rdetail/rdetail_cn_details.xml | 109 ++ .../skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml | 89 + .../skin/tadlv3/xml/rdetail/rdetail_extras.xml | 184 +++ .../skin/tadlv3/xml/rdetail/rdetail_summary.xml | 245 +++ .../web/opac/skin/tadlv3/xml/result/filtersort.xml | 20 + .../opac/skin/tadlv3/xml/result/result_common.xml | 36 + .../opac/skin/tadlv3/xml/result/result_info.xml | 74 + .../opac/skin/tadlv3/xml/result/result_lowhits.xml | 49 + .../opac/skin/tadlv3/xml/result/result_table.xml | 336 ++++ Open-ILS/web/opac/skin/tadlv3/xml/setenv.xml | 74 + 58 files changed, 8542 insertions(+) create mode 100644 Open-ILS/web/opac/skin/tadlv3/css/tadl_colors.css create mode 100644 Open-ILS/web/opac/skin/tadlv3/css/tadl_layout.css create mode 100644 Open-ILS/web/opac/skin/tadlv3/js/grpl_utils.js create mode 100644 Open-ILS/web/opac/skin/tadlv3/js/myopac.js create mode 100644 Open-ILS/web/opac/skin/tadlv3/js/rdetail.js create mode 100644 Open-ILS/web/opac/skin/tadlv3/js/result_common.js create mode 100644 Open-ILS/web/opac/skin/tadlv3/js/rresult.js create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/advanced/adv_global_row.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_global.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_marc.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_quick.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/body.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/altcanvas.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/cn_browse.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/css_common.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/fonts.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/format_selector.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/holds.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/ilsevents.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/js_common.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/libselect.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/login.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/logo.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/orgtree.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/searchbar.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/sidebar.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/statusbar.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/stypes_selector.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/common/tips.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/footer.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/header.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/home/homesearch.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/home/index_body.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/html_xsl.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/index.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_bookbags.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_checked.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_fines.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_holds.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_prefs.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_summary.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/page_advanced.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/page_cnbrowse.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/page_mresult.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/page_myopac.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/page_rdetail.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/page_rresult.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_altcanvas.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_cn_details.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_summary.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/result/filtersort.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/result/result_common.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/result/result_info.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/result/result_lowhits.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/result/result_table.xml create mode 100644 Open-ILS/web/opac/skin/tadlv3/xml/setenv.xml diff --git a/Open-ILS/web/opac/skin/tadlv3/css/tadl_colors.css b/Open-ILS/web/opac/skin/tadlv3/css/tadl_colors.css new file mode 100644 index 0000000000..2728b4a034 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/css/tadl_colors.css @@ -0,0 +1,117 @@ +body a { color: black; text-decoration: none;} +body a:visited { color: black; text-decoration: none;} +body a:hover { color: #7d0049; text-decoration: underline;} + + +/* the idea is to have 4 complimentary colors that + * are used throughout the opac. Edit those colors + * in this file + */ + +.color_1 { background: #acc4de; color: #000000; } +.color_2 { background: #acc4de; color: #000000; } +.color_3 { background: #d1e1a2; color: #000000; } +.color_4 { background: #d1e1a2; color: #000000; } + +.border_1 { border: 1px solid #6699cc; } +.border_2 { border: 1px solid #6699cc; } +.border_3 { border: 1px solid #ddeeff; } +.border_4 { border: 1px solid #ddeeff; } + +.border_1_2 { border: 2px solid #6699cc; } +.border_2_2 { border: 2px solid #6699cc; } +.border_3_2 { border: 2px solid #ddeeff; } +.border_4_2 { border: 2px solid #ddeeff; } + +.border_1_3 { border: 3px solid #6699cc; } +.border_2_3 { border: 3px solid #6699cc; } +.border_3_3 { border: 3px solid #ddeeff; } +.border_4_3 { border: 3px solid #ddeeff; } + + +/* some facet styling */ +.facetClassContainer { margin: 2px; border: 1px solid #6699cc; } +.facetClassLabelContainer { background: #acc4de; border: 1px solid #acc4de; } +.facetClassLabel { font-weight: bold; text-align: center; } +.facetFieldContainer { background: #d1e1a2; } +.facetFieldLabel { padding-left: 2px; margin-top: 5px; margin-bottom: 5px; font-weight: bold; text-align: left; } +.extraFacetFieldsWrapper { } +.toggleExtraFacetFieldsButton { float: right; margin: 0px; padding: 0px; } +.facetFieldLineCount { display: inline-block; border-right: 1px solid #acc4de; color: gray; width: 3em; margin-right: 3px } +.facetField { border-top: 1px solid #acc4de; } +.facetFields { padding-left: 5px; } +.facetFieldLineValue { overflow: hidden; text-overflow: ellipsis; } + + + + +/* general purpose light borders */ +.border_5 { border: 1px solid #D0D0D0; } +.border_6 { border: 1px solid #808080; } + +input:focus { background: #e5f1fd; color: #000000;} +a:focus { background: #e5f1fd; color: #000000;} + + +/* ---------------------------------------------------------------------- */ + +.canvas { /* main content div for each page */ + border-left: 3px solid #7fa2ca; + border-bottom: 3px solid #7fa2ca; + border-top: 3px solid #7fa2ca; +} + +/* border around home search box */ +.home_search { border: 3px solid #7fa2ca; } + +/* main nav sidebar */ +.sidebar_item_active { background: #acc4de; } + +/* record detail summary block */ +.rdetail_desc { border: 1px solid #6699cc; } +.rdetail_item { border: 1px solid #6699cc; } +.rdetail_extras_selected { background: #d1e1a2;} + + +.data_grid thead tr { background: #acc4de; color: #000000; } +.data_grid thead td { border: 1px solid #808080; } +.data_grid tbody td { border: 1px solid #6699cc; } +.data_grid_nb thead tr { background: #6699cc; color: #000000; } +.data_grid_nb thead td { border: none; } +.data_grid_nb tbody td { border: none; } + +.light_border { border: 1px solid #99ccff; } + +.adv_quick_search_submit { border-bottom: 3px solid #99ccff;} + +.myopac_link_active { background: #ddeeff; } + +.sidebar_extra_link { text-decoration: none; } +#searchbar_tag_on { color: red; } +.searchbar_item { color: black; } +#login_box { border-top: 1px solid #7fa2ca; border-bottom: 1px solid #7fa2ca; } +#next_prev_links_dead { color: #808080; text-decoration: none; } + +.nav_link_active {font-weight: bold;} + +.search_link { text-decoration: none; color: #0e63ba;} +.result_table_subtable { border-top: 1px solid #Eeffff; } + +.copy_count_cell { border-right: 1px solid #E0E0E0; } +.copy_count_div { border-left: 2px solid #99ccff; border-right: 2px solid #99ccff; } + +#rdetail_image_cell { border: 1px solid white; border-right: 1px solid #99ccff;} + +/* For slimpac */ +.maintable { border-collapse: collapse; border: 3px solid #6699cc; -moz-border-radius: 6px; padding: 6px; margin-top: 65px; } +.greenrow { border: 1px solid #D0D0D0; background: #ddeeff; } +.bluerow { border: 1px solid #D0D0D0; background: #6699cc; } +.rowpad { height: 20px; } + +.footer_link { margin-left: 10px; margin-right: 10px; } + +.indent0 { padding-left: 0px; } +.indent1 { padding-left: 10px; } +.indent2 { padding-left: 20px; } + + diff --git a/Open-ILS/web/opac/skin/tadlv3/css/tadl_layout.css b/Open-ILS/web/opac/skin/tadlv3/css/tadl_layout.css new file mode 100644 index 0000000000..b06bb6f385 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/css/tadl_layout.css @@ -0,0 +1,35 @@ +/* make images in search results larger */ +.result_table_pic_cell { width: 103px; } +.result_table_pic { height: 100px; width: 80px; } +.result_table_pic_header { width: 103px; } + + +/* Make titles in search results larger */ +.result_table_title_cell { padding-top: 10px; } +a[name="item_title"] { font-size: 1.5em; } +.result_table_format_cell { padding-top: 10px; } + +/* Make titles in record details larger */ +#rdetail_details_tbody tr:first-child td.rdetail_item { font-size: 1.5em; padding-top: 5px; } + +/* Make sidebar links larger */ +.side_bar_item { font-size: 1.25em; } + +/* Shrink the search box a bit -- mostly to prevent the Go button from ending up + beneath the search box in Chrome */ +#search_box { width: 190px; } + +/* Make a less colorful front / home page */ +#frontsearch_table tbody tr { background-color: white; border: none; } +#frontsearch_table tbody tr td { background-color: white; border: none; } + +/* Inspired by GRPL class "hold_button" */ +.css_button { + background-color: lightgray; + border: 2px outset; + height: 15px; + padding: 6px 8px 2px; + margin-bottom: 4px; + text-decoration: none; + display: inline-block; +} diff --git a/Open-ILS/web/opac/skin/tadlv3/js/grpl_utils.js b/Open-ILS/web/opac/skin/tadlv3/js/grpl_utils.js new file mode 100644 index 0000000000..70dad80047 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/js/grpl_utils.js @@ -0,0 +1,24 @@ +function getHoldCount(id){ + var holdCount = null; + var result = null; + + if (window.XMLHttpRequest) { + // Code for all new browsers + holdCount = new XMLHttpRequest(); + } else if ( window.ActiveXObject ) { + // Code for IE 5 and 6 + holdCount = new ActiveXObject( "Microsoft.XMLHTTP" ); + } + + holdCount.open( "GET", "/cgi-bin/utils/public/hold_count_tadl.cgi?id=" + id, false ) + holdCount.onreadystatechange = function() { + if (holdCount.readyState == 4) { + result = holdCount.responseText; + } + } + holdCount.send(null); + + if (holdCount.responseText) + return holdCount.responseText; + +} diff --git a/Open-ILS/web/opac/skin/tadlv3/js/myopac.js b/Open-ILS/web/opac/skin/tadlv3/js/myopac.js new file mode 100644 index 0000000000..40ea2ff601 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/js/myopac.js @@ -0,0 +1,1710 @@ + +attachEvt("common", "run", myOPACInit ); +//attachEvt("common", "loggedIn", myOPACInit ); +attachEvt('common','locationUpdated', myopacReload ); + +dojo.requireLocalization("openils.opac", "opac"); + +var opac_strings = dojo.i18n.getLocalization("openils.opac", "opac"); +var fleshedUser = null; +var fleshedContainers = {}; +var holdCache = {}; +var holdStatusCache = {}; +var showHoldQueuePosition = false; +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() { + + fieldmapper.IDL.load(['mous']); + + var orgHiding = checkOrgHiding(); + if (orgHiding) { + hideMe($('prefs_def_location_row')); + hideMe($('prefs_def_range_row')); + } + + 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 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 cls = "myopac_link"; + var acls = "myopac_link_active"; + + hideMe(ss); + hideMe(cc); hideMe(ff); + hideMe(hh); hideMe(pp); + hideMe(bb); + + removeCSSClass(s, acls ); + removeCSSClass(c, acls ); + removeCSSClass(f, acls ); + removeCSSClass(h, acls ); + removeCSSClass(p, acls ); + removeCSSClass(b, 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; + } +} + +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; + + /* Draw pre-cataloged items */ + if(!record || checkILSEvent(record) || !(record.title() || record.author())) { + var req = new Request( FETCH_COPY, r.copy ); + req.request.circ = circid; + req.callback(myOPACDrawPreCatalogedItem); + 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 myOPACDrawPreCatalogedItem(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) { + // wait is currently returned in seconds, but displayed in days + var wait = Math.ceil(qstats.estimated_wait / 86400); + $n(row, 'myopac_holds_estimated_wait').appendChild(text(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 (showHoldQueuePosition) { + var node = $n(row, 'hold_qstats'); + if (qstats.potential_copies == 1) { + node.appendChild(text(dojo.string.substitute(opac_strings.HOLD_STATUS_SINGULAR, [qstats.queue_position, qstats.total_holds, qstats.potential_copies]))); + } else { + node.appendChild(text(dojo.string.substitute(opac_strings.HOLD_STATUS_PLURAL, [qstats.queue_position, qstats.total_holds, qstats.potential_copies]))); + } + 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(hold.hold_type() == 'P') { + unHideMe($n(row, 'vol_copy')); + $n(row, 'part').appendChild(text(holdObjects.partObject.label)); + } + + 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(); + $('myopac_fines_pay_ses').value = G.user.session; +} + +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 dojo.date.locale.format(d, {"formatLength": "medium"}); +} + +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 dojo.date.locale.format(d, { "timePattern" : "h:ma", "formatLength" : "medium" }); +} + +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'), dojo.date.locale.format(expireDate, { "formatLength" : "medium", "selector" : "date" })); + 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(!isTrue(addr.valid())) + unHideMe($n(row, 'myopac_invalid_addr_row')); + + 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; + var curpassword = $('myopac_username_current_password').value; + if(username == null || username == "") { + alert($('myopac_username_error').innerHTML); + return; + } + + if( username.match(/.*\s.*/) ) { + alert($('myopac_invalid_username').innerHTML); + return; + } + + r = fetchOrgSettingDefault(getLocation(), '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, curpassword ); + 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; + var curpassword = $('myopac_email_current_password').value; + if(email == null || email == "") { + alert($('myopac_email_error').innerHTML); + return; + } + + var req = new Request(UPDATE_EMAIL, G.user.session, email, curpassword ); + 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())); + + appendClear( + $n(row, 'circ_time'), + text(dojo.date.locale.format( + dojo.date.stamp.fromISOString(circ.duedate()), + {format : 'short'} + )) + ); +} + + + + +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(), /* Patron via OPAC */ 6); + 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(); + } +} + diff --git a/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js b/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js new file mode 100644 index 0000000000..beb53218ed --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js @@ -0,0 +1,1421 @@ + +/* */ + +detachAllEvt('common', 'run'); +attachEvt("common", "run", rdetailDraw); +attachEvt("rdetail", "recordDrawn", rdetailBuildStatusColumns); +attachEvt("rdetail", "recordDrawn", rdetailBuildInfoRows); +attachEvt("rdetail", "recordDrawn", rdetailGetPageIds); + +/* Per-skin configuration settings */ +var rdetailLocalOnly = true; +var rdetailShowLocal = true; +var rdetailShowCopyLocation = true; +var rdetailGoogleBookPreview = false; +var rdetailDisplaySerialHoldings = true; +var rdetailEnableRefWorks = false; +var rdetailRefWorksHost = 'http://www.refworks.com'; + +/* vars vars vars */ +var record = null; +var cp_statuses = null; +var recordsCache = []; + +var copyRowParent = null; +var copyRow = null; +var statusRow = null; +var numStatuses = null; +var defaultCN; +var callnumberCache = {}; +var globalCNCache = {}; +var localTOC; +var cachedRecords; +var _statusPositions = {}; +var opac_strings; + +var nextContainerIndex; + +var nextRecord; +var prevRecord; + +var rdetailPrev = null; +var rdetailNext = null; +var rdetailStart = null; +var rdetailEnd = null; + +var mfhdDetails = []; +var orgHiding = false; + +if(location.href.match(/&place_hold=1/)) { + // prevent load flicker between canvases + hideMe(dojo.byId('canvas_main')); +} + +dojo.require("dijit.Dialog"); +dojo.require("dijit.form.TextBox"); + +/* serials are currently the only use of Dojo strings in the OPAC */ +if (rdetailDisplaySerialHoldings) { + dojo.require("dijit.Menu"); + dojo.require("dijit.form.Button"); + dojo.requireLocalization("openils.opac", "opac"); + opac_strings = dojo.i18n.getLocalization("openils.opac", "opac"); +} + +function rdetailReload() { + var args = {}; + args[PARAM_LOCATION] = getNewSearchLocation(); + args[PARAM_DEPTH] = depthSelGetDepth(); + goTo(buildOPACLink(args)); +} + +/* looks to see if we have a next and/or previous record in the + record cache, if so, set up the nav links */ +function rdetailSetPaging(ids) { + + cachedRecords = {}; + cachedRecords.ids = ids; + + for( var i = 0; i < cachedRecords.ids.length; i++ ) { + var rec = cachedRecords.ids[i]; + if( rec == getRid() ) { + if( i > 0 ) prevRecord = cachedRecords.ids[i-1]; + if( i < cachedRecords.ids.length - 1 ) + nextRecord = cachedRecords.ids[i+1]; + break; + } + } + + $('np_offset').appendChild(text(i + 1)); + $('np_count').appendChild(text(getHitCount())); + + if(prevRecord) { + unHideMe($('np_table')); + unHideMe($('np_prev')); + unHideMe($('np_start')); + rdetailPrev = function() { _rdetailNav(prevRecord); }; + rdetailStart = function() { _rdetailNav(cachedRecords.ids[0]); }; + } + + if(nextRecord) { + unHideMe($('np_table')); + unHideMe($('np_next')); + unHideMe($('np_end')); + rdetailNext = function() { _rdetailNav(nextRecord); }; + rdetailEnd = function() { _rdetailNav(cachedRecords.ids[cachedRecords.ids.length-1]); }; + } + + runEvt('rdetail', 'nextPrevDrawn', i, cachedRecords.ids.length); +} + + +function _rdetailNav(id, offset) { + var args = {}; + args[PARAM_RID] = id; + goTo(buildOPACLink(args)); +} + +function rdetailHandlePlaceHold() { + function reload() { + location.href = location.href.replace(/&place_hold=1/, ''); + } + attachEvt("common", "holdUpdated", reload); + attachEvt("common", "holdUpdateCanceled", reload); + attachEvt("common", "loginCanceled", reload); + holdsDrawEditor({record:getRid(), type: 'T'}); +} + +function rdetailDraw() { + + if(new CGI().param('place_hold')) { + rdetailHandlePlaceHold(); + return; + } + + detachAllEvt('common','depthChanged'); + detachAllEvt('common','locationUpdated'); + attachEvt('common','depthChanged', rdetailReload); + attachEvt('common','locationUpdated', rdetailReload); + attachEvt('common','holdUpdated', rdetailReload); + attachEvt('common','holdUpdateCanceled', rdetailReload); + + copyRowParent = G.ui.rdetail.cp_info_row.parentNode; + copyRow = copyRowParent.removeChild(G.ui.rdetail.cp_info_row); + statusRow = G.ui.rdetail.cp_status.parentNode; + statusRow.id = '__rdsrow'; + + G.ui.rdetail.cp_info_local.onclick = rdetailShowLocalCopies; + G.ui.rdetail.cp_info_all.onclick = rdetailShowAllCopies; + + if(getLocation() == globalOrgTree.id()) + hideMe(G.ui.rdetail.cp_info_all); + + if(getRid()) { + + var req = new Request(FETCH_RMODS, getRid()); + req.callback(_rdetailDraw); + req.send(); + + } else { // No record ID was specified + + // If we have an ISBN in the URL, let's try to find that record + // This allows direct linking by ISBN. + // Note, this uses the first record it finds + if(getRtype() == RTYPE_ISBN) { + var req = new Request(FETCH_ADV_ISBN_RIDS, getAdvTerm() ); + req.callback( + function(r) { + var blob = r.getResultObject(); + if(blob && blob.count > 0) + RID = blob.ids[0]; + var req2 = new Request(FETCH_RMODS, getRid()); + req2.callback(_rdetailDraw); + req2.send(); + } + ); + req.send(); + } + } + + + if (rdetailDisplaySerialHoldings && ( + isXUL() || !fetchOrgSettingDefault( + getLocation(), "opac.fully_compressed_serial_holdings") + ) + ) { + var req = new Request(FETCH_MFHD_SUMMARY, getRid()); + req.callback(_holdingsDraw); + req.send(); + if (isXUL()) { + var here = findOrgUnit(getLocation()); + dojo.place("
", "rdetail_details_table", "after"); + var mfhd_add = new dijit.Menu({style:"float: right;"}); + new dijit.MenuItem({onClick:function(){ + var req = new Request(CREATE_MFHD_RECORD, G.user.session, 1, here.id(), getRid()); + var res = req.send(); + alert(dojo.string.substitute(opac_strings.CREATED_MFHD_RECORD, [here.name()])); + }, label:opac_strings.CREATE_MFHD}).placeAt(mfhd_add); + mfhd_add.placeAt(mfhd_ad_menu); + } + } + + detachAllEvt("result", "idsReceived"); + G.evt.result.hitCountReceived = []; + G.evt.result.recordReceived = []; + G.evt.result.copyCountsReceived = []; + G.evt.result.allRecordsReceived = []; + + if(isXUL()) + unHideMe($('rdetail_show_orders')); +} + +function rdetailGetPageIds() { + attachEvt("result", "idsReceived", rdetailSetPaging ); + resultFetchAllRecords = true; + rresultCollectIds(true); +} + + +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 rdetailViewMarc(r,id) { + hideMe($('rdetail_extras_loading')); + $('rdetail_view_marc_box').innerHTML = r.getResultObject(); + + var div = elem('div', { "class" : 'hide_me' }); + var span = div.appendChild( elem('abbr') ); + + buildunAPISpan( span, 'biblio-record_entry', record.doc_id() ); + + $('rdetail_view_marc_box').insertBefore(span, $('rdetail_view_marc_box').firstChild); +} + +function rdetailForeignItems(r,id) { + hideMe($('rdetail_extras_loading')); + var tbody = $('rdetail_foreign_items_tbody'); + + var robj = r.getResultObject(); /* mvr list with foreign_copy_maps fleshed */ + + for (var i = 0; i < robj.length; i++) { + var args = {}; + args.page = RDETAIL; + args[PARAM_OFFSET] = 0; + args[PARAM_RID] = robj[i].doc_id(); + var row = elem('tr'); tbody.appendChild(row); + var td1 = elem('td'); row.appendChild(td1); + var title = elem( + 'a', + { + 'href' : buildOPACLink(args), + 'class' : 'classic_link' + }, + robj[i].title() + ); + td1.appendChild(title); + var td2 = elem('td',{},robj[i].author()); row.appendChild(td2); + var td3 = elem('td'); row.appendChild(td3); + var details = elem( + 'a', + { + 'href' : 'javascript:void(0)', + 'class' : 'classic_link' + }, + 'Copy Details' + ); + details.onclick = function(idx,context_row){ + return function() { + cpdBuild( + tbody, + context_row, + robj[idx], + null, + 1, + 0, + 1, + dojo.map( + robj[idx].foreign_copy_maps(), + function(x){ return x.target_copy(); } + ), + dojo.map( + robj[idx].foreign_copy_maps(), + function(x){ return x.peer_type().name(); } + ) + ); + }; + }(i,row); + td3.appendChild(details); + } +} + + + +function rdetailShowLocalCopies() { + rdetailShowLocal = true; + rdetailBuildInfoRows(); + hideMe(G.ui.rdetail.cp_info_local); + unHideMe(G.ui.rdetail.cp_info_all); + hideMe(G.ui.rdetail.cp_info_none); +} + +function rdetailShowAllCopies() { + + rdetailShowLocal = false; + rdetailBuildInfoRows(); + hideMe(G.ui.rdetail.cp_info_all); + unHideMe(G.ui.rdetail.cp_info_local); + hideMe(G.ui.rdetail.cp_info_none); +} + +function OpenMarcEditWindow(pcrud, rec) { + /* + To run in Firefox directly, must set signed.applets.codebase_principal_support + to true in about:config + */ + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + win = window.open('/xul/server/cat/marcedit.xul'); // XXX version? + dojo.require('openils.PermaCrud'); + + win.xulG = { + "record": {"marc": rec.marc(), "rtype": "sre"}, + "save": { + "label": opac_strings.SAVE_MFHD_LABEL, + "func": function(xmlString) { + rec.marc(xmlString); + rec.edit_date('now'); + rec.ischanged(true); + pcrud.update(rec); + } + }, + 'lock_tab' : typeof xulG != 'undefined' ? (typeof xulG['lock_tab'] != 'undefined' ? xulG.lock_tab : undefined) : undefined, + 'unlock_tab' : typeof xulG != 'undefined' ? (typeof xulG['unlock_tab'] != 'undefined' ? xulG.unlock_tab : undefined) : undefined + }; +} + +function loadMarcEditor(recId) { + var pcrud = new openils.PermaCrud({"authtoken": G.user.session}); + var rec = pcrud.retrieve("sre", recId); + if (rec) { + OpenMarcEditWindow(pcrud, rec); + } +} + +/* + * This function could be written much more intelligently + * Limited brain power means that I'm brute-forcing it for now + */ +function _holdingsDraw(h) { + holdings = h.getResultObject(); + + if (holdings) { + // Only draw holdings within our OU scope + var here = findOrgUnit(getLocation()); + var entryNum = 0; + var depth = getDepth(); + dojo.forEach(holdings, function (item) { + if (orgIsMine(here, findOrgUnit(item.owning_lib()), depth)) { + _holdingsDrawMFHD(item, entryNum); + entryNum++; + } + }); + } + + // Populate (or unpopulate) XUL menus + if (isXUL()) { + runEvt('rdetail','MFHDDrawn'); + } +} + +function _holdingsDrawMFHD(holdings, entryNum) { + var hb = holdings.basic_holdings(); + var hba = holdings.basic_holdings_add(); + var hs = holdings.supplement_holdings(); + var hsa = holdings.supplement_holdings_add(); + var hi = holdings.index_holdings(); + var hia = holdings.index_holdings_add(); + var ho = holdings.online(); + var hm = holdings.missing(); + var hinc = holdings.incomplete(); + var hloc = holdings.location() || 'MFHD'; + + if ( hb.length == 0 && hba.length == 0 && hs.length == 0 && + hsa.length == 0 && hi.length == 0 && hia.length == 0 && + ho.length == 0 && hm.length == 0 && hinc.length == 0 + ) { + + if (isXUL()) { + /* + * If we have a record, but nothing to show for it, then the + * record is likely empty or corrupt. This gives cataloguers a + * chance to add holdings or correct the record + */ + hb = ['PLACEHOLDER']; + } else { + return null; + } + } + + // Show entryNum + 1 in staff client for better menu correlation + // Maybe this should be holdings.sre_id() instead? (which could get long after time) + var entryNumString = ''; + if (isXUL()) { + var entryNumInc = entryNum + 1; + entryNumString = ' [Entry #'+entryNumInc+'] '; + } + + var refNode; + if (entryNum > 0) { + refNode = 'rdetail_holdings_table_' + (entryNum - 1); + } else { + refNode = 'rdetail_details_table'; + } + + dojo.place("
" + + dojo.string.substitute(opac_strings.HOLDINGS_TABLE_CAPTION, [hloc]) + entryNumString + + "
", refNode, "after" + ); + if (hb.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.BASIC_HOLDINGS, hb); } + if (hba.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.BASIC_HOLDINGS_ADD, hba); } + if (hs.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.SUPPLEMENT_HOLDINGS, hs); } + if (hsa.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.SUPPLEMENT_HOLDINGS_ADD, hsa); } + if (hi.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.INDEX_HOLDINGS, hi); } + if (hia.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.INDEX_HOLDINGS_ADD, hia); } + if (ho.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.ONLINE_VOLUMES, ho); } + if (hm.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.MISSING_VOLUMES, hm); } + if (hinc.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.INCOMPLETE_VOLUMES, hinc); } + + if (isXUL() && holdings.sre_id() != -1) { // -1 indicates in-DB only holdings, so no button or menu entries for MFHD + mfhdDetails.push({ 'id' : holdings.sre_id(), 'label' : hloc, 'entryNum' : entryNum, 'owning_lib' : holdings.owning_lib() }); + dojo.require('openils.Event'); + dojo.require('openils.PermaCrud'); + var mfhd_edit = new dijit.Menu({}); + new dijit.MenuItem({onClick: function(){loadMarcEditor(holdings.sre_id())}, label:opac_strings.EDIT_MFHD_RECORD}).placeAt(mfhd_edit, "first"); + new dijit.MenuItem({onClick:function(){ + // Avoid accidental deletion of MFHD records + if (!confirm(opac_strings.DELETE_MFHD_CONFIRM)) { + return; + } + var pcrud = new openils.PermaCrud({"authtoken": G.user.session}); + var mfhd_rec = pcrud.retrieve("sre", holdings.sre_id()); + if (mfhd_rec) { + pcrud.eliminate(mfhd_rec); + alert(dojo.string.substitute(opac_strings.DELETED_MFHD_RECORD, [holdings.sre_id()])); + } + }, label:opac_strings.DELETE_MFHD}).placeAt(mfhd_edit, "last"); + // new dijit.MenuItem({onClick:function(){alert("Edit properties " + holdings.sre_id());}, label:opac_strings.EDIT_PROPERTIES}).placeAt(mfhd_edit, "last"); + var mfhd_mb = new dijit.form.DropDownButton({dropDown: mfhd_edit, label:opac_strings.EDIT_MFHD_MENU, style:"float:right"}); + mfhd_mb.placeAt("mfhdHoldingsCaption" + entryNum, "last"); + mfhd_edit.startup(); + } +} + +function _holdingsDrawMFHDEntry(entryNum, entryName, entry) { + var flatEntry = entry.toString().replace(/,/g, ', '); + dojo.place(" " + entryName + "" + flatEntry + "", "rdetail_holdings_tbody_" + entryNum, "last"); +} + +function _rdetailDraw(r) { + record = r.getResultObject(); + + runEvt('rdetail', 'recordRetrieved', record.doc_id()); + + G.ui.rdetail.title.appendChild(text(record.title())); + buildSearchLink(STYPE_AUTHOR, record.author(), G.ui.rdetail.author); + G.ui.rdetail.isbn.appendChild(text(cleanISBN(record.isbn()))); + G.ui.rdetail.edition.appendChild(text(record.edition())); + G.ui.rdetail.pubdate.appendChild(text(record.pubdate())); + G.ui.rdetail.publisher.appendChild(text(record.publisher())); + $('rdetail_physical_desc').appendChild(text(record.physical_description())); + + if (record.series()) { + unHideMe($("series_row")); + $('rdetail_series').appendChild(text(record.series())); + } + + r = record.types_of_resource(); + if(r) { + G.ui.rdetail.tor.appendChild(text(r[0])); + setResourcePic( G.ui.rdetail.tor_pic, r[0]); + } + G.ui.rdetail.abstr.appendChild(text(record.synopsis())); + + try{ + if(record.isbn()) { + if(ENABLE_ADDED_CONTENT_ATTRIB_LINKS) { + unHideMe($('rdetail.jacket_attrib_div')); + var href = $('rdetail.jacket_attrib_link').getAttribute('href') +cleanISBN(record.isbn()); + $('rdetail.jacket_attrib_link').setAttribute('href', href); + } + rdetailCheckForGBPreview(); + + } else { + hideMe($("rdetail.jacket_attrib_div")); + hideMe($("rdetail_img_link")); + } + } catch(E) {} + + + // see if the record has any external links + var links = record.online_loc(); + // When we see an ezproxy link, hide things that only make sense for physical holdings + // FIXME: We should also check for zero copies, or check all links for ezproxy looking urls + if (links.length > 0) { + if (links[0].substring(0,20) == "http://via.tadl.org/") { + hideMe($('rdetail_place_hold')); + hideMe($('rdetail_copy_info_link')); + hideMe($('rdetail_viewcn_link')); + hideMe($('rdetail_copy_info_div')); + } + } + for( var i = 0; links && links.length > 0 && i < links.length; i = i + 3 ) { + var href = links[i]; + // avoid matching "HTTP: The Complete Reference" + if( href.match(/https?:\/|ftps?:\/|mailto:/i) ) { + unHideMe($('rdetail_online_row')); + // MODS can contain a display label (used for the text of the link) + // as well as a note about the URL; many legacy systems conflate the + // two and generate MARC records that expect the note to be used as + // the text of the link, with no display label; here's the canonical + // format: + // + // 856 40 $uhttp://localhost$yDisplay label$zPublic note + // + // Note that the MARC21slim2MODS XSL concatenates $3 and $y together + // (as $y was defined later in MARC21's life as the display label) + var displayLabel = '' + links[i+1]; + var note = '' + links[i+2]; + if(!displayLabel || displayLabel.match(/https?:\/|ftps?:\/|mailto:/i)) { + if(!note || note.match(/https?:\/|ftps?:\/|mailto:/i)) { + displayLabel = href; + } else { + displayLabel = note; + } + } + // Latch-ditch attempt to prevent URLs as display labels + if (displayLabel.substring(0,7) == 'http://') { + displayLabel = 'Connect to this resource online'; + } + $('rdetail_online').appendChild(elem('a', {href:href,'class':'css_button'}, displayLabel)); + if (note && note != displayLabel) { + $('rdetail_online').appendChild(elem('span', {'class':'url_note'}, ' - ' + note)); + } + $('rdetail_online').appendChild(elem('br')); + } + } + + // Fill in our unAPI ID, if anyone cares + var abbrs = document.getElementsByTagName('abbr'); + var span; + for (var i = 0; i < abbrs.length; i++) { + if (abbrs[i].getAttribute('name') == 'unapi') { + span = abbrs[i]; + break; + } + } + buildunAPISpan( span, 'biblio-record_entry', record.doc_id() ); + + $('rdetail_place_hold').onclick = function() { + var src = location.href; + + if(forceLoginSSL && src.match(/^http:/)) { + + src = src.replace(/^http:/, 'https:'); + + if(!src.match(/&place_hold=1/)) { + src += '&place_hold=1'; + } + + location.href = src; + + } else { + holdsDrawEditor({record:record.doc_id(), type:'T'}); + } + } + + + var RW = $('rdetail_exp_refworks'); + if (RW && rdetailEnableRefWorks) { + + var here = (findOrgUnit(getLocation())).name(); + var org_name = here.replace(" ", "+"); + var cgi = new CGI(); + + RW.setAttribute( + 'href', + rdetailRefWorksHost + '/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/supercat/marctxt/record/' + + record.doc_id() + ); + + RW.setAttribute('target', 'RefWorksMain'); + + unHideMe($('rdetail_exp_refworks_span')); + } + + $('rdetail_img_link').setAttribute('href', buildISBNSrc(cleanISBN(record.isbn()), 'large')); + G.ui.rdetail.image.setAttribute("src", buildISBNSrc(cleanISBN(record.isbn()), 'medium')); + runEvt("rdetail", "recordDrawn"); + recordsCache.push(record); + + rdetailSetExtrasSelector(); + + var breq = new Request(FETCH_BRE, [getRid()]); + breq.callback( rdetailCheckDeleted ); + breq.send(); + + //resultBuildCaches( [ record ] ); + //resultDrawSubjects(); + //resultDrawSeries(); + + // grab added content + + // Proxied through Evergreen AddedContent module + acCollectData(cleanISBN(record.isbn()), rdetailhandleAC); + + var currentISBN = cleanISBN(record.isbn()); + + // Not proxied, cross-site javascript + + // ChiliFresh + if (chilifresh && chilifresh != '(none)' && currentISBN) { + $('chilifreshReviewLink').setAttribute('id','isbn_'+currentISBN); + $('chilifreshReviewResult').setAttribute('id','chili_review_'+currentISBN); + unHideMe($('rdetail_reviews_link')); + unHideMe($('rdetail_chilifresh_reviews')); + try { + chili_init(); + } catch(E) { + console.log(E + '\n'); + hideMe($('rdetail_reviews_link')); + hideMe($('rdetail_chilifresh_reviews')); + } + } + + // Novelist + if (novelist && currentISBN) { + unHideMe($('rdetail_novelist_link')); + } + + // Multi-Home / Foreign Items / Peer Bibs + var req = new Request( TEST_PEER_BIBS, record.doc_id() ); + req.callback(function(r){ + var test = r.getResultObject(); + if (test == "1") { + unHideMe($('rdetail_foreign_items_link')); + } + }); + req.send(); + + var curr_holds = getHoldCount(record.doc_id()); + if (curr_holds) { + $('rdetail_hold_count').appendChild(text(curr_holds)); + } +} + + + +function rdetailCheckDeleted(r) { + var br = r.getResultObject()[0]; + if( isTrue(br.deleted()) ) { + hideMe($('rdetail_place_hold')); + $('rdetail_more_actions_selector').disabled = true; + unHideMe($('rdetail_deleted_exp')); + } +} + +function rdetailSetExtrasSelector() { + if(!grabUser()) return; + unHideMe($('rdetail_more_actions')); + + var req = new Request( + FETCH_CONTAINERS, G.user.session, G.user.id(), 'biblio', 'bookbag' ); + req.callback(rdetailAddBookbags); + req.send(); +} + +function rdetailAddBookbags(r) { + + var containers = r.getResultObject(); + var selector = $('rdetail_more_actions_selector'); + 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(), rdetailAddToBookbag, 1 ); + } + + nextContainerIndex = index; +} + +var _actions = {}; +/** + * Adds a new bookbag and exits. + * + * exitstatus should be 0 if the status is to be read. + */ +function finishBookbag(exitstatus) { + var name = bbName.attr('value'); + + newBBDialog.hide(); + bbName.attr("value", ""); // Do this after hide so the text doesn't disappear. + + if(exitstatus != 0) return; // If the user canceled, just drop off here. + + var id; + + if( id = containerCreate( name ) ) { + alert( $('rdetail_bb_success').innerHTML ); + var selector = $('rdetail_more_actions_selector'); + insertSelectorVal( selector, nextContainerIndex++, name, + "container_" + id, rdetailAddToBookbag, 1 ); + setSelector( selector, 'start' ); + } +} + +/** + * Creates a new Bookbag for the user. + */ +function rdetailNewBookbag() { + newBBDialog.show(); // Show the bookbag dialog. + dojo.connect(dijit.byId('newBBDialog'), 'onKeyPress', function(evt) { + if (evt.keyCode == dojo.keys.ENTER) { + finishBookbag(0); + } + }); +} + +function rdetailAddToBookbag() { + var selector = $('rdetail_more_actions_selector'); + var id = selector.options[selector.selectedIndex].value; + setSelector( selector, 'start' ); + + if( containerCreateItem( id.substring(10), record.doc_id() )) { + alert($('rdetail_bb_item_success').innerHTML); + } +} + + +var rdetailMarcFetched = false; +var rdetailForeignItemsFetched = false; +function rdetailShowExtra(type, args) { + + hideMe($('rdetail_copy_info_div')); + hideMe($('rdetail_summary_div')); + hideMe($('rdetail_reviews_div')); + hideMe($('rdetail_toc_div')); + hideMe($('rdetail_anotes_div')); + hideMe($('rdetail_excerpt_div')); + hideMe($('rdetail_preview_div')); + hideMe($('rdetail_marc_div')); + hideMe($('cn_browse')); + hideMe($('rdetail_cn_browse_div')); + hideMe($('rdetail_novelist_div')); + hideMe($('rdetail_foreign_items_div')); + hideMe($('rdetail_notes_div')); + + removeCSSClass($('rdetail_copy_info_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_viewcn_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_summary_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_reviews_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_toc_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_excerpt_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_preview_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_anotes_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_annotation_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_viewmarc_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_novelist_link'), 'rdetail_extras_selected'); + removeCSSClass($('rdetail_foreign_items_link'), 'rdetail_extras_selected'); + + switch(type) { + + case "copyinfo": + unHideMe($('rdetail_copy_info_div')); + addCSSClass($('rdetail_copy_info_link'), 'rdetail_extras_selected'); + break; + + case "summary": + addCSSClass($('rdetail_summary_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_summary_div')); + break; + + case "reviews": + addCSSClass($('rdetail_reviews_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_reviews_div')); + break; + + case "excerpt": + addCSSClass($('rdetail_excerpt_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_excerpt_div')); + break; + + case "preview": + addCSSClass($('rdetail_preview_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_preview_div')); + rdetailDisplayGBPreview(); + break; + + case "anotes": + addCSSClass($('rdetail_anotes_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_anotes_div')); + break; + + case "toc": + addCSSClass($('rdetail_toc_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_toc_div')); + break; + + case "marc": + addCSSClass($('rdetail_viewmarc_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_marc_div')); + if(rdetailMarcFetched) return; + unHideMe($('rdetail_extras_loading')); + rdetailMarcFetched = true; + var req = new Request( FETCH_MARC_HTML, record.doc_id() ); + req.callback(rdetailViewMarc); + req.send(); + break; + + case "novelist": + addCSSClass($('rdetail_novelist_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_novelist_div')); + break; + + case "foreign_items": + addCSSClass($('rdetail_foreign_items_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_foreign_items_div')); + if(rdetailForeignItemsFetched) return; + unHideMe($('rdetail_extras_loading')); + rdetailForeignItemsFetched = true; + var req = new Request( FETCH_PEER_BIBS, record.doc_id() ); + req.callback(rdetailForeignItems); + req.send(); + break; + + case 'cn': + addCSSClass($('rdetail_viewcn_link'), 'rdetail_extras_selected'); + unHideMe($('rdetail_cn_browse_div')); + rdetailShowCNBrowse(defaultCN[1], getLocation(), null, true); + break; + + } +} + +function rdetailVolumeDetails(args) { + var row = $(args.rowid); + var tbody = row.parentNode; + cpdBuild( tbody, row, record, [args.cn_prefix, args.cn, args.cn_suffix], args.org, args.depth, args.copy_location ); + return; +} + +function rdetailBuildCNList() { + + var select = $('cn_browse_selector'); + var index = 0; + var arr = []; + for( var cn_json in callnumberCache ) arr.push( cn_json ); + arr.sort(); + + if( arr.length == 0 ) { + hideMe($('rdetail_cn_browse_select_div')); + return; + } + + for( var i = 0; i < arr.length; i++ ) { + var cn_json = arr[i]; + var cn = JSON2js(cn_json); + var whole_cn_text = (cn[0] ? cn[0] + ' ' : '') + cn[1] + (cn[2] ? ' ' + cn[2] : ''); + var opt = new Option(whole_cn_text,cn_json); + select.options[index++] = opt; + } + select.onchange = rdetailGatherCN; +} + +function rdetailGatherCN() { + var cn = getSelectorVal($('cn_browse_selector')); + rdetailShowCNBrowse( JSON2js(cn), getLocation(), getDepth(), true ); + setSelector( $('cn_browse_selector'), cn ); +} + + +function rdetailShowCNBrowse( cn, loc, depth, fromOnclick ) { + + if(!cn) { + unHideMe($('cn_browse_none')); + hideMe($('rdetail_cn_browse_select_div')); + return; + } + + unHideMe($('rdetail_cn_browse_select_div')); + rdetailBuildCNList(); + setSelector( $('cn_browse_selector'), js2JSON(cn) ); + hideMe($('rdetail_copy_info_div')); + hideMe($('rdetail_reviews_div')); + hideMe($('rdetail_summary_div')); + hideMe($('rdetail_toc_div')); + hideMe($('rdetail_marc_div')); + unHideMe($('rdetail_cn_browse_div')); + unHideMe($('cn_browse')); + if( !rdetailLocalOnly && ! fromOnclick ) depth = findOrgDepth(globalOrgTree); + cnBrowseGo(cn, loc, depth); +} + +function rdetailhandleAC(data) { + + if( data.summary.html ) { + $('rdetail_summary_div').innerHTML = data.summary.html; + unHideMe($('rdetail_summary_link')); + } + + if( data.reviews.html ) { + $('rdetail_review_container').innerHTML = data.reviews.html; + unHideMe($('rdetail_reviews_link')); + } + + if( data.toc.html ) { + $('rdetail_toc_div').innerHTML = data.toc.html; + unHideMe($('rdetail_toc_link')); + } + + if( data.excerpt.html ) { + $('rdetail_excerpt_div').innerHTML = data.excerpt.html; + unHideMe($('rdetail_excerpt_link')); + } + + if( data.anotes.html ) { + $('rdetail_anotes_div').innerHTML = data.anotes.html; + unHideMe($('rdetail_anotes_link')); + } +} + +function rdetailShowReviews(r) { + hideMe($('rdetail_extras_loading')); + var res = r.getResultObject(); + var par = $('rdetail_reviews_div'); + var template = par.removeChild($('rdetail_review_template')); + if( res && res.length > 0 ) { + unHideMe($('rdetail_reviews_link')); + for( var i = 0; i < res.length; i++ ) { + var rev = res[i]; + if( rev.text && rev.info ) { + var node = template.cloneNode(true); + $n(node, 'review_header').appendChild(text(rev.info)); + $n(node, 'review_text').appendChild(text(rev.text)); + par.appendChild(node); + } + } + } +} + + +function rdetailShowTOC(r) { + hideMe($('rdetail_extras_loading')); + var resp = r.getResultObject(); + if(resp) { + unHideMe($('rdetail_toc_link')); + $('rdetail_toc_div').innerHTML = resp; + } +} + +function rdetailBuildInfoRows() { + var req; + var method = FETCH_COPY_COUNTS_SUMMARY; + if (rdetailShowCopyLocation) + method = FETCH_COPY_LOCATION_COUNTS_SUMMARY; + if( rdetailShowLocal ) + req = new Request(method, record.doc_id(), getLocation(), getDepth()) + else + req = new Request(method, record.doc_id()); + req.callback(_rdetailBuildInfoRows); + req.send(); +} + +function _rdetailRows(node) { + + if( rdetailShowLocal && getLocation() != globalOrgTree.id() ) { + var loc = findOrgUnit(getLocation()); + if( node ) { + if( !orgIsMine(node, loc) && !orgIsMine(loc,node) ) return; + } else { + var kids = globalOrgTree.children(); + if (kids) { + for( var i = 0; i < kids.length; i++ ) { + var org = findOrgUnit(kids[i]); + if( orgIsMine(org, loc) ) { + node = org; + break; + } + } + } + } + } + + if(!node && findOrgType(globalOrgTree.ou_type()).can_have_vols()) + node = globalOrgTree; + + + /* don't show hidden orgs */ + + if(node) { + + if(!isXUL() && !isTrue(node.opac_visible())) return; + + if (orgHiding) { + if (isTrue( findOrgType(node.ou_type()).can_have_vols() )) { + if ( ! orgIsMine( orgHiding.org, node, orgHiding.depth ) ) { + return; + } + } + } + + var row = copyRow.cloneNode(true); + row.id = "cp_info_" + node.id(); + + var libtd = findNodeByName( row, config.names.rdetail.lib_cell ); + var cntd = findNodeByName( row, config.names.rdetail.cn_cell ); + var cpctd = findNodeByName( row, config.names.rdetail.cp_count_cell ); + var actions = $n(row, 'rdetail_actions_cell'); + + var p = libtd.getElementsByTagName('a')[0]; + libtd.insertBefore(text(node.name()), p); + libtd.setAttribute("style", "padding-left: " + ((findOrgDepth(node) - 1) * 9) + "px;"); + + if(!findOrgType(node.ou_type()).can_have_vols()) { + + row.removeChild(cntd); + row.removeChild(cpctd); + row.removeChild(actions); + row.setAttribute('novols', '1'); + + libtd.setAttribute("colspan", numStatuses + 3 ); + libtd.colSpan = numStatuses + 3; + addCSSClass(row, 'copy_info_region_row'); + } + + copyRowParent.appendChild(row); + + } else { node = globalOrgTree; } + + var kids = node.children(); + if (kids) { + for( var c = 0; c < kids.length; c++ ) + _rdetailRows(kids[c]); + } +} + +function rdetailCNPrint(orgid, cn) { + var div = cpdBuildPrintWindow( record, orgid); + var template = div.removeChild($n(div, 'cnrow')); + var rowNode = $("cp_info_" + orgid); + cpdStylePopupWindow(div); + openWindow(div.innerHTML); +} + +var localCNFound = false; +var ctr = 0; +function _rdetailBuildInfoRows(r) { + + if (rdetailShowCopyLocation) + unHideMe( $n( $('rdetail_copy_info_table'), 'rdetail_copylocation_header' ) ); + + removeChildren(copyRowParent); + + orgHiding = checkOrgHiding(); + + _rdetailRows(); + + var summary = r.getResultObject(); + if(!summary) return; + + var found = false; + for( var i = 0; i < summary.length; i++ ) { + + var arr = summary[i]; + globalCNCache[js2JSON([arr[1],arr[2],arr[3]])] = 1; // prefix, label, suffix. FIXME - Am I used anywhere? + var thisOrg = findOrgUnit(arr[0]); + var rowNode = $("cp_info_" + thisOrg.id()); + if(!rowNode) continue; + + if(rowNode.getAttribute("used")) { + + if( rowNode.nextSibling ) { + sib = rowNode.nextSibling; + o ='cp_info_'+thisOrg.id()+'_'; + /* push the new row on as the last row for this org unit */ + while( sib && sib.id.match(o) ) { + sib = sib.nextSibling; + } + if(sib) + rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib); + else + rowNode = copyRowParent.appendChild(copyRow.cloneNode(true)); + } else { + rowNode = copyRowParent.appendChild(copyRow.cloneNode(true)); + } + + var n = findNodeByName( rowNode, config.names.rdetail.lib_cell ); + n.appendChild(text(thisOrg.name())); + n.setAttribute("style", "padding-left: " + ((findOrgDepth(thisOrg) - 1) * 9) + "px;"); + rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr); + + } else { + rowNode.setAttribute("used", "1"); + } + + var cpc_temp = rowNode.removeChild( + findNodeByName(rowNode, config.names.rdetail.cp_count_cell)); + + var statuses = arr[4]; + var cl = ''; + if (rdetailShowCopyLocation) { + cl = arr[4]; + statuses = arr[5]; + } + + + rdetailApplyStatuses(rowNode, cpc_temp, statuses); + + var isLocal = false; + if( orgIsMine( findOrgUnit(getLocation()), thisOrg ) ) { + found = true; + isLocal = true; + if(!localCNFound) { + localCNFound = true; + defaultCN = [arr[1],arr[2],arr[3]]; // prefix, label, suffix + } + } + + //if(isLocal) unHideMe(rowNode); + unHideMe(rowNode); + + rdetailSetPath( thisOrg, isLocal ); + rdetailBuildBrowseInfo( rowNode, [arr[1],arr[2],arr[3]], isLocal, thisOrg, cl ); + + if( i == summary.length - 1 && !defaultCN) defaultCN = [arr[1],arr[2],arr[3]]; // prefix, label, suffix + } + + if(!found) unHideMe(G.ui.rdetail.cp_info_none); +} + +function rdetailBuildBrowseInfo(row, cn, local, orgNode, cl) { + + var whole_cn_json = js2JSON(cn); + var whole_cn_text = (cn[0] ? cn[0] + ' ' : '') + cn[1] + (cn[2] ? ' ' + cn[2] : ''); + + if(local) { + var cache = callnumberCache[whole_cn_json]; + if( cache ) cache.count++; + else callnumberCache[whole_cn_json] = { count : 1 }; + } + + var depth = getDepth(); + if( !local ) depth = findOrgDepth(globalOrgTree); + + $n(row, 'rdetail_callnumber_cell').appendChild(text(whole_cn_text)); + + if (rdetailShowCopyLocation) { + var cl_cell = $n(row, 'rdetail_copylocation_cell'); + cl_cell.appendChild(text(cl)); + unHideMe(cl_cell); + } + + _debug('setting action clicks for cn ' + whole_cn_text); + + var dHref = 'javascript:rdetailVolumeDetails('+ + '{copy_location : "'+cl.replace(/\"/g, '\\"')+'", rowid : "'+row.id+'", cn_prefix :"'+cn[0].replace(/\"/g, '\\"')+'",cn :"'+cn[1].replace(/\"/g, '\\"')+'",cn_suffix :"'+cn[2].replace(/\"/g, '\\"')+'", depth:"'+depth+'", org:"'+orgNode.id()+'", local: '+local+'});'; + + var bHref = 'javascript:rdetailShowCNBrowse("'+cn[1].replace(/\"/g, '\\"') + '", '+orgNode.id()+', "'+depth+'");'; + + unHideMe( $n(row, 'details') ) + $n(row, 'details').setAttribute('href', dHref); + unHideMe( $n(row, 'browse') ) + $n(row, 'browse').setAttribute('href', bHref); + + if(isXUL()) { + unHideMe($n(row, 'hold_div')); + $n(row, 'hold').onclick = function() { + var req = new Request(FETCH_VOLUME_BY_INFO, cn, record.doc_id(), orgNode.id()); + req.callback( + function(r) { + var vol = r.getResultObject(); + holdsDrawEditor({type: 'V', volumeObject : vol}); + } + ); + req.send(); + }; + } +} + +// sets the path to org as 'active' and displays the path if it's local +function rdetailSetPath(org, local) { + if( findOrgDepth(org) == 0 ) return; + var row = $("cp_info_" + org.id()); + row.setAttribute("hasinfo", "1"); + unHideMe(row); + rdetailSetPath(findOrgUnit(org.parent_ou()), local); +} + +//Append all the statuses for a given summary to the +//copy summary table +function rdetailApplyStatuses( row, template, statuses ) { + for( var j in _statusPositions ) { + var stat = _statusPositions[j]; + var val = statuses[stat.id()]; + var nn = template.cloneNode(true); + if(val) nn.appendChild(text(val)); + else nn.appendChild(text(0)); + row.appendChild(nn); + } +} + +//Add one td (creating a new column) to the copy summary +//table for each opac_visible copy status +function rdetailBuildStatusColumns() { + + rdetailGrabCopyStatuses(); + var parent = statusRow; + var template = parent.removeChild(G.ui.rdetail.cp_status); + + var i = 0; + for( i = 0; i < cp_statuses.length; i++ ) { + + var c = cp_statuses[i]; + if( c && isTrue(c.opac_visible()) ) { + var name = c.name(); + _statusPositions[i] = c; + var node = template.cloneNode(true); + var data = findNodeByName( node, config.names.rdetail.cp_status); + + data.appendChild(text(name)); + parent.appendChild(node); + } + } + + numStatuses = 0; + for(x in _statusPositions) numStatuses++; +} + +function rdetailGrabCopyStatuses() { + if(cp_statuses) return cp_statuses; + var req = new Request(FETCH_COPY_STATUSES); + req.send(true); + cp_statuses = req.result(); + cp_statuses = cp_statuses.sort(_rdetailSortStatuses); +} + +function _rdetailSortStatuses(a, b) { + return parseInt(a.id()) - parseInt(b.id()); +} + +/** + * Check for a Google Book preview after the main page loads + */ +function rdetailCheckForGBPreview() { + if (!rdetailGoogleBookPreview) return; + dojo.addOnLoad(function() { + searchForGBPreview( cleanISBN(record.isbn()) ); + }); +} + +/** + * + * @param {DOM object} isbn The form element containing the input parameters "isbns" + */ +function searchForGBPreview( isbn ) { + dojo.require("dojo.io.script"); + dojo.io.script.get({"url": "https://www.google.com/jsapi"}); + dojo.io.script.get({"url": "http://books.google.com/books", "content": { "bibkeys": isbn, "jscmd": "viewapi", "callback": "GBPreviewCallback"}}); +} + +/** + * This function is the call-back function for the JSON scripts which + * executes a Google book search response. + * + * XXX I18N of text needed + * + * @param {JSON} GBPBookInfo is the JSON object pulled from the Google books service. + */ +function GBPreviewCallback(GBPBookInfo) { + var GBPreviewDiv = document.getElementById("rdetail_preview_div"); + var GBPBook; + + for ( i in GBPBookInfo ) { + GBPBook = GBPBookInfo[i]; + } + + if ( !GBPBook ) { + return; + } + + if ( GBPBook.preview != "noview" ) { + // Add a button below the book cover image to load the preview. + GBPBadge = document.createElement( 'img' ); + GBPBadge.src = 'http://books.google.com/intl/en/googlebooks/images/gbs_preview_button1.gif'; + GBPBadge.title = $('rdetail_preview_badge').innerHTML; + GBPBadge.style.border = 0; + GBPBadgelink = document.createElement( 'a' ); + GBPBadgelink.href = 'javascript:rdetailShowExtra("preview");'; + GBPBadgelink.appendChild( GBPBadge ); + $('rdetail_image_cell').appendChild( GBPBadgelink ); + $('rdetail_preview_div').style.height = 600; + + /* Display the "Preview" tab in the Extras section */ + unHideMe( $('rdetail_preview_link' ) ); + } +} + +/** + * This is called when the user clicks on the 'Preview' link. We assume + * a preview is available from Google if this link was made visible. + * + * XXX I18N of Google Book Preview language attribute needed + */ +function rdetailDisplayGBPreview() { + unHideMe($('rdetail_extras_loading')); + GBPreviewPane = $('rdetail_preview_div'); + if ( GBPreviewPane.getAttribute('loaded') == null || + GBPreviewPane.getAttribute('loaded') == "false" ) { + google.load("books", "0", {"callback" : rdetailGBPViewerLoadCallback, "language": "en"} ); + GBPreviewPane.setAttribute('loaded', 'true'); + } +} + +function rdetailGBPViewerLoadCallback() { + hideMe($('rdetail_extras_loading')); + var GBPViewer = new google.books.DefaultViewer(document.getElementById('rdetail_preview_div')); + GBPViewer.load('ISBN:' + cleanISBN(record.isbn()) ); + +} + +function rdetailDrawExpandedHoldings(anchor, bibid, type) { + var offsets = {"basic": 0, "index": 0, "supplement": 0}; + var limit = 10; /* XXX give user control over this? */ + var target_id = "holding_type_" + type; + var target = dojo.byId(target_id); + + anchor.innerHTML = "[-]"; + anchor.oldonclick = anchor.onclick; + anchor.onclick = function() { + anchor.onclick = anchor.oldonclick; + anchor.innerHTML = "[+]"; + dojo.empty(target); + }; + + function _load() { + dojo.empty(target); + fieldmapper.standardRequest( + ["open-ils.serial", + "open-ils.serial.received_siss.retrieve.by_bib.atomic"], { + "params": [bibid, {"offset": offsets[type], "limit": limit}], + "async": true, + "oncomplete": function(r) { + try { + if (msg = r.recv().content()) { /* sic, assignment */ + if (!msg.length) return; + offsets[type] += msg.length; + var table = dojo.create("table", null, target); + dojo.forEach( + msg, function(o) { + var tr = dojo.create("tr", null, table); + dojo.create( + "td", { + "innerHTML": o.issuance.label(), + "style": {"paddingLeft": "3em"} + }, tr + ); + + if (!o.has_units) return; + /* can't place holds if no units */ + var td = dojo.create("td", null, tr); + dojo.create( + "a", { + "href":"javascript:void(0);", + "style": {"marginLeft": "1.5em"}, + "onclick": function() { + holdsDrawEditor({ + "type": "I", + "issuance": o.issuance.id() + }); + }, + "innerHTML": "[" + + opac_strings.PLACE_HOLD + "]" + }, td + ); + } + ); + if (msg.length == limit) { + dojo.create("br", null, target); + dojo.create( + "a", { + "href": "javascript:void(0);", + "innerHTML": + "[" + opac_strings.MORE + "]", + "onclick": _load + }, target + ); + } + } + } catch (E) { + void(0); + } + } + } + ); + } + _load(); +} diff --git a/Open-ILS/web/opac/skin/tadlv3/js/result_common.js b/Open-ILS/web/opac/skin/tadlv3/js/result_common.js new file mode 100644 index 0000000000..39177b53dd --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/js/result_common.js @@ -0,0 +1,880 @@ +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; + +/* 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, 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 my_ou = findOrgUnit(args.org_unit); + if (my_ou && my_ou.shortname()) { + var atomfeed = "/opac/extras/opensearch/1.1/" + my_ou.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(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); + if(getDepth() == 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++; + } +} + +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.found && 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()); + var is_online_only; + + if (rec.online_loc()[0]) { + // FIXME: check more than just the first url, check for copies, bib source? + if (rec.online_loc()[0].substring(0,20) == "http://via.tadl.org/") { + is_online_only = true; + } + } + + 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); + if (currentISBN) { + pic.setAttribute("src", buildISBNSrc(currentISBN)); + } else { + pic.setAttribute("src", "/opac/images/blank.png"); + } + + var title_link = $n(r, config.names.result.item_title); + var author_link = $n(r, config.names.result.item_author); + + 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)); + } + + unHideMe($n(r,'place_hold_span')); + $n(r,'place_hold_link').onclick = function() { resultDrawHoldsWindow(rec.doc_id(), '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 (!is_online_only) { + // don't show Place Hold for online-only bibs + unHideMe($n(r,'place_hold_span')); + $n(r,'place_hold_link').onclick = function() { resultDrawHoldsWindow(rec.doc_id(), 'T'); } + } + } + + buildSearchLink(STYPE_AUTHOR, rec.author(), author_link); + + if(! is_mr ) { + + 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; + if (is_online_only) { + // simplify physical description for online-only bibs + t = "online"; + } else { + t = " " + rec.physical_description(); + } + //$n(r, "result_table_phys_span").appendChild( text(t.replace(/:.*/g,''))); + $n(r, "result_table_phys_span").appendChild( text(t)); + } + + } + + if (is_online_only) { + hideMe($n(r,'result_table_format_cell')); + } else { + 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 resultDrawHoldsWindow(hold_target, hold_type) { + var src = location.href; + + if(forceLoginSSL && src.match(/^http:/)) { + + src = src.replace(/^http:/, 'https:'); + + if(src.match(/&hold_target=/)) { + src.replace(/&hold_target=(\d+)/, hold_target); + + } else { + src += '&hold_target=' + hold_target; + } + + location.href = src; + + } else { + holdsDrawEditor({record:hold_target, type:hold_type}); + } +} + + + +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 (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__' */ +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(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++; + } +} + + diff --git a/Open-ILS/web/opac/skin/tadlv3/js/rresult.js b/Open-ILS/web/opac/skin/tadlv3/js/rresult.js new file mode 100644 index 0000000000..ae86d8d1d3 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/js/rresult.js @@ -0,0 +1,363 @@ +var records = new Array(); +var table; +var rowtemplate; +var rresultLimit = 200; +var resultFacetKey; + +var rresultIsPaged = false; + +function rresultUnload() { removeChildren(table); table = null;} + +attachEvt("common", "unload", rresultUnload); +attachEvt("common", "run", rresultDoSearch); +attachEvt("result", "idsReceived", rresultCollectRecords); +attachEvt("result", "recordDrawn", rresultLaunchDrawn); + +hideMe($('copyright_block')); + +function rresultDoSearch() { + + swapCanvas($('loading_alt')); + + table = G.ui.result.main_table; + hideMe(G.ui.result.row_template); + if( table && table.parentNode ) { + while( table.parentNode.rows.length <= (getDisplayCount() +1) ) + hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true))); + } + rresultCollectIds(); +} + +function rresultCollectIds() { + var ids; + + + var holdTarget = new CGI().param('hold_target'); + if(holdTarget != null) { + rresultHandlePlaceHold(holdTarget); + return; + } + + var rtype = getRtype(); + if (rtype && rtype.indexOf('|') > -1) + rtype = rtype.substring(0,rtype.indexOf('|')); + + switch(rtype) { + + case RTYPE_COOKIE: + ids = JSON2js(dojo.cookie(COOKIE_RIDS)); + _rresultHandleIds( ids, ids.length ); + break; + + case RTYPE_TITLE: + case RTYPE_AUTHOR: + case RTYPE_SUBJECT: + case RTYPE_SERIES: + case RTYPE_KEYWORD: + rresultDoRecordSearch(); + break; + + case RTYPE_MULTI: + rresultDoRecordMultiSearch(); + break; + + case RTYPE_LIST : + rresultHandleList(); + break; + + case RTYPE_MARC : + rresultCollectMARCIds(); + break; + + case RTYPE_ISBN : + rresultCollectISBNIds(); + break; + + case RTYPE_TCN : + rresultCollectTCNIds(); + break; + + case RTYPE_ISSN : + rresultCollectISSNIds(); + break; + + + case RTYPE_MRID : + case null : + case "" : + default: + var form = rresultGetForm(); + var args = { format : form, org : getLocation(), depth : rresultGetDepth() }; + + var lasso = getLasso(); + if (lasso) args.org = -lasso; + + var req = new Request(FETCH_RIDS, getMrid(), args); + req.callback( rresultHandleRIds ); + req.send(); + + if( rresultGetDepth() != findOrgDepth(globalOrgTree) ) { + var link = $('rresult_show_all_link'); + if(link) { + unHideMe($('rresult_show_all')); + link.appendChild( text( + findOrgType(globalOrgTree.ou_type()).opac_label())); + } + + } else { + if( rresultGetDepth() != getDepth() ) { /* inside a limited display */ + var link = $('rresult_show_here_link'); + if(link) { + link.appendChild( text( + findOrgType(findOrgUnit(getLocation()).ou_type()).opac_label())); + unHideMe($('rresult_show_here')); + } + } + } + } +} + +function rresultExpandSearch() { + var args = {}; + args[PARAM_RDEPTH] = findOrgDepth(globalOrgTree); + goTo(buildOPACLink(args)); +} + +function rresultContractSearch() { + var args = {}; + RDEPTH = null; + args[PARAM_OFFSET] = 0; + goTo(buildOPACLink(args)); +} + + +function rresultGetDepth() { + if( getRdepth() != null) return getRdepth(); + return getDepth(); +} + + +function rresultGetForm() { + var form; + + if(getTform()) /* did the user select a format from the icon list (temporary) */ + form = (getTform() == 'all') ? null : getTform(); + else /* did the use select a format from simple search dropdown */ + form = (getForm() == 'all') ? null : getForm(); + + if(!form) { /* did the user select a format from the advanced search */ + form = getItemType(); + var f = getItemForm(); + + if(form) { + form = form.replace(/,/,''); + if(f) form += '-' + f; + } else { + if(f) form = '-' + f; + } + } + + return form; +} + + +function rresultCollectMARCIds() { + + var args = {}; + args.searches = JSON2js(getSearches()); + args.limit = 200; + args.org_unit = globalOrgTree.id(); + args.depth = 0; + + rresultIsPaged = true; + var req = new Request(FETCH_ADV_MARC_MRIDS, args, getDisplayCount(), getOffset()); + req.callback(rresultHandleRIds); + req.request.noretry = true; + req.send(); +} + + +function rresultCollectISBNIds() { + var req = new Request(FETCH_ADV_ISBN_RIDS, getAdvTerm() ); + req.callback( + function(r) { + var blob = r.getResultObject(); + _rresultHandleIds(blob.ids, blob.count); + } + ); + req.send(); +} + +function rresultCollectTCNIds() { + var req = new Request(FETCH_ADV_TCN_RIDS, getAdvTerm() ); + req.callback( + function(r) { + var blob = r.getResultObject(); + _rresultHandleIds(blob.ids, blob.count); + } + ); + req.send(); +} + +function rresultCollectISSNIds() { + var req = new Request(FETCH_ADV_ISSN_RIDS, getAdvTerm() ); + req.callback( + function(r) { + var blob = r.getResultObject(); + _rresultHandleIds(blob.ids, blob.count); + } + ); + req.send(); +} + +function rresultHandleList() { + var ids = new CGI().param(PARAM_RLIST); + var count; + if(!dojo.isArray(ids)) { + count = 1; + ids = [ids]; + } else { + count = ids.length; + } + if(ids) _rresultHandleIds(ids, count); +} + +var rresultTries = 0; +function rresultHandleRIds(r) { + var res = r.getResultObject(); + + if(!res) res = {count:0,ids:[]}; + + if( res.count == 0 && rresultTries == 0 && ! r.noretry) { + + rresultTries++; + var form = rresultGetForm(); + var args = { format : form, org : getLocation(), depth : findOrgDepth(globalOrgTree) }; + + var lasso = getLasso(); + if (lasso) args.org = -lasso; + + var req = new Request(FETCH_RIDS, getMrid(), args ); + req.callback( rresultHandleRIds ); + req.send(); + unHideMe($('no_formats')); + hideMe($('rresult_show_all')); + + } else { + + _rresultHandleIds(res.ids, res.count); + } +} + +function _rresultHandleIds(ids, count) { + //var json = js2JSON({ids:ids,count:count}); + /* + dojo.cookie(COOKIE_SRIDS, json, {'expires':1}); + */ + + HITCOUNT = parseInt(count); + runEvt('result', 'hitCountReceived'); + runEvt('result', 'idsReceived', ids, getOffset()); +} + +/* +function rresultCollectRecords(ids) { + runEvt("result", "preCollectRecords"); + var x = 0; + for( var i = getOffset(); i!= getDisplayCount() + getOffset(); i++ ) { + if(ids[i] == null) break; + var req = new Request(FETCH_RMODS, parseInt(ids[i])); + req.callback(rresultHandleMods); + req.request.userdata = x++; + req.send(); + } +} +*/ + + +function rresultCollectRecords(ids, base) { + runEvt("result", "preCollectRecords"); + var x = 0; + + // don't perform rdetail redirect if user was on rdetail and cliecked Back + if(findCurrentPage() == RRESULT && isXUL()) { + if(ids.length == 1 && !xulG.fromBack) { + var args = {}; + args.page = RDETAIL; + args[PARAM_OFFSET] = 0; + args[PARAM_RID] = ids[0]; + location.href = buildOPACLink(args); + } + } + + if (!base) base = 0; + if( rresultIsPaged ) base = 0; + + for( var i = base; i!= getDisplayCount() + base; i++ ) { + if(ids[i] == null) break; + var req = new Request(FETCH_RMODS, parseInt(ids[i])); + req.callback(rresultHandleMods); + req.request.userdata = x++; + req.send(); + } +} + + +var recsReceivedCalled = false; +function rresultHandleMods(r) { + var rec = r.getResultObject(); + runEvt('result', 'recordReceived', rec, r.userdata, false); + // Don't display copy counts if we're an online-only bib + // FIXME: more robust logic, centralize and remove hardcoded string + if (!rec.online_loc()[0] || rec.online_loc()[0].substring(0,20) != "http://via.tadl.org/") { + resultCollectCopyCounts(rec, r.userdata, FETCH_R_COPY_COUNTS); + } + if(resultPageIsDone() && !recsReceivedCalled) { + recsReceivedCalled = true; + runEvt('result', 'allRecordsReceived', recordsCache); + unHideMe($('copyright_block')); + } +} + +function rresultLaunchDrawn(id, node) { + runEvt("rresult", "recordDrawn", id, node); +} + + +function rresultDoRecordSearch() { + rresultIsPaged = true; + resultCollectSearchIds(true, SEARCH_RS_QUERY, rresultFilterSearchResults ); +} + +function rresultDoRecordMultiSearch() { + rresultIsPaged = true; + resultCollectSearchIds(false, SEARCH_RS_QUERY, rresultFilterSearchResults ); +} + + +function rresultFilterSearchResults(r) { + var result = r.getResultObject(); + var ids = []; + if( result.count > 0 ) { + for( var i = 0; i != result.ids.length; i++ ) + ids.push(result.ids[i][0]); + } + + resultFacetKey = result.facet_key; + resultCompiledSearch = result.compiled_search; + dojo.require('dojo.cookie'); + dojo.cookie(COOKIE_SEARCH, js2JSON(result.compiled_search)); + _rresultHandleIds( ids, result.count ); +} + + +function rresultHandlePlaceHold(target) { + function reload() { + location.href = location.href.replace(/&hold_target=\d+/, ''); + } + attachEvt("common", "holdUpdated", reload); + attachEvt("common", "holdUpdateCanceled", reload); + attachEvt("common", "loginCanceled", reload); + holdsDrawEditor({record:target, type: 'T'}); +} + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/advanced/adv_global_row.xml b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/adv_global_row.xml new file mode 100644 index 0000000000..f5c5ca7dd9 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/adv_global_row.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_global.xml b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_global.xml new file mode 100644 index 0000000000..865aa59ff8 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_global.xml @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_marc.xml b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_marc.xml new file mode 100644 index 0000000000..46fe2879ed --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_marc.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + +
&opac.advanced.marc.title;
+ &opac.advanced.marc.tag;: + + + &opac.advanced.marc.subfield;: + + + &opac.advanced.marc.value;: + + + +
+ + + + +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_quick.xml b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_quick.xml new file mode 100644 index 0000000000..3f7da6ff5e --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/advanced/advanced_quick.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + +
&opac.advanced.quick.title;
+ &common.call.number.label; + + + + &common.isbn.label; + + + + &common.issn.label; + + +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/body.xml b/Open-ILS/web/opac/skin/tadlv3/xml/body.xml new file mode 100644 index 0000000000..a8fd0199a2 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/body.xml @@ -0,0 +1,42 @@ + + + + + + + + +
+ + + +
+ + + + + + + + + + + +
+
+ +
+ + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/altcanvas.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/altcanvas.xml new file mode 100644 index 0000000000..97448daa77 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/altcanvas.xml @@ -0,0 +1,37 @@ + + + +
+ + + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/cn_browse.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/cn_browse.xml new file mode 100644 index 0000000000..aea7fa171f --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/cn_browse.xml @@ -0,0 +1,34 @@ +
+
&common.cn.loading;
+
+ + +
+ &common.cn.browsing; +
+ + + + + + + + + + + + + +
&common.cn.previous;&common.cn.shelf;&common.cn.next;
+ +
+ + +
+
+
+
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/css_common.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/css_common.xml new file mode 100644 index 0000000000..ba1495bc23 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/css_common.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/fonts.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/fonts.xml new file mode 100644 index 0000000000..c7ebef3801 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/fonts.xml @@ -0,0 +1,25 @@ +
+ +
+ &common.textsize.title; + &common.textsize.regular; + &common.textsize.separator; + &common.textsize.large; +  |  + &common.language; + + + +
+ +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/format_selector.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/format_selector.xml new file mode 100644 index 0000000000..6d329a9a3c --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/format_selector.xml @@ -0,0 +1,11 @@ + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/holds.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/holds.xml new file mode 100644 index 0000000000..4930ab73ec --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/holds.xml @@ -0,0 +1,251 @@ +
+
+
+ + + + + + + + + + +
&opac.holds.xulRecipient;:
+
+
+ +
+


+ &common.hold.check; +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&common.hold.create;
&opac.holds.recipient;:
&common.title.label;
&common.author;
&common.format;
&common.physical.label;
&common.mono_parts.label; + + +
&common.call.number.label;
&common.copy.barcode.label;
&common.issuance_label.label;
&common.hold.type.label;&common.hold.volume;&common.hold.copy;&common.hold.issuance;
&opac.holds.contactPhone;: + + &common.phone.format; +
&common.phone.enable; + +
&opac.holds.contactEmail;: + + &common.email.none;
+ &common.email.set; +
+ + &common.email.none; + + +
&common.email.enable; + +
&opac.holds.pickupLocation; + +
&opac.holds.expire_time; + +
+ &opac.holds.freeze; + &common.help; + + +
+ + &opac.holds.freeze.thaw_date; + + +
+ +
+
+ &common.format.alternatives; + &common.help; +
+
&common.control.click;
+
+ +
+ + + + +
+ +
&opac.holds.success;
+
&opac.holds.failure;
+ + &common.phone.format.help; + + + + &common.hold.failed; + + &opac.hold.has_parts; + +
+ + + &opac.search.books; + &opac.search.largePrint; + &opac.search.audioBooks; + &opac.search.videoRecordings; + &opac.search.music; + &opac.search.electronic; + + + &holds.advanced_options; + + &common.hold.delivery; + + &common.hold.exists; + &common.hold.checked_out; + + &common.hold.exists.override; + &common.hold.checked_out.override; + + &common.hold.barred; + + &common.hold.item.invalid; + + &common.hold.patron.invalid; + +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/ilsevents.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/ilsevents.xml new file mode 100644 index 0000000000..dcef13f28b --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/ilsevents.xml @@ -0,0 +1,14 @@ + + &ilsevent.1000; + &ilsevent.1001; + &ilsevent.1002; + &ilsevent.1200; + &ilsevent.5000; + &ilsperm.CREATE_HOLD; + + + &opac.session_expiring; + &opac.session_expired; + &common.user_not_found; + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/js_common.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/js_common.xml new file mode 100644 index 0000000000..ab8edbb55e --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/js_common.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/libselect.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/libselect.xml new file mode 100644 index 0000000000..45a7da780c --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/libselect.xml @@ -0,0 +1,15 @@ + + + + + &library.select; + + + + + &library.select.help; + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/login.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/login.xml new file mode 100644 index 0000000000..e59ba2985e --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/login.xml @@ -0,0 +1,115 @@ + +
+ + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&login.password;
+ &login.first.time; + &common.password_criteria; +
&login.password.current.enter;
&login.password.new.enter;
&login.password.new.reenter;

+ +
+ + &login.password.nomatch; + &login.password.success; + + + &login.password.strength; + &common.password_criteria; + + + &login.barcode.inactive; + + &login.account.inactive; + + &login.failed; + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/logo.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/logo.xml new file mode 100644 index 0000000000..8164ab4343 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/logo.xml @@ -0,0 +1,4 @@ +
+ + +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/orgtree.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/orgtree.xml new file mode 100644 index 0000000000..d4008d3f68 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/orgtree.xml @@ -0,0 +1,27 @@ + + +
+ + + +

&common.org.loading;
+
+
&common.org.note; + &common.org.notetext; +
+
+
+
+
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/searchbar.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/searchbar.xml new file mode 100644 index 0000000000..1638370e78 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/searchbar.xml @@ -0,0 +1,96 @@ + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/sidebar.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/sidebar.xml new file mode 100644 index 0000000000..f1f4d363fe --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/sidebar.xml @@ -0,0 +1,178 @@ + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/statusbar.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/statusbar.xml new file mode 100644 index 0000000000..237be6264b --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/statusbar.xml @@ -0,0 +1,28 @@ + +
+ + + + + + + + +
+ + + + + &status.results; + + + + + +
+ + + +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/stypes_selector.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/stypes_selector.xml new file mode 100644 index 0000000000..588030c63a --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/stypes_selector.xml @@ -0,0 +1,8 @@ + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/common/tips.xml b/Open-ILS/web/opac/skin/tadlv3/xml/common/tips.xml new file mode 100644 index 0000000000..84919f54e1 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/common/tips.xml @@ -0,0 +1,8 @@ + +
+
+ &common.tips.tip1; + &common.tips.tip2; +
+ &tips.label; +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/footer.xml b/Open-ILS/web/opac/skin/tadlv3/xml/footer.xml new file mode 100644 index 0000000000..7beb8fa240 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/footer.xml @@ -0,0 +1,16 @@ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/header.xml b/Open-ILS/web/opac/skin/tadlv3/xml/header.xml new file mode 100644 index 0000000000..3f312b4836 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/header.xml @@ -0,0 +1,15 @@ + + + + + + + &<!--#echo var="OILS_TITLE"-->; + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/home/homesearch.xml b/Open-ILS/web/opac/skin/tadlv3/xml/home/homesearch.xml new file mode 100644 index 0000000000..13b0c59a2b --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/home/homesearch.xml @@ -0,0 +1,135 @@ + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/home/index_body.xml b/Open-ILS/web/opac/skin/tadlv3/xml/home/index_body.xml new file mode 100644 index 0000000000..b5fff2472e --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/home/index_body.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + +
+
+ + +
+
+ + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/html_xsl.xml b/Open-ILS/web/opac/skin/tadlv3/xml/html_xsl.xml new file mode 100644 index 0000000000..f22332079d --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/html_xsl.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/index.xml b/Open-ILS/web/opac/skin/tadlv3/xml/index.xml new file mode 100644 index 0000000000..f3e84e5f10 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/index.xml @@ -0,0 +1,21 @@ + + + + + + +]> + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_bookbags.xml b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_bookbags.xml new file mode 100644 index 0000000000..d4c6d3f3d3 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_bookbags.xml @@ -0,0 +1,136 @@ + +
+ + + +
+ &myopac.delete.bookbag; +
+ +
&myopac.no.bookbags;
+ +
+ &myopac.bookbags.title; + +
+ + + + + + + + + + + + + + + + +
&common.name;&myopac.bookbag.items;&myopac.bookbag.shared;&myopac.bookbag.toggle;&myopac.bookbag.delete;
+ + &myopac.items; + &common.no; + &common.yes; + &myopac.view; + + &myopac.atom.feed; + +
&myopac.bookbag.refworks; +
+ &myopac.bookbag.hide; + &myopac.bookbag.share; + + &myopac.delete; +
+ + + + + + + + + + + + + +
&myopac.bookbag.create;
+ &myopac.bookbag.naming; + +
+ &myopac.bookbag.share; + &common.help; + &common.yes; + &common.no; + +
+ + +
+ +
&myopac.bookbag.no.items;
+ + + + + + + + + + + + + +
&common.title; &common.authors; &myopac.bookbag.remove;
&myopac.remove.link;
+ + + + &myopac.publish.text; + + + + &myopac.item.confirm; + + + + &myopac.publish.confirm; + + + + &myopac.unpublish.confirm; + + + + &myopac.update.success; + + + + &myopac.create.warning; + + + + &myopac.describe.bookbags; + + + + &myopac.updated.success; + + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_checked.xml b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_checked.xml new file mode 100644 index 0000000000..5d00be1aab --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_checked.xml @@ -0,0 +1,107 @@ + +
+ + + + + + + + + +
+ + &myopac.checked.out; 0 / + &myopac.checked.overdue; 0 + + +
&myopac.checked.renewing;
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&common.title;&common.author;&myopac.fines.due;&myopac.checked.renew.remaining;&common.select; + (&common.all;/&common.none;) +
&myopac.checked.noitems;
&common.loading;
+ + + +
+ +
+
+
&myopac.common.other.circ;
+ + + + + + + + + + + + +
&myopac.checked.circ.lib;&myopac.checked.item.type;&myopac.checked.circ.time;
+ + +
+
+ +
&myopac.checked.renew.success;
+ + &myopac.checked.renew.confirm; + + &myopac.checked.renew.fail; + + &myopac.checked.renew.fail2; + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_fines.xml b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_fines.xml new file mode 100644 index 0000000000..0b34c0813d --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_fines.xml @@ -0,0 +1,106 @@ + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
&myopac.fines.title;
&myopac.fines.owed;&myopac.fines.paid;&myopac.fines.balance;
&myopac.fines.status;
&common.currency;&common.currency;&common.currency;
+ + + + + +
+


+ + + + + + + + + + + + + + + + + + + + + + +
&myopac.fines.overdue;
&common.title;&common.author;&myopac.fines.checkout;&myopac.fines.due;&myopac.fines.returned;&myopac.fines.balance;
&myopac.fines.accruing; + &common.currency; +
+
+ + +
+


+ + + + + + + + + + + + + + + + + + + + + + + +
&myopac.fines.other;
&myopac.fines.time.start;&myopac.fines.time.paid;&myopac.fines.owed.initial;&myopac.fines.paid.amount;&myopac.fines.balance;&myopac.fines.type;
&common.currency;&common.currency; + * + &common.currency; +
+
+ +
+ +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_holds.xml b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_holds.xml new file mode 100644 index 0000000000..08d16906d1 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_holds.xml @@ -0,0 +1,123 @@ + +
+ + + + + + +
+ +
+ + &myopac.holds.cancel.confirm; + &myopac.holds.freeze.confirm; + &myopac.holds.thaw.confirm; + &myopac.holds.thaw_date.confirm; + &myopac.holds.freeze.select_thaw; + + + +
&myopac.holds.processing;
+ +
+
&myopac.holds.freeze.select_thaw;
+

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&common.title;&common.author;&myopac.holds.formats;&myopac.holds.location;&common.status;&myopac.holds.estimated_wait;&myopac.holds.unfrozen;&myopac.holds.frozen.until;&opac.holds.expire_time;&common.select; + (&common.all;/&common.none;) + &myopac.holds.edit;
&myopac.holds.status.none;
&myopac.loading;
+ +
+
+
+
+
+
+ + + &myopac.holds.status.waiting; + &myopac.holds.status.intransit; + &myopac.holds.status.available; + + + + + + &common.no; + &common.yes; + + &myopac.holds.edit; +
+ + + &myopac.holds.verify; + + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_prefs.xml b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_prefs.xml new file mode 100644 index 0000000000..0687aa6294 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_prefs.xml @@ -0,0 +1,105 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ &myopac.prefs.title; +
&myopac.loading;
&myopac.prefs.hits; + +
&myopac.prefs.font; + +
+ &myopac.prefs.holds.notify; + &common.help; + + +
&myopac.prefs.search.location; +
+ &myopac.prefs.search.home; +
+ +
&myopac.prefs.search.range; + +

+ +
+ +
&myopac.prefs.save.success;
+
&myopac.prefs.save.failed;
+ + &myopac.prefs.help; + + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_summary.xml b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_summary.xml new file mode 100644 index 0000000000..821f870db7 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/myopac/myopac_summary.xml @@ -0,0 +1,311 @@ + +
+ + +
+ + + + + + +
+ &myopac.summary.expired; +
+
+ +
+ + + + + + + + + + + +
&myopac.summary.notes;
+ : +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&common.name; + + + + + +
&myopac.summary.phone.day;
&myopac.summary.phone.evening;
&myopac.summary.phone.other;
&common.username; &myopac.summary.change;
+ + + + + + + + + + +
&myopac.summary.password.current;
&myopac.summary.username.enter;
+ + + + + + + +
&common.password;&myopac.summary.password.text;&myopac.summary.change;
+ + + + + + + + + + + + + + +
&myopac.summary.password.current;
&myopac.summary.password.new;
&myopac.summary.password.reenter;
+ + + + + + + +
&myopac.summary.email; &myopac.summary.change;
+ + + + + + + + + + +
&myopac.summary.password.current;
&myopac.summary.email.new;
+ + + + + + + +
&myopac.summary.id.primary;
&myopac.summary.barcode;
&myopac.summary.home;
&myopac.summary.genesis;
+ + +


+ + + + + + + + + + + + + + +
&myopac.summary.addresses;&myopac.summary.addresses.pending;
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&myopac.summary.address.type;
&myopac.summary.address.street;
&myopac.summary.address.street;
&myopac.summary.address.city;
&myopac.summary.address.county;
&myopac.summary.address.state;
&myopac.summary.address.country;
&myopac.summary.address.zip;
&myopac.summary.address.invalid;
+ &myopac.summary.address.edit; +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&myopac.summary.address.type;
&myopac.summary.address.street;
&myopac.summary.address.street;
&myopac.summary.address.city;
&myopac.summary.address.county;
&myopac.summary.address.state;
&myopac.summary.address.country;
&myopac.summary.address.zip;
+ Save Changes + Discard Pending Address +
+
+ +
&myopac.summary.username.error;
+
+ &myopac.summary.username.dup; +
+
&myopac.summary.username.success;
+
&myopac.summary.username.failure;
+ +
&myopac.summary.email.error;
+
&myopac.summary.email.success;
+
&myopac.summary.email.failed;
+ +
&myopac.summary.password.error;
+
&myopac.summary.password.success;
+
&myopac.summary.password.failure;
+ &myopac.summary.username.invalid; + Address Saved +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/page_advanced.xml b/Open-ILS/web/opac/skin/tadlv3/xml/page_advanced.xml new file mode 100644 index 0000000000..0218dfb8d2 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/page_advanced.xml @@ -0,0 +1,14 @@ +
+ + + + + +
+ +
+
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/page_cnbrowse.xml b/Open-ILS/web/opac/skin/tadlv3/xml/page_cnbrowse.xml new file mode 100644 index 0000000000..cc2c4a4dcd --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/page_cnbrowse.xml @@ -0,0 +1,6 @@ +
+ + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/page_mresult.xml b/Open-ILS/web/opac/skin/tadlv3/xml/page_mresult.xml new file mode 100644 index 0000000000..b507d425ae --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/page_mresult.xml @@ -0,0 +1,9 @@ +
+ + + + + + +
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/page_myopac.xml b/Open-ILS/web/opac/skin/tadlv3/xml/page_myopac.xml new file mode 100644 index 0000000000..733495b06e --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/page_myopac.xml @@ -0,0 +1,67 @@ +
+ + + + +
&common.loading;
+ + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+ +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/page_rdetail.xml b/Open-ILS/web/opac/skin/tadlv3/xml/page_rdetail.xml new file mode 100644 index 0000000000..40f29e17c2 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/page_rdetail.xml @@ -0,0 +1,94 @@ +
+ + + + + + + + + + + + + + + + + + +
+ + + &rdetail.result; + &common.of; + + + + + &rdetail.start; + &rdetail.page.previous.short; + + &rdetail.page.next.short; + &rdetail.end; + + +
+ + + + + + + + + + +
+ &rdetail.detailMain.headerLabel; + + + &opac.holds.exportRefWorks; + + + &opac.holds.placeHold; + + + + + +
+ +
+ &rdetail.record.deleted; +
+ + +

+ + +
&rdetail.none;
+
&rdetail.bookbag.add.success;
+
+
+ + +
+
&rdetail.bookbag.create.success;
+ +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/page_rresult.xml b/Open-ILS/web/opac/skin/tadlv3/xml/page_rresult.xml new file mode 100644 index 0000000000..201de65258 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/page_rresult.xml @@ -0,0 +1,9 @@ +
+ + + + + + +
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_altcanvas.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_altcanvas.xml new file mode 100644 index 0000000000..ff17d172c3 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_altcanvas.xml @@ -0,0 +1,28 @@ + + +
+ + + +
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_cn_details.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_cn_details.xml new file mode 100644 index 0000000000..f937089394 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_cn_details.xml @@ -0,0 +1,109 @@ + + + + + + + + +
+
+ + &rdetail.print; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
&rdetail.cn.barcode;&common.status;&rdetail.cn.location;&rdetail.cn.part;&rdetail.cn.hold.age;&rdetail.cn.genesis;&rdetail.cn.holdable;&rdetail.cn.due;
+ + &rdetail.cn.more; + &rdetail.cn.less; + &rdetail.cn.hold; + &rdetail.cn.reserve; + &rdetail.cn.multi_home; + &rdetail.cn.disabled; + + + +
+ + + + + + + +
+ &rdetail.cn.note; + &rdetail.cn.category; + + : +
+
+
+
+ +&common.yes; +&common.no; + + +
+
+
+ +
+
+ + + + + + + + + + + + + + +
&common.library;
&common.title;
&common.author;
&common.edition;
&common.pubdate;
&common.publisher;
&common.physical;
&common.callnumber;
+
+
+
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml new file mode 100644 index 0000000000..01e463bf7d --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_copyinfo.xml @@ -0,0 +1,89 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
&rdetail.copyInfo.library;&rdetail.copyInfo.callnumber;&rdetail.copyInfo.copylocation;&rdetail.copyInfo.actions; +
+
+ + &rdetail.copyInfo.print; + + + + + +
&rdetail.loading;
+ + + +

+ +
&rdetail.noneAvailable;
+ + + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml new file mode 100644 index 0000000000..47382b624f --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml @@ -0,0 +1,184 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
&common.loading;
+ + +
+ +
+
+ +
+ + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+ + + + + + +
&common.title; &common.authors;  
+
+ +
+ +
+ &rdetail.extras.call.null; +
+ +
+ &rdetail.extras.call.local; + +
+ + +
+ + + +
+ +
&rdetail.extras.preview.fulltext;
+
&rdetail.extras.preview.title;
+
&rdetail.extras.preview.badge;
+ + + + + + + + + + + + + + + + + +
diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_summary.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_summary.xml new file mode 100644 index 0000000000..90dd95eb8a --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_summary.xml @@ -0,0 +1,245 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
&opac.image_provided;
+ +
+
&common.title; + +
&common.author; + +
&common.isbn;
&common.edition;
&common.pubdate;
&common.publisher;
Series
&common.physical;
&common.format; + + +
&rdetail.detailMain.abstract;
&rdetail.summary.subjects; + +
Current Holds
&rdetail.summary.online; + +
&rdetail.summary.issues_held; + ${holdingsStatement} + +
+ + + + + + + + +
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/result/filtersort.xml b/Open-ILS/web/opac/skin/tadlv3/xml/result/filtersort.xml new file mode 100644 index 0000000000..c8b3327df3 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/result/filtersort.xml @@ -0,0 +1,20 @@ + + &result.limit2avail; + + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/result/result_common.xml b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_common.xml new file mode 100644 index 0000000000..86848ab51f --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_common.xml @@ -0,0 +1,36 @@ + +
+ + + + + + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/result/result_info.xml b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_info.xml new file mode 100644 index 0000000000..902035b808 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_info.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + +
+ + &result.info.copies; + +
+
+ + * + &result.info.no.items; +
&result.info.format.items;
+
+
+ + + + + +
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/result/result_lowhits.xml b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_lowhits.xml new file mode 100644 index 0000000000..0933ed1572 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_lowhits.xml @@ -0,0 +1,49 @@ + +
+ +


+ +
+
&result.lowhits.few;
+
&result.lowhits.zero;
+
+ + +
+ &result.lowhits.did.you.mean; + +
+ +
+ &result.lowhits.formats; + &result.lowhits.formats.search; +
+ +
+ &result.lowhits.related; +
+ +
+
+ +
+ &result.lowhits.expand; + +
+ + + +
+ diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/result/result_table.xml b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_table.xml new file mode 100644 index 0000000000..a1e05e9841 --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/result/result_table.xml @@ -0,0 +1,336 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ + + | + | + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &common.relevancy; + + + + &opac.holds.placeHold; + + + + + + + + + + &result.googleBooks.browse; + + +
+ + = max_items) { + return output.innerHTML; + } + if (vol.getAttribute('deleted') == 't') { + return; + } + if (vol.getAttribute('opac_visible') == 'f') { + return; + } + dojo.query('uri', vol).forEach(function (uri) { + var urihref = uri.getAttribute('href'); + var urilabel = uri.getAttribute('label'); + if (urihref.substring(0,20) == "http://via.tadl.org/") { + var uri_entry = dojo.create('div', {"style":"padding-bottom: 5px;"}); + var link = dojo.create('a', {"class":"css_button", "href": urihref}, uri_entry); + if (urilabel.substring(0,7) == "http://") { + // Provide a default label if label appears to be a URL + urilabel = "Connect to this resource online"; + } + var link_text = dojo.doc.createTextNode(urilabel); + link.appendChild(link_text); + output.appendChild(uri_entry); + } + }); + dojo.query('copy', vol).forEach(function (cp) { + if (item_cnt >= max_items) { + return; + } + if (cp.getAttribute('deleted') == 't') { + return; + } + if (cp.getAttribute('opac_visible') == 'f') { + return; + } + + /* Ensure the status is visible */ + var visible_status; + dojo.query('status', cp).forEach(function (status) { + visible_status = status.getAttribute('opac_visible'); + }); + if (visible_status == 'f') { + return; + } + + /* Ensure the circulation library is visible */ + var lib_vis; + dojo.query('circlib', cp).forEach(function (status) { + lib_vis = status.getAttribute('opac_visible'); + }); + if (lib_vis != 't') { + return; + } + + var cp_entry = dojo.create('div'); + var loc_visible; + var vol_appended = false; + dojo.query('location', cp).forEach(function (location) { + loc_visible = location.getAttribute('opac_visible'); + if (loc_visible == 't') { + 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_visible != 't') { + 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(opac_strings.MORE_COPIES_FULL_RECORD)); + } + output.appendChild(cp_entry); + }); + }); + + return output.innerHTML; + ]]> + +
+ +
+
+
+ + + + + + + + + + + + + +
+ + + &common.results; + + - + + &common.ofAtLeast; + + (page + + &common.of; + + + + + &rdetail.start;&rdetail.page.previous.short; + + + &rdetail.page.next.short; + + + + + +
+ + + + + + + + + + + + + + +
+ + diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/setenv.xml b/Open-ILS/web/opac/skin/tadlv3/xml/setenv.xml new file mode 100644 index 0000000000..e64b27020e --- /dev/null +++ b/Open-ILS/web/opac/skin/tadlv3/xml/setenv.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.11.0