| 1 |
- this.org={listSubGroup:function(t,n){getOrgActions();var i={groupList:getNameFlag(t)};var e=null;if(n){orgActions.listSubGroupNested(i,function(t){e=t.data},null,false)}else{orgActions.listSubGroupDirect(i,function(t){e=t.data},null,false)}return e},listSupGroup:function(t,n){getOrgActions();var i={groupList:getNameFlag(t)};var e=null;if(n){orgActions.listSupGroupNested(i,function(t){e=t.data},null,false)}else{orgActions.listSupGroupDirect(i,function(t){e=t.data},null,false)}return e},listGroupWithPerson:function(t){getOrgActions();var n={personList:getNameFlag(t)};var i=null;orgActions.listGroupWithPerson(n,function(t){i=t.data},null,false);return i},groupHasRole:function(t,n){getOrgActions();nameFlag=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var i={group:nameFlag,roleList:getNameFlag(n)};var e=false;orgActions.groupHasRole(i,function(t){e=t.data.value},null,false);return e},getRole:function(t){getOrgActions();var n={roleList:getNameFlag(t)};var i=null;orgActions.listRole(n,function(t){i=t.data},null,false);return i&&i.length===1?i[0]:i},listRoleWithPerson:function(t){getOrgActions();var n={personList:getNameFlag(t)};var i=null;orgActions.listRoleWithPerson(n,function(t){i=t.data},null,false);return i},personHasRole:function(t,n){getOrgActions();nameFlag=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var i={person:nameFlag,roleList:getNameFlag(n)};var e=false;orgActions.personHasRole(i,function(t){e=t.data.value},null,false);return e},listSubPerson:function(t,n){getOrgActions();var i={personList:getNameFlag(t)};var e=null;if(n){orgActions.listPersonSubNested(i,function(t){e=t.data},null,false)}else{orgActions.listPersonSubDirect(i,function(t){e=t.data},null,false)}return e},listSupPerson:function(t,n){getOrgActions();var i={personList:getNameFlag(t)};var e=null;if(n){orgActions.listPersonSupNested(i,function(t){e=t.data},null,false)}else{orgActions.listPersonSupDirect(i,function(t){e=t.data},null,false)}return e},listPersonWithGroup:function(t){getOrgActions();var n={groupList:getNameFlag(t)};var i=null;orgActions.listPersonWithGroup(n,function(t){i=t.data},null,false);return i},listPersonWithRole:function(t){getOrgActions();var n={roleList:getNameFlag(t)};var i=null;orgActions.listPersonWithRole(n,function(t){i=t.data},null,false);return i},listPersonWithIdentity:function(t){getOrgActions();var n={identityList:getNameFlag(t)};var i=null;orgActions.listPersonWithIdentity(n,function(t){i=t.data},null,false);return i},getPersonWithIdentity:function(t){getOrgActions();var n={identityList:getNameFlag(t)};var i=null;orgActions.listPersonWithIdentity(n,function(t){i=t.data},null,false);return i&&i.length===1?i[0]:i},listPersonWithUnit:function(t,n){getOrgActions();var i={unitList:getNameFlag(t)};var e=null;if(n){orgActions.listPersonWithUnitNested(i,function(t){e=t.data},null,false)}else{orgActions.listPersonWithUnitDirect(i,function(t){e=t.data},null,false)}return e},appendPersonAttribute:function(t,n,i){getOrgActions();var e=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var a={attributeList:i,name:n,person:e};orgActions.appendPersonAttribute(a,function(t){if(t.data.value){if(success)success()}else{if(failure)failure(null,"","append values failed")}},function(t,n,i){if(failure)failure(t,n,i)},false)},setPersonAttribute:function(t,n,i){getOrgActions();var e=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var a={attributeList:i,name:n,person:e};orgActions.setPersonAttribute(a,function(t){if(t.data.value){if(success)success()}else{if(failure)failure(null,"","append values failed")}},function(t,n,i){if(failure)failure(t,n,i)},false)},getPersonAttribute:function(t,n){getOrgActions();var i=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var e={name:n,person:i};var a=null;orgActions.getPersonAttribute(e,function(t){a=t.data.attributeList},null,false);return a},listPersonAttributeName:function(t){getOrgActions();var n={personList:getNameFlag(t)};var i=null;orgActions.listPersonAttributeName(n,function(t){i=t.data.nameList},null,false);return i},listPersonAllAttribute:function(t){getOrgActions();var n={personList:getNameFlag(t)};var i=null;orgActions.listPersonAllAttribute(n,function(t){i=t.data},null,false);return i},getUnit:function(t){getOrgActions();var n={unitList:getNameFlag(t)};var i=null;orgActions.listUnit(n,function(t){i=t.data},null,false);return i&&i.length===1?i[0]:i},listSubUnit:function(t,n){getOrgActions();var i={unitList:getNameFlag(t)};var e=null;if(n){orgActions.listUnitSubNested(i,function(t){e=t.data},null,false)}else{orgActions.listUnitSubDirect(i,function(t){e=t.data},null,false)}return e},listSupUnit:function(t,n){getOrgActions();var i={unitList:getNameFlag(t)};var e=null;if(n){orgActions.listUnitSupNested(i,function(t){e=t.data},null,false)}else{orgActions.listUnitSupDirect(i,function(t){e=t.data},null,false)}return e},getUnitByIdentity:function(t,n){getOrgActions();var i="current";var e;if(n){if(typeOf(n)==="string")i="type";if(typeOf(n)==="number")i="level"}switch(i){case"current":var a={identityList:getNameFlag(t)};orgActions.f(a,function(t){e=t.data},null,false);break;case"type":var a={identity:typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t,type:n};orgActions.getUnitWithIdentityAndType(a,function(t){e=t.data},null,false);break;case"level":var a={identity:typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t,level:n};orgActions.getUnitWithIdentityAndLevel(a,function(t){e=t.data},null,false);break}return e},listAllSupUnitWithIdentity:function(t){getOrgActions();var n={identityList:getNameFlag(t)};var i=null;orgActions.listUnitSupNestedWithIdentity(n,function(t){i=t.data},null,false);return i},listUnitWithPerson:function(t){getOrgActions();var n={personList:getNameFlag(t)};var i=null;orgActions.listUnitWithPerson(n,function(t){i=t.data},null,false);return i},listAllSupUnitWithPerson:function(t){getOrgActions();var n={personList:getNameFlag(t)};var i=null;orgActions.listUnitSupNestedWithPerson(n,function(t){i=t.data},null,false);return i},listUnitWithAttribute:function(t,n){getOrgActions();var i={name:t,attribute:n};var e=null;orgActions.listUnitWithAttribute(i,function(t){e=t.data},null,false);return e},listUnitWithDuty:function(t,n){getOrgActions();var i={name:t,identity:typeOf(n)==="object"?n.distinguishedName||n.id||n.unique||n.name:n};var e=null;orgActions.listUnitWithDuty(i,function(t){e=t.data},null,false);return e},getDuty:function(t,n){getOrgActions();var i={name:t,unit:typeOf(n)==="object"?n.distinguishedName||n.id||n.unique||n.name:n};var e=null;orgActions.getDuty(i,function(t){e=t.data},null,false);return e},listDutyNameWithIdentity:function(t){getOrgActions();var n={identityList:getNameFlag(t)};var i=null;orgActions.listDutyNameWithIdentity(n,function(t){i=t.data.nameList},null,false);return i},listDutyNameWithUnit:function(t){getOrgActions();var n={unitList:getNameFlag(t)};var i=null;orgActions.listDutyNameWithUnit(n,function(t){i=t.data.nameList},null,false);return i},listUnitAllDuty:function(t){getOrgActions();var n={unitList:getNameFlag(t)};var i=null;orgActions.listUnitAllDuty(n,function(t){i=t.data},null,false);return i},listTopUnit:function(){var t=MWF.Actions.get("x_organization_assemble_control");var n=null;t.listTopUnit(function(t){n=t.data},null,false);return n},appendUnitAttribute:function(t,n,i){getOrgActions();var e=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var a={attributeList:i,name:n,unit:e};orgActions.appendUnitAttribute(a,function(t){if(t.data.value){if(success)success()}else{if(failure)failure(null,"","append values failed")}},function(t,n,i){if(failure)failure(t,n,i)},false)},setUnitAttribute:function(t,n,i){getOrgActions();var e=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var a={attributeList:i,name:n,unit:e};orgActions.setUnitAttribute(a,function(t){if(t.data.value){if(success)success()}else{if(failure)failure(null,"","append values failed")}},function(t,n,i){if(failure)failure(t,n,i)},false)},getUnitAttribute:function(t,n){getOrgActions();var i=typeOf(t)==="object"?t.distinguishedName||t.id||t.unique||t.name:t;var e={name:n,unit:i};var a=null;orgActions.getUnitAttribute(e,function(t){a=t.data.attributeList},null,false);return a},listUnitAttributeName:function(t){getOrgActions();var n={unitList:getNameFlag(t)};var i=null;orgActions.listUnitAttributeName(n,function(t){i=t.data.nameList},null,false);return i},listUnitAllAttribute:function(t){getOrgActions();var n={unitList:getNameFlag(t)};var i=null;orgActions.listUnitAllAttribute(n,function(t){i=t.data},null,false);return i}};
|