X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=report.php;h=a18ff1f1a382bf28c49400b569349070a86fb04b;hb=a07b6f8bccda226991ced6fe25f1c9c508e423e5;hp=5ed7108d3b914f96870a30cea3295eb306f380b8;hpb=098a79f0819ebb89b7d48df4a6b154af4560f68e;p=timetracker.git diff --git a/report.php b/report.php index 5ed7108d..a18ff1f1 100644 --- a/report.php +++ b/report.php @@ -39,7 +39,7 @@ if (!ttAccessCheck(right_view_reports)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); @@ -64,23 +64,23 @@ if ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->g } } -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { foreach($_POST as $key => $val) { - if ('log_id_' == substr($key, 0, 7)) - $time_log_ids[] = substr($key, 7); + if ('log_id_' == substr($key, 0, 7)) + $time_log_ids[] = substr($key, 7); if ('item_id_' == substr($key, 0, 8)) - $expense_item_ids[] = substr($key, 8); - if ('recent_invoice' == $key) - $invoice_id = $val; + $expense_item_ids[] = substr($key, 8); + if ('recent_invoice' == $key) + $invoice_id = $val; } if ($time_log_ids || $expense_item_ids) { - // Some records are checked for invoice editing... Adjust their invoice accordingly. - ttReportHelper::assignToInvoice($invoice_id, $time_log_ids, $expense_item_ids); + // Some records are checked for invoice editing. Adjust their invoice accordingly. + ttReportHelper::assignToInvoice($invoice_id, $time_log_ids, $expense_item_ids); } // Re-display this form. header('Location: report.php'); exit(); -} // post +} // isPost $group_by = $bean->getAttribute('group_by'); @@ -120,4 +120,3 @@ $smarty->assign('bean', $bean); $smarty->assign('title', $i18n->getKey('title.report').": ".$totals['start_date']." - ".$totals['end_date']); $smarty->assign('content_page_name', 'report.tpl'); $smarty->display('index.tpl'); -?> \ No newline at end of file