refactor codes and applied comments

This commit is contained in:
Alexandre Cloutier
2014-10-21 14:44:48 -04:00
committed by Francis Lachapelle
parent c82143fd2e
commit 22faf5c285
9 changed files with 142 additions and 96 deletions

View File

@@ -27,22 +27,22 @@
Acl.prototype.$addUser = function(uid) {
var param = {"uid": uid};
Acl.$$resource.fetch(this.folder_id, "addUserInAcls", param);
return Acl.$$resource.fetch(this.folder_id, "addUserInAcls", param);
};
Acl.prototype.$removeUser = function(uid) {
var param = {"uid": uid};
Acl.$$resource.fetch(this.folder_id, "removeUserFromAcls", param);
return Acl.$$resource.fetch(this.folder_id, "removeUserFromAcls", param);
};
Acl.prototype.$saveUsersRights = function(dirtyObjects) {
var param = {"action": "saveUserRights"};
Acl.$$resource.save(this.folder_id, dirtyObjects, param);
return Acl.$$resource.save(this.folder_id, dirtyObjects, param);
};
Acl.prototype.$subscribeUsers = function(uids) {
var param = {"uids": uids};
Acl.$$resource.fetch(this.folder_id, "subscribeUsers", param);
return Acl.$$resource.fetch(this.folder_id, "subscribeUsers", param);
};
Acl.prototype.$users = function() {

View File

@@ -111,8 +111,8 @@
/**
* @function fetch
* @desc Fetch resources using a specific object, action and/or parameters
* @param {string} object_id - the object on which the action will be applied (ex: addressbook, calendar)
* @desc Fetch resources using a specific folder, action and/or parameters
* @param {string} folder_id - the folder on which the action will be applied (ex: addressbook, calendar)
* @param {string} action - the action to be used in the URL
* @param {Object} params - Object parameters injected through the $http protocol
*/

View File

@@ -13,7 +13,7 @@
}];
/* Factory registration in Angular module */
angular.module('SOGo.Common').factory('sgUser', User.factory);
angular.module('SOGo.Common').factory('User', User.factory);
/* Instance methods
* Public method, assigned to prototype
@@ -21,8 +21,6 @@
User.prototype.$filter = function(search) {
// return a collections of users for a filter
var param = {search: search};
return User.$$resource.fetch(null, "usersSearch", param).then(function(results) {
return results;
})
return User.$$resource.fetch(null, "usersSearch", param);
};
})();