2 commits - lib/api lib/locale

Thomas Brüderli bruederli at kolabsys.com
Mon Mar 10 11:30:55 CET 2014


 lib/api/kolab_api_service_form_value.php |   80 +++++++++++++++++--------------
 lib/locale/en_US.php                     |    2 
 2 files changed, 47 insertions(+), 35 deletions(-)

New commits:
commit 26afc433416d6fcec4ca35f48d516f7c9330e949
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Mar 5 05:48:05 2014 -0500

    New labels for resource attributes

diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php
index d4e28cd..35dc51c 100644
--- a/lib/locale/en_US.php
+++ b/lib/locale/en_US.php
@@ -166,6 +166,8 @@ $LANG['resource.other'] = 'Other';
 $LANG['resource.system'] = 'System';
 $LANG['resource.type_id'] = 'Resource Type';
 $LANG['resource.uniquemember'] = 'Collection Members';
+$LANG['resource.description'] = 'Descroption';
+$LANG['resource.owner'] = 'Owner';
 
 $LANG['role.add'] = 'Add Role';
 $LANG['role.add.success'] = 'Role created successfully.';


commit 4f7f8161683a94b45ff9a4d77b0fa207687f1a88
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Mar 5 05:47:27 2014 -0500

    New _list_options_users() method to serve autocompletion for 'kolabdelegate' and 'owner' attributes

diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 07eb20b..fec6372 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -864,42 +864,12 @@ class kolab_api_service_form_value extends kolab_api_service
 
     private function list_options_kolabdelegate($postdata, $attribs = array())
     {
-        // return specified records only, by exact DN attributes
-        if (!empty($postdata['list'])) {
-            $data['page_size'] = count($postdata['list']);
-            $data['search'] = array(
-                'entrydn' => array(
-                    'value' => $postdata['list'],
-                    'type'  => 'exact',
-                ),
-            );
-        }
-        // return records with specified string
-        else {
-            $keyword = array('value' => $postdata['search']);
-            $data['page_size'] = 15;
-            $data['search']    = array(
-                'displayname' => $keyword,
-                'cn'          => $keyword,
-                'mail'        => $keyword,
-            );
-        }
-
-        $data['attributes'] = array('displayname', 'mail');
-
-        $service = $this->controller->get_service('users');
-        $result  = $service->users_list(null, $data);
-        $list    = $result['list'];
-
-        // convert to key=>value array
-        foreach ($list as $idx => $value) {
-            $list[$idx] = $value['displayname'];
-            if (!empty($value['mail'])) {
-                $list[$idx] .= ' <' . $value['mail'] . '>';
-            }
-        }
+        return $this->_list_options_users($postdata, $attribs);
+    }
 
-        return $list;
+    private function list_options_owner($postdata, $attribs = array())
+    {
+        return $this->_list_options_users($postdata, $attribs);
     }
 
     private function list_options_member($postdata, $attribs = array())
@@ -1312,6 +1282,46 @@ class kolab_api_service_form_value extends kolab_api_service
         return $list;
     }
 
+    private function _list_options_users($postdata, $attribs = array())
+    {
+        // return specified records only, by exact DN attributes
+        if (!empty($postdata['list'])) {
+            $data['page_size'] = count($postdata['list']);
+            $data['search'] = array(
+                'entrydn' => array(
+                    'value' => $postdata['list'],
+                    'type'  => 'exact',
+                ),
+            );
+        }
+        // return records with specified string
+        else {
+            $keyword = array('value' => $postdata['search']);
+            $data['page_size'] = 15;
+            $data['search']    = array(
+                'displayname' => $keyword,
+                'cn'          => $keyword,
+                'mail'        => $keyword,
+            );
+        }
+
+        $data['attributes'] = array('displayname', 'mail');
+
+        $service = $this->controller->get_service('users');
+        $result  = $service->users_list(null, $data);
+        $list    = $result['list'];
+
+        // convert to key=>value array
+        foreach ($list as $idx => $value) {
+            $list[$idx] = $value['displayname'];
+            if (!empty($value['mail'])) {
+                $list[$idx] .= ' <' . $value['mail'] . '>';
+            }
+        }
+
+        return $list;
+    }
+
     private function _list_options_resources($postdata, $attribs = array())
     {
         // return specified records only, by exact DN attributes




More information about the commits mailing list