summaryrefslogtreecommitdiffstats
path: root/public_html
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-01-17 15:41:18 +0100
committerAleksander Machniak <alec@alec.pl>2012-01-17 15:41:18 +0100
commit87e7d712e530141fc73e53c4bdc7873d1413b07c (patch)
treefc5227b1cb84c6b07499b3f01317fd89a16531ed /public_html
parent02dd0853454f605c210364ecd94e432f84634fd3 (diff)
downloadwebadmin-87e7d712e530141fc73e53c4bdc7873d1413b07c.tar.gz
User search
Diffstat (limited to 'public_html')
-rw-r--r--public_html/js/kolab_admin.js28
-rw-r--r--public_html/skins/default/ui.js4
2 files changed, 28 insertions, 4 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index d500c6a..6742279 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -255,8 +255,11 @@ function kolab_admin()
if (postdata && typeof postdata === 'object')
postdata.remote = 1;
- else
- postdata += (postdata ? '&' : '') + 'remote=1';
+ else {
+ if (!postdata)
+ postdata = '';
+ postdata += '&remote=1';
+ }
this.set_request_time()
@@ -347,6 +350,16 @@ function kolab_admin()
this.env.request_time = (new Date()).getTime();
};
+ this.serialize_form = function(id)
+ {
+ var i, query = $(id).serializeArray(),
+ json = {};
+
+ for (i in query)
+ json[query[i].name] = query[i].value;
+
+ return json;
+ };
/*********************************************************/
/********* Client commands *********/
@@ -363,6 +376,17 @@ function kolab_admin()
this.http_post('user.info', {id: id});
};
+ this.user_list = function(props)
+ {
+ if (props) {
+ if (props.search) {
+ props = $.extend(props, this.serialize_form('#search-form'));
+ }
+ }
+
+ this.http_post('user.list', props);
+ };
+
};
var kadm = new kolab_admin();
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index c0bace5..cfe0562 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -10,7 +10,7 @@ function search_init()
})
.keypress(function(e) {
if (this.value && e.which == 13) { // ENTER key
- // @TODO: search request
+ kadm.command('user.list', {search: this.value});
}
})
.focus(function() {
@@ -25,7 +25,7 @@ function search_reset()
input.val(kadm.t('search')).addClass('inactive');
- // @TODO: reseting search
+ kadm.command('user.list');
}
function search_details()