thomascube
2010-03-17 f52c936f4d451a5d3a87d2501aa5a1701cdafde5
program/include/rcube_contacts.php
@@ -15,7 +15,7 @@
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
 $Id: rcube_contacts.inc 328 2006-08-30 17:41:21Z thomasb $
 $Id$
*/
@@ -141,6 +141,7 @@
   *
   * @param array   List of fields to search in
   * @param string  Search value
   * @param boolean True for strict (=), False for partial (LIKE) matching
   * @param boolean True if results are requested, False if count only
   * @return Indexed list of contact records and 'count' value
   */
@@ -154,7 +155,7 @@
    {
      if ($col == 'ID' || $col == $this->primary_key)
      {
        $ids = !is_array($value) ? split(',', $value) : $value;
        $ids = !is_array($value) ? explode(',', $value) : $value;
        $add_where[] = $this->primary_key.' IN ('.join(',', $ids).')';
      }
      else if ($strict)
@@ -262,18 +263,18 @@
        $a_insert_cols[] = $this->db->quoteIdentifier($col);
        $a_insert_values[] = $this->db->quote($save_data[$col]);
      }
    if (!$existing->count && !empty($a_insert_cols))
    {
      $this->db->query(
        "INSERT INTO ".$this->db_name."
         (user_id, changed, del, ".join(', ', $a_insert_cols).")
         VALUES (?, ".$this->db->now().", 0, ".join(', ', $a_insert_values).")",
        $this->user_id);
         VALUES (".intval($this->user_id).", ".$this->db->now().", 0, ".join(', ', $a_insert_values).")"
        );
        
      $insert_id = $this->db->insert_id(get_sequence_name('contacts'));
      $insert_id = $this->db->insert_id('contacts');
    }
    return $insert_id;
  }