diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 76cd04379..0c54627ee 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -448,8 +448,8 @@ - - - {{user.shortFormat}} - -
+ + + {{user.cn}} {{user.c_email}} + +
diff --git a/UI/WebServerResources/js/Common/User.service.js b/UI/WebServerResources/js/Common/User.service.js index c637f5e10..b16fbcc03 100644 --- a/UI/WebServerResources/js/Common/User.service.js +++ b/UI/WebServerResources/js/Common/User.service.js @@ -63,10 +63,10 @@ */ User.prototype.init = function(data) { angular.extend(this, data); - if (!this.shortFormat) - this.shortFormat = this.$shortFormat(); - if (!this.image) - this.image = User.$gravatar(this.c_email); + if (!this.$$shortFormat) + this.$$shortFormat = this.$shortFormat(); + if (!this.$$image) + this.$$image = this.image || User.$gravatar(this.c_email); }; /** diff --git a/UI/WebServerResources/js/Contacts/AddressBooksController.js b/UI/WebServerResources/js/Contacts/AddressBooksController.js index 447c3ea8e..e9538fc2e 100644 --- a/UI/WebServerResources/js/Contacts/AddressBooksController.js +++ b/UI/WebServerResources/js/Contacts/AddressBooksController.js @@ -104,16 +104,20 @@ usersWithACL: $scope.currentFolder.$acl.$users(), User: User, stateAddressbook: $scope.currentFolder, - q: $q + $q: $q } }); - function AddressBookACLController($scope, $mdDialog, usersWithACL, User, stateAddressbook, q) { + /** + * @ngInject + */ + AddressBookACLController.$inject = ['$scope', '$mdDialog', 'usersWithACL', 'User', 'stateAddressbook', '$q']; + function AddressBookACLController($scope, $mdDialog, usersWithACL, User, stateAddressbook, $q) { $scope.users = usersWithACL; // ACL users $scope.stateAddressbook = stateAddressbook; $scope.userToAdd = ''; $scope.searchText = ''; $scope.userFilter = function($query) { - var deferred = q.defer(); + var deferred = $q.defer(); User.$filter($query).then(function(results) { deferred.resolve(results) }); @@ -148,13 +152,15 @@ Dialog.alert(l('Warning'), l('An error occured please try again.')) }); }; - $scope.addUser = function(data) { - stateAddressbook.$acl.$addUser(data).then(function() { - $scope.userToAdd = ''; - $scope.searchText = ''; - }, function(error) { - Dialog.alert(l('Warning'), error); - }); + $scope.addUser = function(data) { + if (data) { + stateAddressbook.$acl.$addUser(data).then(function() { + $scope.userToAdd = ''; + $scope.searchText = ''; + }, function(error) { + Dialog.alert(l('Warning'), error); + }); + } }; $scope.selectUser = function(user) { // Check if it is a different user diff --git a/UI/WebServerResources/js/Preferences/Preferences.service.js b/UI/WebServerResources/js/Preferences/Preferences.service.js index 34da411d8..2a6c682f3 100644 --- a/UI/WebServerResources/js/Preferences/Preferences.service.js +++ b/UI/WebServerResources/js/Preferences/Preferences.service.js @@ -133,7 +133,7 @@ if (preferences.settings.Calendar && preferences.settings.Calendar.PreventInvitationsWhitelist) { var h = {}; _.each(preferences.settings.Calendar.PreventInvitationsWhitelist, function(user) { - h[user.uid] = user.shortFormat; + h[user.uid] = user.$$shortFormat; preferences.settings.Calendar.PreventInvitationsWhitelist = h; });