2016-03-23 06:36:30 +01:00
|
|
|
!function(){"use strict";function a(a,f){a.state("app",{url:"/addressbooks","abstract":!0,views:{addressbooks:{templateUrl:"UIxContactFoldersView",controller:"AddressBooksController",controllerAs:"app"}},resolve:{stateAddressbooks:b}}).state("app.addressbook",{url:"/:addressbookId",views:{addressbook:{templateUrl:"addressbook",controller:"AddressBookController",controllerAs:"addressbook"}},resolve:{stateAddressbook:c}}).state("app.addressbook.new",{url:"/{contactType:(?:card|list)}/new",views:{card:{templateUrl:"UIxContactEditorTemplate",controller:"CardController",controllerAs:"editor"}},resolve:{stateCard:d}}).state("app.addressbook.card",{url:"/:cardId","abstract":!0,views:{card:{template:"<ui-view/>"}},resolve:{stateCard:e}}).state("app.addressbook.card.view",{url:"/view",views:{"card@app.addressbook":{templateUrl:"UIxContactViewTemplate",controller:"CardController",controllerAs:"editor"}}}).state("app.addressbook.card.editor",{url:"/edit",views:{"card@app.addressbook":{templateUrl:"UIxContactEditorTemplate",controller:"CardController",controllerAs:"editor"}}}),f.otherwise("/addressbooks/personal")}function b(a){return a.$findAll(window.contactFolders)}function c(a,b,c,d){var e=_.find(d.$findAll(),function(a){return a.id==c.addressbookId});return e?(e.selectedCard=!1,e.$reload(),e):a.reject("Addressbook "+c.addressbookId+" not found")}function d(a,b,c){var d="v"+a.contactType,e=new c({pid:a.addressbookId,c_component:d});return b.selectedCard=!0,e}function e(a,b){return b.selectedCard=a.cardId,b.$getCard(a.cardId)}function f(a,b,c){a.$on("$stateChangeError",function(a,d,e,f,g,h){b.error(h),c.go("app.addressbook",{addressbookId:"personal"})}),a.$on("$routeChangeError",function(a,c,d,e){b.error(a,c,d,e)})}angular.module("SOGo.ContactsUI",["ui.router","angularFileUpload","ck","SOGo.Common","SOGo.PreferencesUI","SOGo.MailerUI"]).config(a).run(f),a.$inject=["$stateProvider","$urlRouterProvider"],b.$inject=["AddressBook"],c.$inject=["$q","$state","$stateParams","AddressBook"],d.$inject=["$stateParams","stateAddressbook","Card"],e.$inject=["$stateParams","stateAddressbook"],f.$inject=["$rootScope","$log","$state"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,m,n){function o(a){d.go("app.addressbook.card.view",{addressbookId:n.id,cardId:a.id})}function p(a,b){b.selected=!b.selected,D.mode.multiple+=b.selected?1:-1,a.preventDefault(),a.stopPropagation()}function q(a){function b(a,b,c,d){a.create=function(a){b.hide(),c.go("app.addressbook.new",{addressbookId:d,contactType:a})}}f.show({parent:angular.element(document.body),targetEvent:a,clickOutsideToClose:!0,escapeToClose:!0,template:['<md-dialog aria-label="'+l("Create component")+'">'," <md-dialog-content>",' <div layout="column">'," <md-button ng-click=\"create('card')\">"," "+l("Contact")," </md-button>"," <md-button ng-click=\"create('list')\">"," "+l("List")," </md-button>"," </div>"," </md-dialog-content>","</md-dialog>"].join(""),locals:{addressbookId:D.selectedFolder.id},controller:b}),b.$inject=["scope","$mdDialog","$state","addressbookId"]}function r(a,b){return a&&a.c_component==b&&!a.selected}function s(){_.forEach(D.selectedFolder.$cards,function(a){a.selected=!1}),D.mode.multiple=0}function t(){j.confirm(l("Warning"),l("Are you sure you want to delete the selected contacts?"),{ok:l("Delete")}).then(function(){var a=_.filter(D.selectedFolder.$cards,function(a){return a.selected});D.selectedFolder.$deleteCards(a),delete D.selectedFolder.selectedCard})}function u(){var a=_.filter(D.selectedFolder.$cards,function(a){return a.selected}),b=_.map(a,"id");c.location.href=ApplicationBaseURL+"/"+D.selectedFolder.id+"/export?uid="+b.join("&uid=")}function v(a){var b=_.filter(D.selectedFolder.$cards,function(a){return a.selected});D.selectedFolder.$copyCards(b,a).then(function(){})}function w(){_.forEach(D.selectedFolder.$cards,function(a){a.selected=!0}),D.mode.multiple=D.selectedFolder.$cards.length}function x(a){D.selectedFolder.$filter("",{sort:a})}function y(a){return i.$query.sort==a}function z(){D.mode.search=!
|