From 3dd2f3bf646990a69a66aa6353aee9deb084dac1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 12 Sep 2016 22:57:00 +0200 Subject: [PATCH] fix SQL error in async service due to removal of info_responsible column --- infolog/inc/class.infolog_so.inc.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/infolog/inc/class.infolog_so.inc.php b/infolog/inc/class.infolog_so.inc.php index e7e4ecad91..000d935dd7 100644 --- a/infolog/inc/class.infolog_so.inc.php +++ b/infolog/inc/class.infolog_so.inc.php @@ -1024,20 +1024,21 @@ class infolog_so { $users[] = $row['info_responsible']; } - foreach($this->db->select($this->info_table,'DISTINCT info_responsible',$this->statusFilter('open',false),__LINE__,__FILE__) as $row) + foreach($this->db->select($this->info_table, "DISTINCT $this->users_table.account_id AS account_id", + $this->statusFilter('open',false), __LINE__, __FILE__, false, '', 'infolog', 0, + "JOIN $this->users_table ON $this->info_table.info_id=$this->users_table.info_id AND info_res_deleted IS NULL") as $row) { - foreach(explode(',', $row['info_responsible']) as $responsible) + $responsible = $row['account_id']; + + if ($GLOBALS['egw']->accounts->get_type($responsible) == 'g') { - if ($GLOBALS['egw']->accounts->get_type($responsible) == 'g') + $responsible = $GLOBALS['egw']->accounts->members($responsible,true); + } + if ($responsible) + { + foreach((array)$responsible as $user) { - $responsible = $GLOBALS['egw']->accounts->members($responsible,true); - } - if ($responsible) - { - foreach(is_array($responsible) ? $responsible : array($responsible) as $user) - { - if ($user && !in_array($user,$users)) $users[] = $user; - } + if ($user && !in_array($user,$users)) $users[] = $user; } } }