Fix warning in email addresses handling by Horde3 classes

This commit is contained in:
Aleksander Machniak 2011-06-02 09:45:04 +02:00
parent caebffcbdf
commit de1dcbd3c4
2 changed files with 71 additions and 64 deletions

View file

@ -24,8 +24,6 @@ class kolab_addressbook extends rcube_plugin
// load required plugin
$this->require_plugin('kolab_core');
$this->add_texts('localization');
// register hooks
$this->add_hook('addressbooks_list', array($this, 'address_sources'));
$this->add_hook('addressbook_get', array($this, 'get_address_book'));
@ -120,6 +118,8 @@ class kolab_addressbook extends rcube_plugin
if (!is_a($GLOBALS['CONTACTS'], 'rcube_kolab_contacts'))
return $p;
$this->add_texts('localization');
// extend the list of contact fields to be displayed in the 'personal' section
if (is_array($p['form']['personal'])) {
$p['form']['contact']['content']['officelocation'] = array('size' => 40);

View file

@ -186,6 +186,7 @@ class rcube_kolab_contacts extends rcube_addressbook
return $groups;
}
/**
* List the current set of contact records
*
@ -264,6 +265,7 @@ class rcube_kolab_contacts extends rcube_addressbook
if (empty($contact[$f]))
continue 2;
}
foreach ($fields as $f) {
foreach ((array)$contact[$f] as $val) {
$val = strtolower($val);
@ -316,6 +318,7 @@ class rcube_kolab_contacts extends rcube_addressbook
return $this->result;
}
/**
* Get a specific contact record
*
@ -443,6 +446,7 @@ class rcube_kolab_contacts extends rcube_addressbook
return $updated;
}
/**
* Mark one or more contact records as deleted
*
@ -483,6 +487,7 @@ class rcube_kolab_contacts extends rcube_addressbook
return $count;
}
/**
* Remove all records from the database
*/
@ -828,6 +833,8 @@ class rcube_kolab_contacts extends rcube_addressbook
$emails = $this->get_col_values('email', $contact, true);
$object['emails'] = join(', ', array_filter($emails));
// overwrite 'email' field
$object['email'] = '';
foreach ($this->get_col_values('phone', $contact) as $type => $values) {
if ($this->phonetypemap[$type])