+$options = ttReportHelper::getReportOptions($bean);
+
+// Do we need to show checkboxes? We show them in the following 4 situations:
+// - We can approve items.
+// - We can mark items as paid.
+// - We can sssign items to invoices.
+// - We can assign items to a timesheet.
+// Determine these conditions separately.
+if ($bean->getAttribute('chapproved') && ($user->can('approve_reports') || $user->can('approve_all_eports')))
+ $useMarkApproved = true;
+if ($bean->getAttribute('chpaid') && $user->can('manage_invoices'))
+ $useMarkPaid = true;
+if ($bean->getAttribute('chinvoice') && $client_id && 'no_grouping' == $bean->getAttribute('group_by1') && !$user->isClient() && $user->can('manage_invoices'))
+ $useAssignToInvoice = true;
+if ($bean->getAttribute('chtimesheet')) {
+ $timesheets = ttTimesheetHelper::getMatchingTimesheets($options);
+ if ($timesheets) $useAssignToTimesheet = true;
+}
+
+$use_checkboxes = $useMarkApproved || $useMarkPaid || $useAssignToInvoice || $useAssignToTimesheet;
+if ($use_checkboxes)
+ $smarty->assign('use_checkboxes', true);