summaryrefslogtreecommitdiffstats
path: root/public_html
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-03-15 09:56:41 +0100
committerAleksander Machniak <machniak@kolabsys.com>2012-03-15 09:56:41 +0100
commit462b589bd11e1bab55c0cb4a6dcb37e19d44093f (patch)
tree4f4073029aac30dc085f8b9ddc385ecf9a9f3c8f /public_html
parent14c80a0ed15dd961d1a5a39e433c3714b1fab9f7 (diff)
downloadwebadmin-462b589bd11e1bab55c0cb4a6dcb37e19d44093f.tar.gz
Improve form_value.generate to support many attributes at a time
Diffstat (limited to 'public_html')
-rw-r--r--public_html/js/kolab_admin.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index d0c7361..08b6f31 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -438,9 +438,10 @@ function kolab_admin()
this.form_value_change = function(events)
{
- var i, j, data, e, elem, name, elem_name,
+ var i, j, e, elem, name, elem_name,
form = $('#'+this.env.form_id),
- type_id = $('[name="user_type_id"]', form).val();
+ type_id = $('[name="user_type_id"]', form).val(),
+ data = {user_type_id: type_id, attributes: []};
this.set_busy(true, 'loading');
@@ -451,16 +452,15 @@ function kolab_admin()
if (!e)
continue;
- data = {user_type_id: type_id, attribute: name};
+ data.attributes.push(name);
for (j=0; j<e.data.length; j++) {
elem_name = e.data[j];
- if (elem = $('[name="'+elem_name+'"]', form))
+ if (!data[elem_name] && (elem = $('[name="'+elem_name+'"]', form)))
data[elem_name] = elem.val();
}
-
- this.api_post('form_value.generate', data, 'form_value_response');
}
+ this.api_post('form_value.generate', data, 'form_value_response');
this.set_busy(false);
};