[open-ils-commits] r11790 - trunk/Open-ILS/web/js/dojo/openils
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jan 9 16:50:00 EST 2009
Author: erickson
Date: 2009-01-09 16:49:55 -0500 (Fri, 09 Jan 2009)
New Revision: 11790
Modified:
trunk/Open-ILS/web/js/dojo/openils/User.js
Log:
fixed logic bug in non-idlist version
Modified: trunk/Open-ILS/web/js/dojo/openils/User.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/User.js 2009-01-09 20:10:29 UTC (rev 11789)
+++ trunk/Open-ILS/web/js/dojo/openils/User.js 2009-01-09 21:49:55 UTC (rev 11790)
@@ -184,20 +184,22 @@
getPermOrgList : function(permList, onload, includeDescendents, idlist) {
if(typeof permList == 'string') permList = [permList];
+ console.log('loading org perms ' + permList + ' for user ' + this.user.id());
var oncomplete = function(r) {
var permMap = openils.Util.readResponse(r);
var orgList = [];
for(var perm in permMap) {
var permOrgList = permMap[perm];
- if(includeDescendents) {
- for(var i in permOrgList) {
+ for(var i in permOrgList) {
+ if(includeDescendents) {
orgList = orgList.concat(
fieldmapper.aou.descendantNodeList(permOrgList[i]));
+ } else {
+ orgList = orgList.concat(fieldmapper.aou.findOrgUnit(permOrgList[i]));
}
- } else {
- orgList = orgList.concat(permOrgList);
}
}
+
// remove duplicates
var trimmed = [];
for(var idx in orgList) {
More information about the open-ils-commits
mailing list