From: Nik Okuntseff Date: Mon, 25 Feb 2019 17:40:15 +0000 (+0000) Subject: Releasing Approval plugin for testing. X-Git-Tag: timetracker_1.19-1~267 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c14bc01ae221ece2c5b78c9c39b4902cb25154d6;p=timetracker.git Releasing Approval plugin for testing. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 57d00472..80ead68e 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -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'); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 57554741..32d68a09 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- -{if isTrue('APPROVAL_DEBUG')} -{/if} {if isTrue('TIMESHEET_DEBUG')} diff --git a/reports.php b/reports.php index 107f8cee..febfad79 100644 --- a/reports.php +++ b/reports.php @@ -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();
 Anuko Time Tracker 1.18.43.4778 | Copyright © Anuko | +  Anuko Time Tracker 1.18.44.4779 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/plugins.tpl b/WEB-INF/templates/plugins.tpl index ce0cd52a..5c5941c3 100644 --- a/WEB-INF/templates/plugins.tpl +++ b/WEB-INF/templates/plugins.tpl @@ -134,12 +134,10 @@ function handlePluginCheckboxes() { {$forms.pluginsForm.work_units.control} {$i18n.label.configure}
{$forms.pluginsForm.approval.control}
{$forms.pluginsForm.timesheets.control}