thomascube
2007-07-03 3fc00e67bbfa5bad7b0d29d268545036f6dc684d
Fix address adding bug reported by David Koblas

5 files modified
21 ■■■■ changed files
CHANGELOG 7 ●●●●● patch | view | raw | blame | history
program/include/rcube_contacts.inc 6 ●●●●● patch | view | raw | blame | history
program/include/rcube_ldap.inc 4 ●●●● patch | view | raw | blame | history
program/steps/addressbook/save.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/addcontact.inc 2 ●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,13 @@
CHANGELOG RoundCube Webmail
---------------------------
2007/07/03 (thomasb)
----------
- Added Macedonian (Slavic FYROM) localization
- Fix status message bug #1484464 with regard to #1484353
- Fix address adding bug reported by David Koblas
2007/06/28 (tomekp)
----------
- fix typos in Polish localization (Janusz Zamecki)
program/include/rcube_contacts.inc
@@ -171,7 +171,7 @@
   * @param boolean True if results are requested, False if count only
   * @return Indexed list of contact records and 'count' value
   */
  function search($fields, $value, $select=true)
  function search($fields, $value, $strict=false, $select=true)
  {
    if (!is_array($fields))
      $fields = array($fields);
@@ -184,6 +184,8 @@
        $ids = !is_array($value) ? split(',', $value) : $value;
        $add_where[] = $this->primary_key." IN (".join(',', $ids).")";
      }
      else if ($strict)
        $add_where[] = $this->db->quoteIdentifier($col)."=".$this->db->quote($value);
      else
        $add_where[] = $this->db->quoteIdentifier($col)." LIKE ".$this->db->quote(strlen($value)>2 ? "%$value%" : "$value%");
    }
@@ -278,7 +280,7 @@
    $insert_id = $existing = false;
    if ($check)
      $existing = $this->search('email', $save_data['email'], false);
      $existing = $this->search('email', $save_data['email'], true, false);
    $a_insert_cols = $a_insert_values = array();
    foreach ($this->table_cols as $col)
program/include/rcube_ldap.inc
@@ -231,7 +231,7 @@
   * @param boolean True if results are requested, False if count only
   * @return Indexed list of contact records and 'count' value
   */
  function search($fields, $value, $select=true)
  function search($fields, $value, $strict=false, $select=true)
  {
    // special treatment for ID-based search
    if ($fields == 'ID' || $fields == $this->primary_key)
@@ -249,7 +249,7 @@
    }
    
    $filter = '(|';
    $wc = $this->prop['fuzzy_search'] ? '*' : '';
    $wc = !$strict && $this->prop['fuzzy_search'] ? '*' : '';
    if (is_array($this->prop['search_fields']))
    {
      foreach ($this->prop['search_fields'] as $k => $field)
program/steps/addressbook/save.inc
@@ -83,7 +83,7 @@
else
{
  // check for existing contacts
  $existing = $CONTACTS->search('email', $a_record['email'], false);
  $existing = $CONTACTS->search('email', $a_record['email'], true, false);
  
  // show warning message
  if ($existing->count)
program/steps/mail/addcontact.inc
@@ -40,7 +40,7 @@
      $contact['name'] = ucfirst(preg_replace('/[\.\-]/', ' ', substr($contact['email'], 0, strpos($contact['email'], '@'))));
    // check for existing contacts
    $existing = $CONTACTS->search('email', $contact['email'], false);
    $existing = $CONTACTS->search('email', $contact['email'], true, false);
    if ($done = $existing->count)
      $OUTPUT->show_message('contactexists', 'warning');
    else if ($done = $CONTACTS->insert($contact))