X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/993450e17195b87dc406c3135ee22dafe9b825fb..05b0f8e4762b8a2ca2002a8f7545b7ff68cc3925:/WEB-INF/lib/ttExpenseHelper.class.php diff --git a/WEB-INF/lib/ttExpenseHelper.class.php b/WEB-INF/lib/ttExpenseHelper.class.php index 3338e58e..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,