summaryrefslogtreecommitdiff
path: root/public_html/js
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-14 16:25:56 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-14 16:25:56 (GMT)
commit7caf5ed306604ae5a9ca3355c1b266bad51248d6 (patch)
tree6126f876f9c278ce3c3eeb6a62c3ef6d87e3784f /public_html/js
parent4cb8b7c56ea5cd7f186a46660835591f441cc1df (diff)
downloadkolab-wap-7caf5ed306604ae5a9ca3355c1b266bad51248d6.tar.gz
Add domain_save + corresponding response handlers
Diffstat (limited to 'public_html/js')
-rw-r--r--public_html/js/kolab_admin.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index bdc0780..84f5384 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -1043,6 +1043,46 @@ function kolab_admin()
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});