diff --git a/classes/context/ContextDAO.inc.php b/classes/context/ContextDAO.inc.php index a2fe989b9da..caf6156aec3 100644 --- a/classes/context/ContextDAO.inc.php +++ b/classes/context/ContextDAO.inc.php @@ -127,7 +127,7 @@ function getAvailable($userId = null, $rangeInfo = null) { 'SELECT c.* FROM ' . $this->tableName . ' c WHERE ' . ($userId? - 'c.' . $this->_getPrimaryKeyColumn() . ' IN (SELECT DISTINCT ug.context_id FROM user_groups ug JOIN user_user_groups uug ON (ug.user_group_id = uug.user_group_id) WHERE uug.user_id = ?) + 'c.' . $this->primaryKeyColumn . ' IN (SELECT DISTINCT ug.context_id FROM user_groups ug JOIN user_user_groups uug ON (ug.user_group_id = uug.user_group_id) WHERE uug.user_id = ?) OR ? IN (SELECT user_id FROM user_groups ug JOIN user_user_groups uug ON (ug.user_group_id = uug.user_group_id) WHERE ug.role_id = ?)' :'c.enabled = 1') . ' ORDER BY seq', @@ -193,5 +193,3 @@ function resequence() { $result->Close(); } } - -