From 957007719ca06e990ad29d9be24126decca8cac9 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff <support@anuko.com> 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 @@ <br> <table cellspacing="0" cellpadding="4" width="100%" border="0"> <tr> - <td align="center"> Anuko Time Tracker 1.18.65.4937 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> | + <td align="center"> Anuko Time Tracker 1.18.65.4938 | Copyright © <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> 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')}<td class="tableHeaderCentered" width="5%">{$i18n.label.finish}</td>{/if} {if $bean->getAttribute('chduration')}<td class="tableHeaderCentered" width="5%">{$i18n.label.duration}</td>{/if} {if $bean->getAttribute('chunits')}<td class="tableHeaderCentered" width="5%">{$i18n.label.work_units_short}</td>{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}<td class="tableHeader">{$i18n.label.note}</td>{/if} {if $bean->getAttribute('chcost')}<td class="tableHeaderCentered" width="5%">{$i18n.label.cost}</td>{/if} {if $bean->getAttribute('chapproved')}<td class="tableHeader">{$i18n.label.approved}</td>{/if} {if $bean->getAttribute('chpaid')}<td class="tableHeader">{$i18n.label.paid}</td>{/if} @@ -73,6 +74,7 @@ {if $bean->getAttribute('chfinish')}<td></td>{/if} {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotals[$prev_grouped_by]['time']}</td>{/if} {if $bean->getAttribute('chunits')}<td class="cellRightAlignedSubtotal">{$subtotals[$prev_grouped_by]['units']}</td>{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}<td></td>{/if} {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}</td>{/if} {if $bean->getAttribute('chapproved')}<td></td>{/if} {if $bean->getAttribute('chpaid')}<td></td>{/if} @@ -101,6 +103,7 @@ {if $bean->getAttribute('chfinish')}<td nowrap class="cellRightAligned">{$item.finish}</td>{/if} {if $bean->getAttribute('chduration')}<td class="cellRightAligned">{$item.duration}</td>{/if} {if $bean->getAttribute('chunits')}<td class="cellRightAligned">{$item.units}</td>{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}<td class="cellLeftAligned">{$item.note|escape}</td>{/if} {if $bean->getAttribute('chcost')}<td class="cellRightAligned">{if $user->can('manage_invoices') || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}</td>{/if} {if $bean->getAttribute('chapproved')}<td class="cellRightAligned">{if $item.approved == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>{/if} {if $bean->getAttribute('chpaid')}<td class="cellRightAligned">{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>{/if} @@ -113,7 +116,7 @@ {if 2 == $item.type}<td bgcolor="white"><input type="checkbox" name="item_id_{$item.id}"></td>{/if} {/if} </tr> - {if $bean->getAttribute('chnote') && $item.note} + {if $note_on_separate_row && $bean->getAttribute('chnote') && $item.note} <tr> <td class="cellRightAligned">{$i18n.label.note}:</td> <td colspan="{$colspan}">{$item.note|escape}</td> @@ -135,6 +138,7 @@ {if $bean->getAttribute('chfinish')}<td></td>{/if} {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotals[$cur_grouped_by]['time']}</td>{/if} {if $bean->getAttribute('chunits')}<td class="cellRightAlignedSubtotal">{$subtotals[$cur_grouped_by]['units']}</td>{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}<td></td>{/if} {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}</td>{/if} {if $bean->getAttribute('chapproved')}<td></td>{/if} {if $bean->getAttribute('chpaid')}<td></td>{/if} @@ -158,6 +162,7 @@ {if $bean->getAttribute('chfinish')}<td></td>{/if} {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$totals['time']}</td>{/if} {if $bean->getAttribute('chunits')}<td class="cellRightAlignedSubtotal">{$totals['units']}</td>{/if} + {if $bean->getAttribute('chnote') && !$note_on_separate_row}<td></td>{/if} {if $bean->getAttribute('chcost')}<td nowrap class="cellRightAlignedSubtotal">{$user->currency|escape} {if $user->can('manage_invoices') || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}</td>{/if} {if $bean->getAttribute('chapproved')}<td></td>{/if} {if $bean->getAttribute('chpaid')}<td></td>{/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