[open-ils-commits] r10445 - trunk/Open-ILS/xul/staff_client/server/admin

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 25 18:09:13 EDT 2008


Author: erickson
Date: 2008-08-25 18:09:08 -0400 (Mon, 25 Aug 2008)
New Revision: 10445

Modified:
   trunk/Open-ILS/xul/staff_client/server/admin/adminlib.js
Log:
added work-org version of checkDisabled

Modified: trunk/Open-ILS/xul/staff_client/server/admin/adminlib.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/adminlib.js	2008-08-25 21:58:07 UTC (rev 10444)
+++ trunk/Open-ILS/xul/staff_client/server/admin/adminlib.js	2008-08-25 22:09:08 UTC (rev 10445)
@@ -118,7 +118,23 @@
 	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) {
 
 	if(ORG_CACHE[id]) return ORG_CACHE[id];



More information about the open-ils-commits mailing list