+// Add approved / not approved selector.
+$showApproved = $user->isPluginEnabled('ap') &&
+ ($user->can('view_own_reports') || $user->can('view_reports') ||
+ $user->can('view_all_reports') || ($user->can('view_client_reports') && $user->can('view_client_unapproved')));
+if ($showApproved) {
+ $form->addInput(array('type'=>'combobox',
+ 'name'=>'approved',
+ 'style'=>'width: 250px;',
+ 'data'=>array('1'=>$i18n->get('dropdown.approved'),'2'=>$i18n->get('dropdown.not_approved')),
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))
+ ));
+}
+
+// Add timesheet assignment selector.
+$showTimesheetDropdown = $user->isPluginEnabled('ts');
+if ($showTimesheetDropdown) {
+ $form->addInput(array('type'=>'combobox',
+ 'name'=>'timesheet',
+ 'style'=>'width: 250px;',
+ 'data'=>array(TIMESHEET_NOT_ASSIGNED=>$i18n->get('form.reports.include_not_assigned'),
+ TIMESHEET_ASSIGNED=>$i18n->get('form.reports.include_assigned'),
+ TIMESHEET_PENDING=>$i18n->get('form.reports.include_pending'),
+ TIMESHEET_APPROVED=>$i18n->get('dropdown.approved'),
+ TIMESHEET_NOT_APPROVED=>$i18n->get('dropdown.not_approved')),
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))
+ ));
+}
+$showTimesheetCheckbox = $user->isPluginEnabled('ts');
+
+// Add user table.
+$showUsers = $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient();