From 93a07c2ff4a4f0dc12743c6600b0501f1d9765eb Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 14 Jan 2011 12:58:46 +0000 Subject: [PATCH] * addressbook: postgres compatibility for distributionlists --- addressbook/inc/class.addressbook_sql.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index 4741fb2e74..9908fe65d9 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -360,6 +360,12 @@ class addressbook_sql extends so_sql_cf $table = $matches[1] == $this->extra_value ? $this->extra_table : $this->table_name; $extra_cols[] = $table.'.'.$matches[1]; $extra_cols[] = $table.'.'.$matches[1]."<>''"; + //_debug_array($matches[1]); + if (!empty($order_by) && $matches[1] != 'extra_order.contact_value' && stripos($matches[1],'.')===false) // postgres requires explizit order by + { + $order_by = str_replace($matches[1],'egw_addressbook.'.$matches[1],$order_by); + } + //_debug_array($order_by); } } // add join to show only active accounts (only if accounts are shown and in sql and we not already join the accounts table, eg. used by admin)