Added controls for report approval options on reports.php.
authorNik Okuntseff <support@anuko.com>
Sun, 24 Feb 2019 18:07:06 +0000 (18:07 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 24 Feb 2019 18:07:06 +0000 (18:07 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/reports.tpl
reports.php

index 2358030..a20299b 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.43.4770 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.43.4771 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 07c3983..1358d29 100644 (file)
@@ -212,6 +212,10 @@ function handleCheckboxes() {
               <tr><td><b>{$i18n.label.task}</b></td></tr>
               <tr><td>{$forms.reportForm.task.control}</td></tr>
 {/if}
+{if $show_approved}
+              <tr><td><b>{$i18n.label.approved}</b></td></tr>
+              <tr><td>{$forms.reportForm.approved.control}</td></tr>
+{/if}
 {if $show_invoice_dropdown}
               <tr><td><b>{$i18n.label.invoice}</b></td></tr>
               <tr><td>{$forms.reportForm.invoice.control}</td></tr>
@@ -289,6 +293,9 @@ function handleCheckboxes() {
                     <tr><td><label>{$forms.reportForm.chfinish.control}&nbsp;{$i18n.label.finish}</label></td></tr>
 {/if}
                     <tr><td><label>{$forms.reportForm.chnote.control}&nbsp;{$i18n.label.note}</label></td></tr>
+{if $show_approved}
+                    <tr><td><label>{$forms.reportForm.chapproved.control}&nbsp;{$i18n.label.approved}</label></td></tr>
+{/if}
 {if $show_invoice_checkbox}
                     <tr><td><label>{$forms.reportForm.chinvoice.control}&nbsp;{$i18n.label.invoice}</label></td></tr>
 {/if}
index fdb2d2e..d8bf409 100644 (file)
@@ -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);