X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=report.php;h=110d5ac49a72d798e2010368ef9e930bb1b96487;hb=232a12a5e68da662e86d3141ac98a1b12d820964;hp=a34238fbcc144e5b09b664fceb926414726e9114;hpb=a7ba11adfecf6cb906749efe5abce688363aef07;p=timetracker.git diff --git a/report.php b/report.php index a34238fb..110d5ac4 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); @@ -65,22 +65,25 @@ if ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->g } if ($request->isPost()) { - foreach($_POST as $key => $val) { - 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; + if ($request->getParameter('btn_submit')) { + // User clicked the Submit button to assign some items to a recent invoice. + foreach($_POST as $key => $val) { + 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; + } + 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); + } + // Re-display this form. + header('Location: report.php'); + exit(); } - 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); - } - // Re-display this form. - header('Location: report.php'); - exit(); -} // POST +} // isPost $group_by = $bean->getAttribute('group_by');