From 8f2719225d2d951554b97209fa5d3a784f38efda Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 17 Jun 2011 01:27:11 -0400 Subject: [PATCH] in unified vol/copy editor disallow editing of item attributes when no copies except via templates Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- Open-ILS/xul/staff_client/server/cat/copy_editor.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 399128389b..d5018f2d4d 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -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++) { -- 2.11.0