summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-04-15 14:24:55 +0200
committerAleksander Machniak <machniak@kolabsys.com>2014-04-15 14:24:55 +0200
commit7fb0da4c53097d9b5c39df3bd8d90eb1abea8793 (patch)
tree661beed80278e09997238c0cc9b8da9fa6ae0281 /lib/kolab_client_task.php
parentde9b0981f42fce13e15d9030d6358a8916a2cf14 (diff)
downloadwebadmin-7fb0da4c53097d9b5c39df3bd8d90eb1abea8793.tar.gz
Support default value for imap_acl fields, fix handling defaults on object type change
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 370ad64..f1c5fb3 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -900,6 +900,7 @@ class kolab_client_task
case 'imap_acl':
$result['type'] = kolab_form::INPUT_TEXTAREA;
$result['data-type'] = 'acl';
+ $result['default'] = $field['default'];
$this->output->add_translation('aci.new', 'aci.edit', 'aci.remove',
'button.ok', 'button.cancel',
@@ -1265,9 +1266,11 @@ class kolab_client_task
}
$form = new kolab_form($attribs);
- $assoc_fields = array();
- $req_fields = array();
- $writeable = 0;
+
+ $default_values = array();
+ $assoc_fields = array();
+ $req_fields = array();
+ $writeable = 0;
$auto_fields = $this->output->get_env('auto_fields');
@@ -1312,7 +1315,9 @@ class kolab_client_task
$field['value'] = $value;
}
else if ($add_mode && !isset($field['value']) && isset($field['default'])) {
- $field['value'] = $field['default'];
+ $field['value'] = $field['default'];
+ $default_values[$idx] = $field['default'];
+
unset($field['default']);
}
@@ -1392,6 +1397,7 @@ class kolab_client_task
$ac_min_len = $this->config_get('autocomplete_min_length', 1, Conf::INT);
$this->output->set_env('form_id', $attribs['id']);
+ $this->output->set_env('default_values', $default_values);
$this->output->set_env('assoc_fields', $assoc_fields);
$this->output->set_env('required_fields', $req_fields);
$this->output->set_env('autocomplete_min_length', $ac_min_len);