From: pines Date: Mon, 25 Sep 2006 13:55:25 +0000 (+0000) Subject: don't allow volumes to be added to orgs with can_have_vols == false X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=845a6564efcf71233d003945385bf6a0f252bd45;p=Evergreen.git don't allow volumes to be added to orgs with can_have_vols == false git-svn-id: svn://svn.open-ils.org/ILS/trunk@6208 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index 6835cfa100..c203f1913e 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -1391,10 +1391,15 @@ cat.copy_browser.prototype = { var obj = this; try { var found_aou = false; var found_acn = false; var found_acp = false; + var found_aou_with_can_have_vols = false; for (var i = 0; i < obj.sel_list.length; i++) { var type = obj.sel_list[i].split(/_/)[0]; switch(type) { - case 'aou' : found_aou = true; break; + case 'aou' : + found_aou = true; + var org = obj.data.hash.aou[ obj.sel_list[i].split(/_/)[1] ]; + if ( get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) found_aou_with_can_have_vols = true; + break; case 'acn' : found_acn = true; break; case 'acp' : found_acp = true; break; } @@ -1416,7 +1421,7 @@ cat.copy_browser.prototype = { obj.controller.view.sel_patron.setAttribute('disabled','true'); obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true'); obj.controller.view.sel_mark_items_missing.setAttribute('disabled','true'); - if (found_aou) { + if (found_aou && found_aou_with_can_have_vols) { obj.controller.view.cmd_add_volumes.setAttribute('disabled','false'); obj.controller.view.cmd_mark_library.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 1098eb5088..e0beb8a34d 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 @@ -96,9 +96,12 @@ function my_init() { var node_id = 0; for (var i = 0; i < ou_ids.length; i++) { try { - var row = document.createElement('row'); rows.appendChild(row); row.setAttribute('ou_id',ou_ids[i]); - g.render_library_label(row,ou_ids[i]); - g.render_volume_count_entry(row,ou_ids[i]); + var org = g.data.hash.aou[ ou_ids[i] ]; + if ( get_bool( g.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) { + var row = document.createElement('row'); rows.appendChild(row); row.setAttribute('ou_id',ou_ids[i]); + g.render_library_label(row,ou_ids[i]); + g.render_volume_count_entry(row,ou_ids[i]); + } } catch(E) { g.error.sdump('D_ERROR',E); }