1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"file":"Administration.js","sources":["Administration/Administration.app.js","Administration/AdministrationAclController.js","Administration/AdministrationController.js"],"names":["configure","$stateProvider","$urlRouterProvider","state","abstract","views","administration","templateUrl","controller","controllerAs","url","module","acl","resolve","stateUser","stateFolder","otherwise","$q","$stateParams","User","user","_","find","$users","uid","userId","angular","isUndefined","$filter","then","users","reject","$folders","$state","decodeUriFilter","AddressBook","Calendar","folder","o","folderId","$$folders","name","type","id","split","pop","owner","displayName","selectedFolder","runBlock","$log","$rootScope","$on","event","toState","toParams","fromState","fromParams","error","go","current","previous","rejection","config","run","$inject","AdministrationAclController","$timeout","$mdMedia","$mdToast","getTemplate","isDefined","$cards","selectAllRights","$acl","$selectAllRights","selectUser","$event","target","parentNode","classList","contains","vm","selectedUid","selectedUser","$rights","showRights","rights","userFilter","$query","dry","removeUser","$removeUser","addUser","data","$addUser","userToAdd","searchText","close","save","$saveUsersRights","show","simple","content","l","position","hideDelay","this","folderType","AdministrationController","$mdSidenav","sgConstant","Dialog","encodeUriFilter","filter","i","selectFolder","service"],"mappings":"CAGA,WACE,YAUA,SAASA,GAAUC,EAAgBC,GACjCD,EACGE,MAAM,kBACLC,YAAU,EACVC,OACEC,gBACEC,YAAa,sBACbC,WAAY,2BACZC,aAAc,UAInBN,MAAM,yBACLO,IAAK,UACLL,OACEM,QACEJ,YAAa,kBAIlBJ,MAAM,8BACLO,IAAK,0BACLL,OACEO,KACEL,YAAa,6BACbC,WAAY,8BACZC,aAAc,QAGlBI,SACEC,UAAWA,EACXC,YAAaA,KAKnBb,EAAmBc,UAAU,WAO/B,QAASF,GAAUG,EAAIC,EAAcC,GACnC,GAAIC,EAMJ,OAJAA,GAAOC,EAAEC,KAAKH,EAAKI,OAAQ,SAASH,GAClC,MAAOA,GAAKI,KAAON,EAAaO,SAG9BC,QAAQC,YAAYP,GACfD,EAAKS,QAAQV,EAAaO,QAAQI,KAAK,SAASC,GAIrD,MAHA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hB2D,EAAGvB,GAAKA,EACRuB,EAAGgC,OAASA,EACZhC,EAAGN,WAAaA,EAChBM,EAAGkC,aAAeA,EAZpBP,EAAyB5C,SAAW,SAAU,WAAY,WAAY,aAAc,aAAc,SAAU,kBAAmB,QA2C/HvC,QACGf,OAAO,yBACPH,WAAW,2BAA4BqG","sourcesContent":["/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for SOGoAdministration */\n\n(function() {\n 'use strict';\n\n angular.module('SOGo.AdministrationUI', ['ui.router', 'SOGo.Common', 'SOGo.Authentication', 'SOGo.PreferencesUI', 'SOGo.ContactsUI', 'SOGo.SchedulerUI'])\n .config(configure)\n .run(runBlock);\n\n /**\n * @ngInject\n */\n configure.$inject = ['$stateProvider', '$urlRouterProvider'];\n function configure($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state('administration', {\n abstract: true,\n views: {\n administration: {\n templateUrl: 'administration.html',\n controller: 'AdministrationController',\n controllerAs: 'app'\n }\n }\n })\n .state('administration.rights', {\n url: '/rights',\n views: {\n module: {\n templateUrl: 'rights.html'\n }\n }\n })\n .state('administration.rights.edit', {\n url: '/:userId/:folderId/edit',\n views: {\n acl: {\n templateUrl: 'UIxAdministrationAclEditor', // UI/Templates/Administration/UIxAdministrationAclEditor.wox\n controller: 'AdministrationAclController',\n controllerAs: 'acl'\n }\n },\n resolve: {\n stateUser: stateUser,\n stateFolder: stateFolder\n }\n });\n\n // if none of the above states are matched, use this as the fallback\n $urlRouterProvider.otherwise('/rights');\n }\n\n /**\n * @ngInject\n */\n stateUser.$inject = ['$q', '$stateParams', 'User'];\n function stateUser($q, $stateParams, User) {\n var user;\n\n user = _.find(User.$users, function(user) {\n return user.uid == $stateParams.userId;\n });\n\n if (angular.isUndefined(user)) {\n return User.$filter($stateParams.userId).then(function(users) {\n user = _.find(User.$users, function(user) {\n return user.uid == $stateParams.userId;\n });\n if (angular.isUndefined(user)) {\n return $q.reject('User with ID ' + $stateParams.userId + ' not found');\n }\n else {\n // Resolve folders\n return user.$folders().then(function() {\n return user;\n });\n }\n return user;\n });\n }\n\n return user;\n }\n\n /**\n * @ngInject\n */\n stateFolder.$inject = ['$state', '$stateParams', 'decodeUriFilter', 'stateUser', 'AddressBook', 'Calendar'];\n function stateFolder($state, $stateParams, decodeUriFilter, stateUser, AddressBook, Calendar) {\n var folder, o,\n folderId = decodeUriFilter($stateParams.folderId);\n\n folder = _.find(stateUser.$$folders, function(folder) {\n return folder.name == folderId;\n });\n \n if (folder.type == \"Appointment\") {\n o = new Calendar({ id: folder.name.split('/').pop(),\n owner: folder.owner,\n name: folder.displayName });\n } else {\n o = new AddressBook({ id: folder.name.split('/').pop(),\n owner: folder.owner,\n name: folder.displayName });\n }\n\n stateUser.selectedFolder = o.id;\n\n return o;\n }\n\n /**\n * @ngInject\n */\n runBlock.$inject = ['$log', '$rootScope', '$state'];\n function runBlock($log, $rootScope, $state) {\n $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) {\n $log.error(error);\n $state.go('administration.rights');\n });\n $rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {\n $log.error(event, current, previous, rejection);\n });\n }\n\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for SOGoAdministration */\n\n(function() {\n 'use strict';\n \n /**\n * @ngInject\n */\n AdministrationAclController.$inject = ['$timeout', '$state', '$mdMedia', '$mdToast', 'stateUser', 'stateFolder', 'User'];\n function AdministrationAclController($timeout, $state, $mdMedia, $mdToast, stateUser, stateFolder, User) {\n var vm = this;\n\n vm.user = stateUser;\n vm.folder = stateFolder;\n vm.folderType = angular.isDefined(stateFolder.$cards)? 'AddressBook' : 'Calendar';\n vm.selectedUser = null;\n vm.selectedUid = null;\n vm.selectUser = selectUser;\n vm.selectAllRights = selectAllRights;\n vm.showRights = showRights;\n vm.removeUser = removeUser;\n vm.getTemplate = getTemplate;\n vm.close = close;\n vm.save = save;\n\n vm.userToAdd = '';\n vm.searchText = '';\n vm.userFilter = userFilter;\n vm.addUser = addUser;\n\n stateFolder.$acl.$users(stateFolder.owner).then(function(data) {\n vm.users = data;\n });\n\n function getTemplate() {\n if (angular.isDefined(stateFolder.$cards))\n return '../' + stateFolder.owner + '/Contacts/' + stateFolder.id + '/UIxContactsUserRightsEditor';\n\n return '../' + stateFolder.owner + '/Calendar/' + stateFolder.id + '/UIxCalUserRightsEditor';\n }\n\n function selectAllRights(user) {\n stateFolder.$acl.$selectAllRights(user);\n }\n\n function selectUser(user, $event) {\n if ($event && $event.target.parentNode.classList.contains('md-secondary'))\n return false;\n if (vm.selectedUid == user.uid) {\n vm.selectedUid = null;\n }\n else {\n vm.selectedUid = user.uid;\n vm.selectedUser = user;\n vm.selectedUser.$rights();\n }\n }\n\n function showRights(user) {\n return vm.selectedUid == user.uid && user.rights;\n }\n\n function userFilter($query) {\n return User.$filter($query, stateFolder.$acl.users, { dry: true, uid: vm.user.uid });\n }\n\n function removeUser(user) {\n $timeout(function() {\n stateFolder.$acl.$removeUser(user.uid, stateFolder.owner);\n }, 500); // wait for CSS transition to complete (see card.scss)\n }\n\n function addUser(data) {\n if (data) {\n stateFolder.$acl.$addUser(data, stateFolder.owner).then(function(user) {\n vm.userToAdd = '';\n vm.searchText = '';\n vm.selectedUid = null;\n if (user)\n selectUser(user);\n });\n }\n }\n\n function close() {\n $state.go('administration.rights').then(function() {\n delete vm.user.selectedFolder;\n vm.user = null;\n });\n }\n\n function save() {\n stateFolder.$acl.$saveUsersRights(stateFolder.owner).then(function() {\n $mdToast.show(\n $mdToast.simple()\n .content(l('ACLs saved'))\n .position('bottom right')\n .hideDelay(3000)\n );\n // Close acls on small devices\n if ($mdMedia('xs'))\n close();\n });\n }\n }\n\n angular\n .module('SOGo.AdministrationUI')\n .controller('AdministrationAclController', AdministrationAclController);\n\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for SOGoAdministration */\n\n(function() {\n 'use strict';\n \n /**\n * @ngInject\n */\n AdministrationController.$inject = ['$state', '$mdToast', '$mdMedia', '$mdSidenav', 'sgConstant', 'Dialog', 'encodeUriFilter', 'User'];\n function AdministrationController($state, $mdToast, $mdMedia, $mdSidenav, sgConstant, Dialog, encodeUriFilter, User) {\n var vm = this;\n\n vm.service = User;\n\n vm.selectedUser = null;\n vm.users = User.$users;\n\n vm.go = go;\n vm.filter = filter;\n vm.selectUser = selectUser;\n vm.selectFolder = selectFolder;\n\n function go(module) {\n $state.go('administration.' + module);\n // Close sidenav on small devices\n if (!$mdMedia(sgConstant['gt-md']))\n $mdSidenav('left').close();\n }\n\n function filter(searchText) {\n User.$filter(searchText);\n }\n\n function selectUser(i) {\n if (vm.selectedUser == vm.users[i]) {\n vm.selectedUser = null;\n }\n else {\n // Fetch folders of specific type for selected user\n vm.users[i].$folders().then(function() {\n vm.selectedUser = vm.users[i];\n });\n }\n }\n\n function selectFolder(folder) {\n $state.go('administration.rights.edit', {userId: vm.selectedUser.uid, folderId: encodeUriFilter(folder.name)});\n }\n\n }\n\n angular\n .module('SOGo.AdministrationUI')\n .controller('AdministrationController', AdministrationController);\n\n})();\n"]} |