From b26bc773594dd1f21c100d63ef14e05dc5e36528 Mon Sep 17 00:00:00 2001 From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Fri, 8 Jan 2010 21:30:10 +0000 Subject: [PATCH] quicker entry point for Add Volumes action, by virtue of assuming Workstation Library git-svn-id: svn://svn.open-ils.org/ILS/trunk@15290 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/cat/opac.js | 35 ++++++++++++++++++++++ .../xul/staff_client/chrome/content/cat/opac.xul | 2 ++ .../chrome/locale/en-US/offline.properties | 2 ++ 3 files changed, 39 insertions(+) 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 926d12418b..3035ceb941 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -436,4 +436,39 @@ function set_default() { } } +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]); + JSAN.use('util.window'); var win = new util.window(); + var w = win.open( + window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR), + title, + 'chrome,resizable', + { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] } + ); + } catch(E) { + alert('Error in chrome/content/cat/opac.js, add_volumes(): ' + E); + } +} diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul index 14710e4bd1..d03f7a64f9 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul @@ -55,6 +55,8 @@ <menuitem label="&staff.cat.opac.delete_record.label;" accesskey="&staff.cat.opac.delete_record.accesskey;" id="delete_record" oncommand="delete_record();"/> <menuitem label="&staff.cat.opac.undelete_record.label;" accesskey="&staff.cat.opac.undelete_record.accesskey;" id="undelete_record" oncommand="undelete_record();"/> <menuseparator/> + <menuitem label="&staff.cat.copy_browser.holdings_maintenance.cmd_add_volumes.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.cmd_add_volumes.accesskey;" id="add_volumes" oncommand="add_volumes();"/> + <menuseparator/> <menuitem label="&staff.cat.opac.bib_in_new_tab.label;" id="bib_in_new_tab" oncommand="bib_in_new_tab();"/> <menuitem label="&staff.cat.opac.remove_me.label;" id="remove_me" oncommand="remove_me();"/> <menuseparator/> diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index ccecb88b79..fd9b5b9c45 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -248,3 +248,5 @@ staff.cat.util.copy_editor.batch_edit=Batch Edit staff.cat.util.copy_editor.batch_view=Batch View staff.cat.util.copy_editor.edit=Edit staff.cat.util.copy_editor.view=View +staff.circ.copy_status.add_volumes.perm_failure=You do not have permission to add volumes to the workstation library. +staff.circ.copy_status.add_volumes.title=Add Volume/Item for Record # %1$s -- 2.11.0