summaryrefslogtreecommitdiff
path: root/public_html/js
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-06-16 17:28:23 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-06-16 17:28:23 (GMT)
commitd985ff4f32cf0ea469b719f0dbc84b7de2ecf91e (patch)
tree078779aa966affa9249bc83314a742588df79560 /public_html/js
parent8a403ad59ea258b38bddf128cc6c32576849d9a2 (diff)
parent33a7c6a176fa6162c8f0394896225391f8fe109f (diff)
downloadkolab-wap-d985ff4f32cf0ea469b719f0dbc84b7de2ecf91e.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/kolab-wap
Conflicts: lib/locale/en_US.php
Diffstat (limited to 'public_html/js')
-rw-r--r--public_html/js/kolab_admin.js123
1 files changed, 123 insertions, 0 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index bc83cac..b640679 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -1038,6 +1038,51 @@ function kolab_admin()
return false;
};
+ this.domain_info = function(id)
+ {
+ this.http_post('domain.info', {id: id});
+ };
+
+ this.domain_save = function(reload, section)
+ {
+ var data = this.serialize_form('#'+this.env.form_id),
+ action = data.id ? 'edit' : 'add';
+
+ if (reload) {
+ data.section = section;
+ this.http_post('domain.' + action, {data: data});
+ return;
+ }
+
+ this.form_error_clear();
+
+ if (!this.check_required_fields(data)) {
+ this.display_message('form.required.empty', 'error');
+ return;
+ }
+
+ this.set_busy(true, 'saving');
+ this.api_post('domain.' + action, data, 'domain_' + action + '_response');
+ };
+
+ this.domain_add_response = function(response)
+ {
+ if (!this.api_response(response))
+ return;
+
+ this.display_message('domain.add.success');
+ this.command('domain.list', {page: this.env.list_page});
+ };
+
+ this.domain_edit_response = function(response)
+ {
+ if (!this.api_response(response))
+ return;
+
+ this.display_message('domain.edit.success');
+ this.command('domain.list', {page: this.env.list_page});
+ };
+
this.user_info = function(id)
{
this.http_post('user.info', {id: id});
@@ -1200,6 +1245,84 @@ function kolab_admin()
this.command('group.list', {page: this.env.list_page});
};
+ this.resource_info = function(id)
+ {
+ this.http_post('resource.info', {id: id});
+ };
+
+ this.resource_list = function(props)
+ {
+ if (!props)
+ props = {};
+
+ if (props.search === undefined && this.env.search_request)
+ props.search_request = this.env.search_request;
+
+ this.http_post('resource.list', props);
+ };
+
+ this.resource_delete = function(resourceid)
+ {
+ this.set_busy(true, 'deleting');
+ this.api_post('resource.delete', {resource: resourceid}, 'resource_delete_response');
+ };
+
+ this.resource_delete_response = function(response)
+ {
+ if (!this.api_response(response))
+ return;
+
+ var page = this.env.list_page;
+
+ // goto previous page if last user on the current page has been deleted
+ if (this.env.list_count)
+ page -= 1;
+
+ this.display_message('resource.delete.success');
+ this.command('resource.list', {page: page});
+ };
+
+ this.resource_save = function(reload, section)
+ {
+ var data = this.serialize_form('#'+this.env.form_id),
+ action = data.id ? 'edit' : 'add';
+
+ if (reload) {
+ data.section = section;
+ this.http_post('resource.' + action, {data: data});
+ return;
+ }
+
+ this.form_error_clear();
+
+ if (!this.check_required_fields(data)) {
+ this.display_message('form.required.empty', 'error');
+ return;
+ }
+
+ this.set_busy(true, 'saving');
+ this.api_post('resource.' + action, data, 'resource_' + action + '_response');
+ };
+
+ this.resource_add_response = function(response)
+ {
+ if (!this.api_response(response))
+ return;
+
+ this.display_message('resource.add.success');
+ this.command('resource.list', {page: this.env.list_page});
+ };
+
+ this.resource_edit_response = function(response)
+ {
+ if (!this.api_response(response))
+ return;
+
+ this.display_message('resource.edit.success');
+ this.command('resource.list', {page: this.env.list_page});
+ };
+
+
this.generate_password = function(fieldname)
{
this.env.password_field = fieldname;