mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-06 15:46:23 +00:00
2 lines
4.8 KiB
JavaScript
2 lines
4.8 KiB
JavaScript
!function(){"use strict";function e(e,t){e.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:r,stateFolder:n}}).state("administration.theme",{url:"/theme",views:{module:{templateUrl:"UIxThemePreview",controller:"ThemePreviewController",controllerAs:"ctrl"}}}),t.rules.otherwise("/rights")}function r(t,r,n){var o=_.find(n.$users,function(e){return e.uid==r.userId});return angular.isUndefined(o)?n.$filter(r.userId).then(function(e){return o=_.find(n.$users,function(e){return e.uid==r.userId}),angular.isUndefined(o)?t.reject("User with ID "+r.userId+" not found"):o.$folders().then(function(){return o})}):o}function n(e,t,r,n,o,i){var s=r(t.folderId),r=_.find(n.$$folders,function(e){return e.name==s}),t=new("Appointment"==r.type?i:o)({id:r.name.split("/").pop(),owner:r.owner,name:r.displayName});return n.selectedFolder=t.id,t}function t(e,t,r,n){e.DebugEnabled||n.defaultErrorHandler(function(){}),r.onError({to:"administration.**"},function(e){"administration"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),n.go({state:"administration.rights"}))})}angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],r.$inject=["$q","$stateParams","User"],n.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";function e(t,e,r,n,o,i,s,d){var a=this;function u(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;a.selectedUid==e.uid?a.selectedUid=null:(a.selectedUid=e.uid,a.selectedUser=e,a.selectedUser.$rights())}function c(){e.go("administration.rights").then(function(){delete a.user.selectedFolder,a.user=null})}a.user=o,a.folder=i,a.folderType=angular.isDefined(i.$cards)?"AddressBook":"Calendar",a.selectedUser=null,a.selectedUid=null,a.selectUser=u,a.selectAllRights=function(e){i.$acl.$selectAllRights(e)},a.showRights=function(e){return a.selectedUid==e.uid&&e.rights},a.removeUser=function(e){t(function(){i.$acl.$removeUser(e.uid,i.owner)},500)},a.getTemplate=function(){return angular.isDefined(i.$cards)?"../"+i.owner+"/Contacts/"+i.id+"/UIxContactsUserRightsEditor":"../"+i.owner+"/Calendar/"+i.id+"/UIxCalUserRightsEditor"},a.close=c,a.save=function(){i.$acl.$saveUsersRights(i.owner).then(function(){n.show(n.simple().textContent(l("ACLs saved")).position(s.toastPosition).hideDelay(2e3)),r("xs")&&c()})},a.userToAdd="",a.searchText="",a.userFilter=function(e){return d.$filter(e,i.$acl.users,{dry:!0,uid:a.user.uid})},a.addUser=function(e){e&&i.$acl.$addUser(e,i.owner).then(function(e){a.userToAdd="",a.searchText="",a.selectedUid=null,e&&u(e)})},i.$acl.$users(i.owner).then(function(e){a.users=e})}e.$inject=["$timeout","$state","$mdMedia","$mdToast","stateUser","stateFolder","sgConstant","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",e)}(),function(){"use strict";function e(t,e,r,n,o,i,s,d){var l=this;l.service=d,l.selectedUser=null,l.users=d.$users,l.go=function(e){t.go("administration."+e),r(o["gt-md"])||n("left").close()},l.filter=function(e){d.$filter(e)},l.selectUser=function(e){l.selectedUser==l.users[e]?l.selectedUser=null:l.users[e].$folders().then(function(){l.selectedUser=l.users[e]})},l.selectFolder=function(e){t.go("administration.rights.edit",{userId:l.selectedUser.uid,folderId:s(e.name)})}}e.$inject=["$state","$mdToast","$mdMedia","$mdSidenav","sgConstant","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",e)}(),function(){"use strict";function e(e){e.registerStyles(['.foreground-1 { color: "{{foreground-1}}" }','.foreground-2 { color: "{{foreground-2}}" }','.foreground-3 { color: "{{foreground-3}}" }','.foreground-4 { color: "{{foreground-4}}" }','.background-contrast { color: "{{background-contrast}}" }','.background-contrast-secondary { color: "{{background-contrast-secondary}}" }','.background-default { background-color: "{{background-default}}" }'].join("")),e.generateThemesOnDemand(!1)}function t(e){this.defaultTheme=e.THEMES[e.defaultTheme()],this.jsonDefaultTheme=JSON.stringify(this.defaultTheme,void 0,2)}e.$inject=["$mdThemingProvider"],t.$inject=["$mdTheming"],angular.module("SOGo.AdministrationUI").config(e).controller("ThemePreviewController",t)}();
|
|
//# sourceMappingURL=Administration.js.map
|