From 707afc287a1593f86b392f9146346060c7e95957 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 24 Feb 2019 18:07:06 +0000 Subject: [PATCH] Added controls for report approval options on reports.php. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/reports.tpl | 7 +++++++ reports.php | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 2358030b..a20299b9 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- {/if} +{if $show_approved} + + +{/if} {if $show_invoice_dropdown} @@ -289,6 +293,9 @@ function handleCheckboxes() { {/if} +{if $show_approved} + +{/if} {if $show_invoice_checkbox} {/if} diff --git a/reports.php b/reports.php index fdb2d2ed..d8bf4099 100644 --- a/reports.php +++ b/reports.php @@ -198,6 +198,19 @@ $showTimesheetCheckbox = $user->isPluginEnabled('ts') && ($user->can('view_own_timesheets') || $user->can('view_timesheets') || $user->can('view_all_timesheets') || $user->can('view_client_timesheets')); +// 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('form.reports.include_approved'),'2'=>$i18n->get('form.reports.include_not_approved')), + 'empty'=>array(''=>$i18n->get('dropdown.all')) + )); +} + // Add user table. $showUsers = $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient(); $user_list = array(); @@ -279,6 +292,8 @@ if ($showWorkUnits) $form->addInput(array('type'=>'checkbox','name'=>'chunits')); if ($showTimesheetCheckbox) $form->addInput(array('type'=>'checkbox','name'=>'chtimesheet')); +if ($showApproved) + $form->addInput(array('type'=>'checkbox','name'=>'chapproved')); // Add a hidden control for timesheet_user_id (who to generate a timesheet for). if ($showTimesheetCheckbox) @@ -428,6 +443,7 @@ $smarty->assign('show_cf_1_checkbox', $showCustomFieldCheckbox); $smarty->assign('show_project', $showProject); $smarty->assign('show_task', $showTask); $smarty->assign('show_billable', $showBillable); +$smarty->assign('show_approved', $showApproved); $smarty->assign('show_invoice_dropdown', $showInvoiceDropdown); $smarty->assign('show_invoice_checkbox', $showInvoiceCheckbox); $smarty->assign('show_paid_status', $showPaidStatus); -- 2.20.1
 Anuko Time Tracker 1.18.43.4770 | Copyright © Anuko | +  Anuko Time Tracker 1.18.43.4771 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 07c39834..1358d29d 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -212,6 +212,10 @@ function handleCheckboxes() {
{$i18n.label.task}
{$forms.reportForm.task.control}
{$i18n.label.approved}
{$forms.reportForm.approved.control}
{$i18n.label.invoice}
{$forms.reportForm.invoice.control}