From 957007719ca06e990ad29d9be24126decca8cac9 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 14 Apr 2019 17:31:13 +0000 Subject: [PATCH] Work in progress on configurable display options. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/report.tpl | 7 ++++++- report.php | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 7bcd2359..d67cd7b4 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- {/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -73,6 +74,7 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -101,6 +103,7 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -113,7 +116,7 @@ {if 2 == $item.type}{/if} {/if} - {if $bean->getAttribute('chnote') && $item.note} + {if $note_on_separate_row && $bean->getAttribute('chnote') && $item.note} @@ -135,6 +138,7 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -158,6 +162,7 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} diff --git a/report.php b/report.php index 3bd410a4..b82380d7 100644 --- a/report.php +++ b/report.php @@ -27,17 +27,21 @@ // +----------------------------------------------------------------------+ require_once('initialize.php'); +import('ttConfigHelper'); import('form.Form'); import('form.ActionForm'); import('ttReportHelper'); import('ttGroupHelper'); import('ttTimesheetHelper'); -// Access check. +// Access checks. if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports') || ttAccessAllowed('view_client_reports'))) { header('Location: access_denied.php'); exit(); } +// End of access checks. + +$config = new ttConfigHelper($user->getConfig()); if ($user->isPluginEnabled('ap')) { $cl_mark_approved_select_option = $request->getParameter('mark_approved_select_options', ($request->isPost() ? null : @$_SESSION['mark_approved_select_option'])); @@ -309,6 +313,7 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('report_items', $report_items); $smarty->assign('subtotals', $subtotals); $smarty->assign('totals', $totals); +$smarty->assign('note_on_separate_row', $user->getConfigOption('report_note_on_separate_row')); $smarty->assign('colspan', $colspan); $smarty->assign('bean', $bean); $smarty->assign('title', $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date']); -- 2.20.1
 Anuko Time Tracker 1.18.65.4937 | Copyright © Anuko | +  Anuko Time Tracker 1.18.65.4938 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/report.tpl b/WEB-INF/templates/report.tpl index 2f3a7a39..a98d71aa 100644 --- a/WEB-INF/templates/report.tpl +++ b/WEB-INF/templates/report.tpl @@ -48,6 +48,7 @@ {if $bean->getAttribute('chfinish')}{$i18n.label.finish}{$i18n.label.duration}{$i18n.label.work_units_short}{$i18n.label.note}{$i18n.label.cost}{$i18n.label.approved}{$i18n.label.paid}{$subtotals[$prev_grouped_by]['time']}{$subtotals[$prev_grouped_by]['units']}{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}{$item.finish}{$item.duration}{$item.units}{$item.note|escape}{if $user->can('manage_invoices') || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}{if $item.approved == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}
{$i18n.label.note}: {$item.note|escape}{$subtotals[$cur_grouped_by]['time']}{$subtotals[$cur_grouped_by]['units']}{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}{$totals['time']}{$totals['units']}{$user->currency|escape} {if $user->can('manage_invoices') || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}