]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttExpenseHelper.class.php
Wrote ttUser::isPluginEnabled() function.
[timetracker.git] / WEB-INF / lib / ttExpenseHelper.class.php
index 86ccbcd8317e408d90c56c86216f7632968d5e3d..23ea3908938d04ddf7ba9375fe26d992b825afb7 100644 (file)
@@ -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 (ttPluginEnabled('cl'))
+    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 (ttPluginEnabled('cl'))
+    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 (ttPluginEnabled('cl'))
+    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 (ttPluginEnabled('cl'))
+    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,