From 6c43433e16730594d365c5d226c7a6a6964f4951 Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" Date: Tue, 28 Nov 2017 10:45:04 +0100 Subject: [PATCH 1/2] Bump version numbers --- plugins/calendar/composer.json | 2 +- plugins/kolab_addressbook/composer.json | 2 +- plugins/kolab_auth/composer.json | 2 +- plugins/kolab_files/composer.json | 2 +- plugins/kolab_folders/composer.json | 2 +- plugins/libcalendaring/composer.json | 2 +- plugins/libkolab/composer.json | 2 +- plugins/tasklist/composer.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/calendar/composer.json b/plugins/calendar/composer.json index 48a44169..2ac8c5fc 100644 --- a/plugins/calendar/composer.json +++ b/plugins/calendar/composer.json @@ -4,7 +4,7 @@ "description": "Calendar plugin", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.4", + "version": "3.3.5", "authors": [ { "name": "Thomas Bruederli", diff --git a/plugins/kolab_addressbook/composer.json b/plugins/kolab_addressbook/composer.json index 1c411bb4..a85a4ee1 100644 --- a/plugins/kolab_addressbook/composer.json +++ b/plugins/kolab_addressbook/composer.json @@ -4,7 +4,7 @@ "description": "Kolab addressbook", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.3", + "version": "3.3.5", "authors": [ { "name": "Thomas Bruederli", diff --git a/plugins/kolab_auth/composer.json b/plugins/kolab_auth/composer.json index dbbddeaf..87ec7d1d 100644 --- a/plugins/kolab_auth/composer.json +++ b/plugins/kolab_auth/composer.json @@ -4,7 +4,7 @@ "description": "Kolab authentication", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.4", + "version": "3.3.5", "authors": [ { "name": "Thomas Bruederli", diff --git a/plugins/kolab_files/composer.json b/plugins/kolab_files/composer.json index b4db0048..18469a9b 100644 --- a/plugins/kolab_files/composer.json +++ b/plugins/kolab_files/composer.json @@ -4,7 +4,7 @@ "description": "User interface for Kolab File Manager (Chwala)", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.4", + "version": "3.3.5", "authors": [ { "name": "Aleksander Machniak", diff --git a/plugins/kolab_folders/composer.json b/plugins/kolab_folders/composer.json index 0aae0dba..51116866 100644 --- a/plugins/kolab_folders/composer.json +++ b/plugins/kolab_folders/composer.json @@ -4,7 +4,7 @@ "description": "Type-aware folder management/listing for Kolab", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.2", + "version": "3.3.5", "authors": [ { "name": "Aleksander Machniak", diff --git a/plugins/libcalendaring/composer.json b/plugins/libcalendaring/composer.json index 8e367d44..26995d0f 100644 --- a/plugins/libcalendaring/composer.json +++ b/plugins/libcalendaring/composer.json @@ -4,7 +4,7 @@ "description": "Library providing common functions for calendaring plugins", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.4", + "version": "3.3.5", "authors": [ { "name": "Thomas Bruederli", diff --git a/plugins/libkolab/composer.json b/plugins/libkolab/composer.json index 5639eae7..5ce8fc71 100644 --- a/plugins/libkolab/composer.json +++ b/plugins/libkolab/composer.json @@ -4,7 +4,7 @@ "description": "Plugin to setup a basic environment for the interaction with a Kolab server.", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.4", + "version": "3.3.5", "authors": [ { "name": "Thomas Bruederli", diff --git a/plugins/tasklist/composer.json b/plugins/tasklist/composer.json index 09ac2edd..67db36b2 100644 --- a/plugins/tasklist/composer.json +++ b/plugins/tasklist/composer.json @@ -4,7 +4,7 @@ "description": "Task management plugin", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.4", + "version": "3.3.5", "authors": [ { "name": "Thomas Bruederli", From 51345357d69ea49b476fd689315ea6bd814bbb4d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 10 Jan 2018 11:18:28 +0100 Subject: [PATCH 2/2] Performance optimization in contacts search For cases when the result is smaller than page size we get all contacts in one query instead of separate selects. --- .../kolab_addressbook/lib/rcube_kolab_contacts.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php index e3b59e02..b301ffad 100644 --- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php +++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php @@ -355,7 +355,7 @@ class rcube_kolab_contacts extends rcube_addressbook // get members by UID if (!empty($uids)) { - $this->_fetch_contacts($query = array(array('uid', '=', $uids)), !$fetch_all); + $this->_fetch_contacts($query = array(array('uid', '=', $uids)), $fetch_all ? false : count($uids)); $this->sortindex = array_merge($this->sortindex, $local_sortindex); } } @@ -363,7 +363,7 @@ class rcube_kolab_contacts extends rcube_addressbook $ids = $this->filter['ids']; if (count($ids)) { $uids = array_map(array($this, 'id2uid'), $this->filter['ids']); - $this->_fetch_contacts($query = array(array('uid', '=', $uids)), true); + $this->_fetch_contacts($query = array(array('uid', '=', $uids)), count($ids)); } } else { @@ -1066,10 +1066,13 @@ class rcube_kolab_contacts extends rcube_addressbook { if (!isset($this->dataset) || !empty($query)) { if ($limit) { - $this->storagefolder->set_order_and_limit($this->_sort_columns(), $this->page_size, ($this->list_page-1) * $this->page_size); + $size = is_int($limit) && $limit < $this->page_size ? $limit : $this->page_size; + $this->storagefolder->set_order_and_limit($this->_sort_columns(), $size, ($this->list_page-1) * $this->page_size); } + $this->sortindex = array(); - $this->dataset = $this->storagefolder->select($query); + $this->dataset = $this->storagefolder->select($query); + foreach ($this->dataset as $idx => $record) { $contact = $this->_to_rcube_contact($record); $this->sortindex[$idx] = $this->_sort_string($contact);