X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttExpenseHelper.class.php;h=23ea3908938d04ddf7ba9375fe26d992b825afb7;hb=7ddf5c391598126ec473db7b25884ee0bd94f153;hp=b73208ac4a594f021e894672bbd3bcb1f645477b;hpb=9a23a8c0a51b7ec38a96f525484134f3cb85dc7e;p=timetracker.git diff --git a/WEB-INF/lib/ttExpenseHelper.class.php b/WEB-INF/lib/ttExpenseHelper.class.php index b73208ac..23ea3908 100644 --- a/WEB-INF/lib/ttExpenseHelper.class.php +++ b/WEB-INF/lib/ttExpenseHelper.class.php @@ -109,17 +109,17 @@ class ttExpenseHelper { // getItem - retrieves an entry from tt_expense_items table. static function getItem($id, $user_id) { - global $user; + global $user; $mdb2 = getConnection(); $client_field = null; - if (in_array('cl', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cl')) $client_field = ", c.name as client_name"; $left_joins = ""; $left_joins = " left join tt_projects p on (ei.project_id = p.id)"; - if (in_array('cl', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cl')) $left_joins .= " left join tt_clients c on (ei.client_id = c.id)"; $sql = "select ei.id, ei.date, ei.client_id, ei.project_id, ei.name, ei.cost, ei.invoice_id $client_field, p.name as project_name @@ -159,18 +159,18 @@ class ttExpenseHelper { // getItems - returns expense items for a user for a given date. static function getItems($user_id, $date) { - global $user; + global $user; $result = array(); $mdb2 = getConnection(); $client_field = null; - if (in_array('cl', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cl')) $client_field = ", c.name as client"; $left_joins = ""; $left_joins = " left join tt_projects p on (ei.project_id = p.id)"; - if (in_array('cl', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cl')) $left_joins .= " left join tt_clients c on (ei.client_id = c.id)"; $sql = "select ei.id as id $client_field, p.name as project, ei.name as item, ei.cost as cost, @@ -190,4 +190,3 @@ class ttExpenseHelper { return $result; } } -?> \ No newline at end of file