- Case insensitive contacts searching using PostgreSQL (#1485259)
| | |
| | | CHANGELOG RoundCube Webmail |
| | | --------------------------- |
| | | |
| | | 2008/08/09 (alec) |
| | | ---------- |
| | | - Case insensitive contacts searching using PostgreSQL (#1485259) |
| | | |
| | | 2008/07/31 (thomasb) |
| | | ---------- |
| | | - Make default imap folders configurable for each user (#1485075) |
| | |
| | | if ($col == 'ID' || $col == $this->primary_key) |
| | | { |
| | | $ids = !is_array($value) ? split(',', $value) : $value; |
| | | $add_where[] = $this->primary_key." IN (".join(',', $ids).")"; |
| | | $add_where[] = $this->primary_key.' IN ('.join(',', $ids).')'; |
| | | } |
| | | else if ($strict) |
| | | $add_where[] = $this->db->quoteIdentifier($col)."=".$this->db->quote($value); |
| | | $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%"); |
| | | $add_where[] = $this->db->ilike($col, '%'.$value.'%'); |
| | | } |
| | | |
| | | if (!empty($add_where)) |
| | |
| | | |
| | | |
| | | /** |
| | | * Return SQL statement for case insensitive LIKE |
| | | * |
| | | * @param string Field name |
| | | * @param string Search value |
| | | * @return string SQL statement to use in query |
| | | * @access public |
| | | */ |
| | | function ilike($column, $value) |
| | | { |
| | | switch($this->db_provider) |
| | | { |
| | | case 'pgsql': |
| | | return $this->quote_identifier($column).' ILIKE '.$this->quote($value); |
| | | default: |
| | | return $this->quote_identifier($column).' LIKE '.$this->quote($value); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Adds a query result and returns a handle ID |
| | | * |
| | | * @param object Query handle |
| | |
| | | |
| | | |
| | | /** |
| | | * Return SQL statement for case insensitive LIKE |
| | | * |
| | | * @param string Field name |
| | | * @param string Search value |
| | | * @return string SQL statement to use in query |
| | | * @access public |
| | | */ |
| | | function ilike($column, $value) |
| | | { |
| | | // TODO: use MDB2's matchPattern() function |
| | | switch($this->db_provider) |
| | | { |
| | | case 'pgsql': |
| | | return $this->quote_identifier($column).' ILIKE '.$this->quote($value); |
| | | default: |
| | | return $this->quote_identifier($column).' LIKE '.$this->quote($value); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Adds a query result and returns a handle ID |
| | | * |
| | | * @param object Query handle |