X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttReportHelper.class.php;h=56a4aa805ad379edadbf3e22fd6cbbc6e9a4b288;hb=ac5189157ef60820dd125400baee9f408a9ba2ea;hp=9d0fc87f1803fee73c70b21c0e80aea3d7bb6fd5;hpb=7ddf5c391598126ec473db7b25884ee0bd94f153;p=timetracker.git diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 9d0fc87f..56a4aa80 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -517,7 +517,7 @@ class ttReportHelper { // with an exception of sorting part, that is added in the end. // However, when we have expenses, we need to do a union with a separate query for expense items from tt_expense_items table. - if ($report['show_cost'] && in_array('ex', explode(',', $user->plugins))) { // if ex(penses) plugin is enabled + if ($report['show_cost'] && $user->isPluginEnabled('ex')) { // if ex(penses) plugin is enabled $fields = array(); // An array of fields for database query. array_push($fields, 'ei.id'); @@ -697,7 +697,7 @@ class ttReportHelper { // By now we have sql for time items. // However, when we have expenses, we need to do a union with a separate query for expense items from tt_expense_items table. - if ($bean->getAttribute('chcost') && in_array('ex', explode(',', $user->plugins))) { // if ex(penses) plugin is enabled + if ($bean->getAttribute('chcost') && $user->isPluginEnabled('ex')) { // if ex(penses) plugin is enabled // Determine group by field and a required join. $group_join = null; @@ -825,7 +825,7 @@ class ttReportHelper { // By now we have sql for time items. // However, when we have expenses, we need to do a union with a separate query for expense items from tt_expense_items table. - if ($report['show_cost'] && in_array('ex', explode(',', $user->plugins))) { // if ex(penses) plugin is enabled + if ($report['show_cost'] && $user->isPluginEnabled('ex')) { // if ex(penses) plugin is enabled // Determine group by field and a required join. $group_join = null; @@ -912,7 +912,7 @@ class ttReportHelper { $sql = "select sum(time_to_sec(l.duration)) as time, null as cost, null as expenses from tt_log l $where"; // If we have expenses, query becomes a bit more complex. - if ($bean->getAttribute('chcost') && in_array('ex', explode(',', $user->plugins))) { + if ($bean->getAttribute('chcost') && $user->isPluginEnabled('ex')) { $where = ttReportHelper::getExpenseWhere($bean); $sql_for_expenses = "select null as time, sum(cost) as cost, sum(cost) as expenses from tt_expense_items ei $where"; // Create a combined query. @@ -982,7 +982,7 @@ class ttReportHelper { $sql = "select sum(time_to_sec(l.duration)) as time, null as cost, null as expenses from tt_log l $where"; // If we have expenses, query becomes a bit more complex. - if ($report['show_cost'] && in_array('ex', explode(',', $user->plugins))) { + if ($report['show_cost'] && $user->isPluginEnabled('ex')) { $where = ttReportHelper::getFavExpenseWhere($report); $sql_for_expenses = "select null as time, sum(cost) as cost, sum(cost) as expenses from tt_expense_items ei $where"; // Create a combined query. @@ -1055,7 +1055,7 @@ class ttReportHelper { $totals = ttReportHelper::getTotals($bean); // Use custom fields plugin if it is enabled. - if (in_array('cf', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cf')) $custom_fields = new CustomFields($user->team_id); // Define some styles to use in email. @@ -1313,7 +1313,7 @@ class ttReportHelper { $totals = ttReportHelper::getFavTotals($report); // Use custom fields plugin if it is enabled. - if (in_array('cf', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cf')) $custom_fields = new CustomFields($user->team_id); // Define some styles to use in email. @@ -1574,7 +1574,7 @@ class ttReportHelper { $mailer->setContentType('text/html'); $mailer->setSender(SENDER); $mailer->setReceiver($email); - $mailer->setSendType(MAIL_MODE); + $mailer->setMailMode(MAIL_MODE); if (!$mailer->send($report['name'], $body)) return false;