X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/95356f167c97ca1a70fc78d91a9dbc7b1d258b31..cc89430b244535c67dbb7d1f8813a4ba56b1ffc0:/WEB-INF/lib/ttClientHelper.class.php diff --git a/WEB-INF/lib/ttClientHelper.class.php b/WEB-INF/lib/ttClientHelper.class.php index afa7afbd..85545898 100644 --- a/WEB-INF/lib/ttClientHelper.class.php +++ b/WEB-INF/lib/ttClientHelper.class.php @@ -41,8 +41,8 @@ class ttClientHelper { else $sql .= 'name '; - $sql .= "from tt_clients where group_id = $user->group_id - and id = $client_id and (status = 1 or status = 0)"; + $sql .= "from tt_clients where group_id = ".$user->getActiveGroup(). + " and id = $client_id and (status = 1 or status = 0)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); @@ -59,8 +59,7 @@ class ttClientHelper { $result = array(); $mdb2 = getConnection(); - $sql = "select id, name from tt_clients - where group_id = $user->group_id and (status = 0 or status = 1) order by upper(name)"; + $sql = "select id, name from tt_clients where group_id = ".$user->getActiveGroup()." and (status = 0 or status = 1) order by upper(name)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) { @@ -76,8 +75,8 @@ class ttClientHelper { $mdb2 = getConnection(); global $user; - $sql = "select id from tt_clients where group_id = $user->group_id and name = ". - $mdb2->quote($client_name)." and (status = 1 or status = 0)"; + $sql = "select id from tt_clients where group_id = ".$user->getActiveGroup(). + " and name = ".$mdb2->quote($client_name)." and (status = 1 or status = 0)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { @@ -95,8 +94,8 @@ class ttClientHelper { $mdb2 = getConnection(); global $user; - $sql = "select name, address from tt_clients where group_id = $user->group_id - and id = $client_id and status is NULL"; + $sql = "select name, address from tt_clients where group_id = ".$user->getActiveGroup(). + " and id = $client_id and status is NULL"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow();