Enable search by fullname and email

This commit is contained in:
Alexandre Cloutier authored and Francis Lachapelle committed 2014-11-11 22:32:44 -05:00
1 parent 0397dc87c1
commit 56b011e793
4 files changed
+91 -50

No files matched your search

@@ -0,0 +1,28 @@
(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;
})
};
})();