projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring: renamed getActiveUser() to getUser().
[timetracker.git]
/
WEB-INF
/
lib
/
ttClientHelper.class.php
diff --git
a/WEB-INF/lib/ttClientHelper.class.php
b/WEB-INF/lib/ttClientHelper.class.php
index
e557676
..
3ae662a
100644
(file)
--- a/
WEB-INF/lib/ttClientHelper.class.php
+++ b/
WEB-INF/lib/ttClientHelper.class.php
@@
-31,9
+31,11
@@
class ttClientHelper {
// The getClient looks up a client by id.
static function getClient($client_id, $all_fields = false) {
// The getClient looks up a client by id.
static function getClient($client_id, $all_fields = false) {
-
- $mdb2 = getConnection();
global $user;
global $user;
+ $mdb2 = getConnection();
+
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
$sql = 'select ';
if ($all_fields)
$sql = 'select ';
if ($all_fields)
@@
-41,7
+43,7
@@
class ttClientHelper {
else
$sql .= 'name ';
else
$sql .= 'name ';
- $sql .= "from tt_clients where group_id =
".$user->getGroup()
.
+ $sql .= "from tt_clients where group_id =
$group_id and org_id = $org_id"
.
" and id = $client_id and (status = 1 or status = 0)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
" and id = $client_id and (status = 1 or status = 0)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
@@
-287,7
+289,7
@@
class ttClientHelper {
static function getClientsForUser()
{
global $user;
static function getClientsForUser()
{
global $user;
- $user_id = $user->get
Active
User();
+ $user_id = $user->getUser();
$result = array();
$mdb2 = getConnection();
$result = array();
$mdb2 = getConnection();