From: Jason Etheridge Date: Fri, 18 Mar 2011 06:13:52 +0000 (-0400) Subject: Add Volumes shortcut in bib summary pane whenever that pane has a full xulG (which... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=243d798b8d0aed350e070ce2f758e111a113240f;p=evergreen%2Fequinox.git Add Volumes shortcut in bib summary pane whenever that pane has a full xulG (which right now, is only in the main opac wrapper) --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 855911a31a..49585ff6a1 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2370,6 +2370,7 @@ + diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index f8155943d0..6dd549dd06 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -89,18 +89,27 @@ function opac_wrapper_set_help_context() { function set_brief_view() { var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ) + '?docid=' + window.escape(docid); dump('spawning ' + url + '\n'); + + var content_params = { + 'set_tab_name' : function(n) { + if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') { + try { window.xulG.set_tab_name(document.getElementById('offlineStrings').getFormattedString("cat.bib_record", [n])); } catch(E) { alert(E); } + } else { + dump('no set_tab_name\n'); + } + } + }; + + ["url_prefix", "new_tab", "set_tab", "close_tab", "new_patron_tab", + "set_patron_tab", "volume_item_creator", "get_new_session", + "holdings_maintenance_tab", "open_chrome_window", "url_prefix", + "network_meter", "page_meter", "set_statusbar", "set_help_context" + ].forEach(function(k) { content_params[k] = xulG[k]; }); + top_pane.set_iframe( url, - {}, - { - 'set_tab_name' : function(n) { - if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') { - try { window.xulG.set_tab_name(document.getElementById('offlineStrings').getFormattedString("cat.bib_record", [n])); } catch(E) { alert(E); } - } else { - dump('no set_tab_name\n'); - } - } - } + {}, + content_params ); } diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js index b4e283e58c..f2328a4ae3 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js @@ -87,6 +87,14 @@ function my_init() { } } +function unhide_add_volumes_button() { + if (xulG && typeof xulG == 'object' && typeof xulG['new_tab'] == 'function') { + document.getElementById('add_volumes').hidden = false; + document.getElementById('add_volumes_left_paren').hidden = false; + document.getElementById('add_volumes_right_paren').hidden = false; + } +} + function view_marc() { try { JSAN.use('util.window'); var win = new util.window(); @@ -114,4 +122,37 @@ function spawn_patron(span) { } } +function add_volumes() { + try { + var edit = 0; + try { + edit = g.network.request( + api.PERM_MULTI_ORG_CHECK.app, + api.PERM_MULTI_ORG_CHECK.method, + [ + ses(), + ses('staff_id'), + [ ses('ws_ou') ], + [ 'CREATE_VOLUME', 'CREATE_COPY' ] + ] + ).length == 0 ? 1 : 0; + } catch(E) { + g.error.sdump('D_ERROR','batch permission check: ' + E); + } + if (edit==0) { + alert(document.getElementById('offlineStrings').getString('staff.circ.copy_status.add_volumes.perm_failure')); + return; // no read-only view for this interface + } + + var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]); + + var w = xulG.new_tab( + window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + { 'tab_name' : title }, + { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] } + ); + } catch(E) { + alert('Error in server/cat/bib_brief.js, add_volumes(): ' + E); + } +} diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.xul b/Open-ILS/xul/staff_client/server/cat/bib_brief.xul index 21c36c8cbb..bce81b73ae 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.xul +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.xul @@ -22,7 +22,7 @@ vim: noet:sw=4:ts=4: @@ -39,7 +39,13 @@ vim: noet:sw=4:ts=4: -