Files
sogo/UI/WebServerResources/js/Common/user-model.js
Alexandre Cloutier 9113ca54f7 Created user-modal.js, code refactoring
Conflicts:

	UI/Common/UIxAclEditor.m
	UI/Common/UIxUserRightsEditor.m
	UI/Common/product.plist
	UI/Contacts/UIxContactsUserRightsEditor.m
	UI/Templates/ContactsUI/UIxContactFoldersView.wox
	UI/WebServerResources/js/Common/resource.js
	UI/WebServerResources/js/ContactsUI.js
2015-06-11 15:38:10 -04:00

29 lines
761 B
JavaScript

(function() {
'use strict';
function User() {}
/* The factory we'll use to register with Angular */
User.factory = ['sgSettings', 'sgResource', function(Settings, Resource) {
angular.extend(User, {
$$resource: new Resource(Settings.baseURL)
});
return User; // return constructor
}];
/* Factory registration in Angular module */
angular.module('SOGo.Common').factory('sgUser', User.factory);
/* Instance methods
* Public method, assigned to prototype
*/
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;
})
};
})();