Fix bugs when invoking contact creation form when read-only addressbook is selected (#1489296)

pull/117/head
Aleksander Machniak 11 years ago
parent 652577d1fe
commit 4fbbd81b9b

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix bugs when invoking contact creation form when read-only addressbook is selected (#1489296)
- Fix identity selection on reply (#1489291)
- Fix so additional headers are added to all messages sent (#1489284)
- Fix display issue after moving folder in Folder Manager (#1489293)

@ -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
*

@ -43,16 +43,14 @@ if ($RCMAIL->action == 'edit') {
else {
$source = get_input_value('_source', RCUBE_INPUT_GPC);
if (!strlen($source)) {
// Give priority to configured default
$source = $RCMAIL->config->get('default_addressbook');
if (strlen($source)) {
$CONTACTS = $RCMAIL->get_address_book($source, true);
}
$CONTACTS = $RCMAIL->get_address_book($source, true);
// find writable addressbook
if (!$CONTACTS || $CONTACTS->readonly)
$source = $RCMAIL->get_address_book(-1, true);
if (!$CONTACTS || $CONTACTS->readonly) {
$CONTACTS = $RCMAIL->get_address_book(-1, true);
$source = $RCMAIL->get_address_book_id($CONTACTS);
}
// Initialize addressbook
$CONTACTS = rcmail_contact_source($source, true);

Loading…
Cancel
Save