mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
backporting r30991-4: using egw_db->capabilities[egw_db::CASE_INSENSITIVE_LIKE] and other PostgreSQL 8.3 fixes
This commit is contained in:
parent
749f20c718
commit
2045c0fd31
@ -344,7 +344,7 @@ class calendar_so
|
|||||||
{
|
{
|
||||||
foreach(array('cal_title','cal_description','cal_location') as $col)
|
foreach(array('cal_title','cal_description','cal_location') as $col)
|
||||||
{
|
{
|
||||||
$to_or[] = $col . ' LIKE ' . $this->db->quote('%'.$query.'%');
|
$to_or[] = $col.' '.$this->db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote('%'.$query.'%');
|
||||||
}
|
}
|
||||||
$where[] = '('.implode(' OR ',$to_or).')';
|
$where[] = '('.implode(' OR ',$to_or).')';
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ class egw_db
|
|||||||
$this->capabilities[self::CAPABILITY_NAME_CASE] = 'lower';
|
$this->capabilities[self::CAPABILITY_NAME_CASE] = 'lower';
|
||||||
$this->capabilities[self::CAPABILITY_CLIENT_ENCODING] = (float) $db_version >= 7.4;
|
$this->capabilities[self::CAPABILITY_CLIENT_ENCODING] = (float) $db_version >= 7.4;
|
||||||
$this->capabilities[self::CAPABILITY_OUTER_JOIN] = true;
|
$this->capabilities[self::CAPABILITY_OUTER_JOIN] = true;
|
||||||
$this->capabilities[self::CAPABILITY_CASE_INSENSITIV_LIKE] = 'ILIKE';
|
$this->capabilities[self::CAPABILITY_CASE_INSENSITIV_LIKE] = '::text ILIKE';
|
||||||
$this->capabilities[self::CAPABILITY_REQUIRE_TRUNCATE_VARCHAR] = true;
|
$this->capabilities[self::CAPABILITY_REQUIRE_TRUNCATE_VARCHAR] = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -836,8 +836,7 @@ class translation
|
|||||||
*/
|
*/
|
||||||
function get_message_id($translation,$app=null,$lang=null)
|
function get_message_id($translation,$app=null,$lang=null)
|
||||||
{
|
{
|
||||||
$like = $this->db->Type == 'pgsql' ? 'ILIKE' : 'LIKE';
|
$where = array('content '.$this->db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote($translation));
|
||||||
$where = array('content '.$like.' '.$this->db->quote($translation)); // like to be case-insensitive
|
|
||||||
if ($app) $where['app_name'] = $app;
|
if ($app) $where['app_name'] = $app;
|
||||||
if ($lang) $where['lang'] = $lang;
|
if ($lang) $where['lang'] = $lang;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user