2016-01-04 21:59:01 +01:00
|
|
|
!function(){"use strict";function a(a,d){a.state("administration",{"abstract":!0,views:{administration:{templateUrl:"administration.html",controller:"AdministrationController",controllerAs:"app"}}}).state("administration.rights",{url:"/rights",views:{module:{templateUrl:"rights.html"}}}).state("administration.rights.edit",{url:"/:userId/:folderId/edit",views:{acl:{templateUrl:"UIxAdministrationAclEditor",controller:"AdministrationAclController",controllerAs:"acl"}},resolve:{stateUser:b,stateFolder:c}}),d.otherwise("/rights")}function b(a,b,c){var d;return d=_.find(c.$users,function(a){return a.uid==b.userId}),angular.isUndefined(d)?c.$filter(b.userId).then(function(e){return d=_.find(c.$users,function(a){return a.uid==b.userId}),angular.isUndefined(d)?a.reject("User with ID "+b.userId+" not found"):d.$folders().then(function(){return d})}):d}function c(a,b,c,d,e,f){var g,h,i=c(b.folderId);return g=_.find(d.$$folders,function(a){return a.name==i}),h="Appointment"==g.type?new f({id:g.name.split("/").pop(),owner:g.owner,name:g.displayName}):new e({id:g.name.split("/").pop(),owner:g.owner,name:g.displayName}),d.selectedFolder=h.id,h}function d(a,b,c){b.$on("$stateChangeError",function(b,d,e,f,g,h){a.error(h),c.go("administration.rights")}),b.$on("$routeChangeError",function(b,c,d,e){a.error(b,c,d,e)})}angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(a).run(d),a.$inject=["$stateProvider","$urlRouterProvider"],b.$inject=["$q","$stateParams","User"],c.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"],d.$inject=["$log","$rootScope","$state"]}(),function(){"use strict";function a(a,b,c,d,e,f){function g(){return angular.isDefined(e.$cards)?"../"+e.owner+"/Contacts/"+e.id+"/UIxContactsUserRightsEditor":"../"+e.owner+"/Calendar/"+e.id+"/UIxCalUserRightsEditor"}function h(a){o.selectedUid==a.uid?o.selectedUid=null:(o.selectedUid=a.uid,o.selectedUser=a,o.selectedUser.$rights())}function i(a){return f.$filter(a,e.$acl.users,{dry:!0})}function j(a){e.$acl.$removeUser(a.uid)["catch"](function(a,b){Dialog.alert(l("Warning"),l("An error occured please try again."))})}function k(a){a&&e.$acl.$addUser(a,e.owner).then(function(){o.userToAdd="",o.searchText=""},function(a){Dialog.alert(l("Warning"),a)})}function m(){b.go("administration.rights").then(function(){delete o.user.selectedFolder,o.user=null})}function n(){e.$acl.$saveUsersRights(e.owner).then(function(){c.show(c.simple().content(l("ACLs saved")).position("top right").hideDelay(3e3))},function(a,b){Dialog.alert(l("Warning"),l("An error occured please try again."))})}var o=this;o.user=d,o.folder=e,o.folderType=angular.isDefined(e.$cards)?"AddressBook":"Calendar",o.selectedUser=null,o.selectedUid=null,o.selectUser=h,o.removeUser=j,o.getTemplate=g,o.close=m,o.save=n,o.userToAdd="",o.searchText="",o.userFilter=i,o.addUser=k,e.$acl.$users(e.owner).then(function(a){o.users=a})}a.$inject=["$animate","$state","$mdToast","stateUser","stateFolder","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",a)}(),function(){"use strict";function a(a,b,c,d,e){function f(b){a.go("administration."+b)}function g(a){e.$filter(a)}function h(a){j.selectedUser==j.users[a]?j.selectedUser=null:j.users[a].$folders().then(function(){j.selectedUser=j.users[a]})}function i(b){a.go("administration.rights.edit",{userId:j.selectedUser.uid,folderId:d(b.name)})}var j=this;j.service=e,j.selectedUser=null,j.users=e.$users,j.go=f,j.filter=g,j.selectUser=h,j.selectFolder=i}a.$inject=["$state","$mdToast","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",a)}();
|