summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-11-07 11:59:45 (GMT)
committerAleksander Machniak <alec@alec.pl>2013-11-07 12:00:42 (GMT)
commit1ebf0dcf4818c6b32ec94e7d9679f88a20d2d3c2 (patch)
treece9f149a3b8c1103f36ebf4d53606e54e4e27aa2
parentc74fa4d2b0b106b007b31e8a3d5e052f9b8fad64 (diff)
downloadkolab-wap-1ebf0dcf4818c6b32ec94e7d9679f88a20d2d3c2.tar.gz
Support checkboxes for boolean LDAP values (Bug #2452)
-rw-r--r--lib/kolab_client_task.php4
-rw-r--r--public_html/js/kolab_admin.js5
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 07864ff..2aedb27 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -1288,6 +1288,10 @@ class kolab_client_task
if (!empty($field['data-autocomplete'])) {
$assoc_fields[$idx] = !empty($data[$idx]) ? $data[$idx] : array();
}
+
+ if ($field['type'] == kolab_form::INPUT_CHECKBOX) {
+ $field['checked'] = $field['value'] == 'TRUE';
+ }
/*
if (!empty($field['suffix'])) {
$field['suffix'] = kolab_html::escape($this->translate($field['suffix']));
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index fac2aa6..a93d515 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -769,6 +769,11 @@ function kolab_admin()
delete data.json[this.name + '-unit'];
});
+ // checkbox inputs
+ $('input[type="checkbox"]', form).each(function() {
+ data.json[this.name] = this.checked ? 'TRUE' : 'FALSE';
+ });
+
return data;
};