in unified vol/copy editor disallow editing of item attributes when no copies except...
authorJason Etheridge <jason@esilibrary.com>
Fri, 17 Jun 2011 05:27:11 +0000 (01:27 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 7 Jul 2011 15:14:19 +0000 (11:14 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/xul/staff_client/server/cat/copy_editor.js

index 3991283..d5018f2 100644 (file)
@@ -65,12 +65,11 @@ function my_init() {
 
         if (xul_param('edit',{'modal_xulG':true}) == '1') { 
 
-            g.edit = true;
+            g.edit = false;
 
             if (g.copies.length > 0) { // When loaded in the unified interface, there may be no copies yet (from the volum/item creator) 
 
                 // Editor desired, but let's check permissions
-                g.edit = false;
 
                 try {
                     var check = g.network.simple_request(
@@ -114,11 +113,12 @@ function my_init() {
             if (g.edit) {
                 $('caption').setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.caption')); 
                 $('save').setAttribute('hidden','false'); 
-                g.retrieve_templates();
             } else {
                 $('top_nav').setAttribute('hidden','true');
             }
 
+            g.retrieve_templates();
+
         } else {
             $('top_nav').setAttribute('hidden','true');
         }
@@ -167,6 +167,10 @@ function my_init() {
             xulG.refresh_copy_editor = function() {
                 try {
                     g.copies = xulG.copies;
+                    g.edit = g.copies.length > 0;
+                    if (g.edit) {
+                        $('caption').setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.caption'));
+                    }
                     g.original_copies = js2JSON( g.copies );
                     g.hide_copy_notes_button();
                     for (var i = 0; i < g.applied_templates.length; i++) {