Releasing Approval plugin for testing.
authorNik Okuntseff <support@anuko.com>
Mon, 25 Feb 2019 17:40:15 +0000 (17:40 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 25 Feb 2019 17:40:15 +0000 (17:40 +0000)
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/plugins.tpl
reports.php

index 57d0047..80ead68 100644 (file)
@@ -1087,9 +1087,9 @@ class ttReportHelper {
     $options['invoice'] = $bean->getAttribute('invoice');
     $options['paid_status'] = $bean->getAttribute('paid_status');
     $options['approved'] = $bean->getAttribute('approved');
+    if ($user->isPluginEnabled('ap') && $user->isClient() && !$user->can('view_client_unapproved'))
+      $options['approved'] = 1; // Restrict clients to approved records only.
     $options['timesheet'] = $bean->getAttribute('timesheet');
-    if ($user->isPluginEnabled('ts') && $user->isClient() && !$user->can('view_client_unapproved'))
-      $options['timesheet'] = TIMESHEET_APPROVED; // Restrict clients to approved timesheet records only.
     if (is_array($bean->getAttribute('users'))) $options['users'] = join(',', $bean->getAttribute('users'));
     $options['period'] = $bean->getAttribute('period');
     $options['period_start'] = $bean->getAttribute('start_date');
index 5755474..32d68a0 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.4778 | 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.44.4779 | 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 ce0cd52..5c5941c 100644 (file)
@@ -134,12 +134,10 @@ function handlePluginCheckboxes() {
             <td align="right" nowrap>{$forms.pluginsForm.work_units.control}</td>
             <td><label for="work_units">{$i18n.label.work_units}</label> <span id="work_units_config"><a href="work_units.php">{$i18n.label.configure}</a></span></td>
           </tr>
-{if isTrue('APPROVAL_DEBUG')}
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.approval.control}</td>
             <td><label for="approval">{$i18n.label.approval}</label></td>
           </tr>
-{/if}
 {if isTrue('TIMESHEET_DEBUG')}
           <tr>
             <td align="right" nowrap>{$forms.pluginsForm.timesheets.control}</td>
index 107f8ce..febfad7 100644 (file)
@@ -178,6 +178,19 @@ if ($showPaidStatus) {
  ));
 }
 
+// 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') &&
   ($user->can('view_own_timesheets') || $user->can('view_timesheets') ||
@@ -198,19 +211,6 @@ $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('dropdown.approved'),'2'=>$i18n->get('dropdown.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();