From: Jason Etheridge Date: Wed, 1 Jun 2011 20:25:50 +0000 (-0400) Subject: make unified vol/copy editor honor required stat cats X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=80b76667b9cc04e99f334fb0a2573fc3898e822e;p=evergreen%2Ftadl.git make unified vol/copy editor honor required stat cats Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- 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 0ce4db1bdb..0602c09b33 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -1587,10 +1587,22 @@ g.check_for_unmet_required_fields = function() { abort.push(fn); } } - if (abort.length > 0) { - $('save').setAttribute('disabled','true'); + if (xulG.unified_interface) { + if (abort.length > 0) { + if (typeof xulG.lock_save_button == 'function') { + xulG.lock_save_button(); + } + } else { + if (typeof xulG.unlock_save_button == 'function') { + xulG.unlock_save_button(); + } + } } else { - $('save').setAttribute('disabled','false'); + if (abort.length > 0) { + $('save').setAttribute('disabled','true'); + } else { + $('save').setAttribute('disabled','false'); + } } } diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js index d9c2b2ce7a..303cea0ae6 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js @@ -54,6 +54,14 @@ function my_init() { },0 ); } + xulG.lock_save_button = function() { + g.save_button_locked = true; + document.getElementById("Create").disabled = true; + } + xulG.unlock_save_button = function() { + g.save_button_locked = false; + document.getElementById("Create").disabled = false; + } } else { $('Create').hidden = true; } @@ -359,7 +367,9 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) { document.getElementById("EditThenCreate").disabled = false; document.getElementById("CreateWithDefaults").disabled = false; } else { - document.getElementById("Create").disabled = false; + if (! g.save_button_locked) { + document.getElementById("Create").disabled = false; + } } } @@ -668,7 +678,9 @@ g.render_barcode_entry = function(node,callnumber_composite_key,count,ou_id) { document.getElementById("EditThenCreate").disabled = false; document.getElementById("CreateWithDefaults").disabled = false; } else { - document.getElementById("Create").disabled = false; + if (! g.save_button_locked) { + document.getElementById("Create").disabled = false; + } } }