summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-06-24 10:43:50 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-06-24 10:43:50 +0200
commitb9fdc766577e5d464fca95f911cd5905ee78faa5 (patch)
treed3462eff8fb860bb622917dfb44280c8a4779e71 /lib
parent2719b480959d7a7bba0df95ab73cacfe96feb9ea (diff)
downloadwebadmin-b9fdc766577e5d464fca95f911cd5905ee78faa5.tar.gz
Allow a defined static value to be added to, if auto_form_fields has an optional list for the item.
Summary: We use auto_form_fields to suppress the field from being displayed in a form. Test Plan: None Reviewers: #web_administration_panel_developers, machniak Reviewed By: #web_administration_panel_developers, machniak Maniphest Tasks: T525 Differential Revision: https://git.kolab.org/D27
Diffstat (limited to 'lib')
-rw-r--r--lib/kolab_api_service.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index f19486a..0c7182a 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -360,7 +360,13 @@ abstract class kolab_api_service
if (empty($attribs[$key])) {
$result[$key] = $type_attrs['fields'][$key] = $value;
} else {
- $result[$key] = $attribs[$key] = $value;
+ if (!empty($type_attrs['auto_form_fields'][$key]['optional']) &&
+ $type_attrs['auto_form_fields'][$key]['type'] == "list") {
+
+ $result[$key] = array_unique(array_merge((array)$attribs[$key], (array)$value));
+ } else {
+ $result[$key] = $attribs[$key] = $value;
+ }
}
}
}