summaryrefslogtreecommitdiff
path: root/lib/api/kolab_api_service_form_value.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-03-22 17:48:06 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-03-22 17:48:06 (GMT)
commit93e417fb5e01438ecc2bb8b36637478dfd0c520e (patch)
treee5d48a8c2199a3abfaca4658c3bdb1fa847386a8 /lib/api/kolab_api_service_form_value.php
parentd1c031a393706cf25bc41fecbbddcdd576eef16e (diff)
downloadkolab-wap-93e417fb5e01438ecc2bb8b36637478dfd0c520e.tar.gz
Implemented 'roles' service and autocompletion for nsrole attribute
Diffstat (limited to 'lib/api/kolab_api_service_form_value.php')
-rw-r--r--lib/api/kolab_api_service_form_value.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 6c7223e..ff63c3d 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -446,4 +446,30 @@ class kolab_api_service_form_value extends kolab_api_service
return $list;
}
+
+ private function list_options_nsrole($postdata, $attribs = array())
+ {
+ $service = $this->controller->get_service('roles');
+
+ $keyword = array('value' => $postdata['search']);
+ $data = array(
+ 'attributes' => array('displayname', 'mail'),
+ 'page_size' => 15,
+ 'search' => array(
+ 'displayname' => $keyword,
+ 'cn' => $keyword,
+ 'mail' => $keyword,
+ ),
+ );
+
+ $result = $service->roles_list(null, $data);
+ $list = $result['list'];
+
+ // convert to key=>value array
+ foreach ($list as $idx => $value) {
+ $list[$idx] = is_array($value['cn']) ? implode('/', $value['cn']) : $value['cn'];
+ }
+
+ return $list;
+ }
}