From 4fbbd81b9b2230df3b06b773b829f0e3991664f3 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 26 Aug 2013 10:28:34 +0200 Subject: Fix bugs when invoking contact creation form when read-only addressbook is selected (#1489296) --- program/include/rcmail.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'program/include') diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 4cfaca13c..c9350bdd9 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -256,6 +256,23 @@ class rcmail extends rcube } + /** + * Return identifier of the address book object + * + * @param rcube_addressbook Addressbook source object + * + * @return string Source identifier + */ + public function get_address_book_id($object) + { + foreach ($this->address_books as $index => $book) { + if ($book === $object) { + return $index; + } + } + } + + /** * Return address books list * -- cgit v1.2.3