quicker entry point for Add Volumes action, by virtue of assuming Workstation Library
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Jan 2010 21:30:10 +0000 (21:30 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Jan 2010 21:30:10 +0000 (21:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15290 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties

index 926d124..3035ceb 100644 (file)
@@ -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);
+    }
+}
index 14710e4..d03f7a6 100644 (file)
@@ -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/>
index ccecb88..fd9b5b9 100644 (file)
@@ -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