2016-05-18 22:08:56 +02: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,g){function h(){return angular.isDefined(f.$cards)?"../"+f.owner+"/Contacts/"+f.id+"/UIxContactsUserRightsEditor":"../"+f.owner+"/Calendar/"+f.id+"/UIxCalUserRightsEditor"}function i(a){p.selectedUid==a.uid?p.selectedUid=null:(p.selectedUid=a.uid,p.selectedUser=a,p.selectedUser.$rights())}function j(a){return g.$filter(a,f.$acl.users,{dry:!0})}function k(a){f.$acl.$removeUser(a.uid)["catch"](function(a,b){Dialog.alert(l("Warning"),l("An error occured please try again."))})}function m(a){a&&f.$acl.$addUser(a,f.owner).then(function(){p.userToAdd="",p.searchText=""},function(a){Dialog.alert(l("Warning"),a)})}function n(){b.go("administration.rights").then(function(){delete p.user.selectedFolder,p.user=null})}function o(){f.$acl.$saveUsersRights(f.owner).then(function(){d.show(d.simple().content(l("ACLs saved")).position("top right").hideDelay(3e3)),c("xs")&&n()},function(a,b){Dialog.alert(l("Warning"),l("An error occured please try again."))})}var p=this;p.user=e,p.folder=f,p.folderType=angular.isDefined(f.$cards)?"AddressBook":"Calendar",p.selectedUser=null,p.selectedUid=null,p.selectUser=i,p.removeUser=k,p.getTemplate=h,p.close=n,p.save=o,p.userToAdd="",p.searchText="",p.userFilter=j,p.addUser=m,f.$acl.$users(f.owner).then(function(a){p.users=a})}a.$inject=["$animate","$state","$mdMedia","$mdToast","stateUser","stateFolder","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g,h){function i(b){a.go("administration."+b),c(e["gt-md"])||d("left").close()}function j(a){h.$filter(a)}function k(a){m.selectedUser==m.users[a]?m.selectedUser=null:m.users[a].$folders().then(function(){m.selectedUser=m.users[a]})}function l(b){a.go("administration.rights.edit",{userId:m.selectedUser.uid,folderId:g(b.name)})}var m=this;m.service=h,m.selectedUser=null,m.users=h.$users,m.go=i,m.filter=j,m.selectUser=k,m.selectFolder=l}a.$inject=["$state","$mdToast","$mdMedia","$mdSidenav","sgConstant","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",a)}();
|