From: erickson Date: Mon, 25 Aug 2008 22:09:08 +0000 (+0000) Subject: added work-org version of checkDisabled X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=56cd3a808d21f7a8c91c443cc3523b908cfebaf8;p=Evergreen.git added work-org version of checkDisabled git-svn-id: svn://svn.open-ils.org/ILS/trunk@10445 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/admin/adminlib.js b/Open-ILS/xul/staff_client/server/admin/adminlib.js index a61b66c94e..35af359d42 100644 --- a/Open-ILS/xul/staff_client/server/admin/adminlib.js +++ b/Open-ILS/xul/staff_client/server/admin/adminlib.js @@ -118,6 +118,22 @@ function checkDisabled( node, itemOrg, perm ) { if( mydepth != -1 && mydepth <= itemDepth ) node.disabled = false; } +/** + * If the item-related org unit (owner, etc.) is one of or + * or a child of any of the perm-orgs related to the + * provided permission, enable the requested node + */ +function checkPermOrgDisabled(node, itemOrg, perm) { + var org_list = OILS_WORK_PERMS[perm]; + if(org_list.length > 0) { + for(var i = 0; i < org_list.length; i++) { + var highPermOrg = findOrgUnit(org_list[i]); + if(orgIsMine(highPermOrg, findOrgUnit(itemOrg))) + node.disabled = false; + } + } +} + function fetchOrgUnit(id, callback) {