From c1dab04d6ff59c3c8ced5d95b84090dd3bef03e1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Mar 2019 17:48:44 +0000 Subject: [PATCH] Work in progress improving report formatting by placing note on a separate row. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/report.tpl | 11 ++++++----- report.php | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index a624fe1b..30e8b2ef 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')}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -73,7 +72,6 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} - {if $bean->getAttribute('chnote')}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -101,7 +99,6 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} - {if $bean->getAttribute('chnote')}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {/if} + {if $bean->getAttribute('chnote')} + + + + + {/if} {$prev_date = $item.date} {if $print_subtotals} {$prev_grouped_by = $item.grouped_by} {/if} {/foreach} @@ -129,7 +132,6 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} - {if $bean->getAttribute('chnote')}{/if} {if $bean->getAttribute('chcost')}{/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} @@ -152,7 +154,6 @@ {if $bean->getAttribute('chfinish')}{/if} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} - {if $bean->getAttribute('chnote')}{/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 4a29c320..9f29069d 100644 --- a/report.php +++ b/report.php @@ -282,6 +282,24 @@ if ($report_items) { $smarty->assign('cur_grouped_by', ''); } +// Determine column span for note field. +$colspan = 1; +if ($bean->getAttribute('chuser')) $colspan++; +if ($bean->getAttribute('chclient')) $colspan++; +if ($bean->getAttribute('chproject')) $colspan++; +if ($bean->getAttribute('chtask')) $colspan++; +if ($bean->getAttribute('chcf_1')) $colspan++; +if ($bean->getAttribute('chstart')) $colspan++; +if ($bean->getAttribute('chfinish')) $colspan++; +if ($bean->getAttribute('chduration')) $colspan++; +if ($bean->getAttribute('chunits')) $colspan++; +if ($bean->getAttribute('chcost')) $colspan++; +if ($bean->getAttribute('chapproved')) $colspan++; +if ($bean->getAttribute('chpaid')) $colspan++; +if ($bean->getAttribute('chip')) $colspan++; +if ($bean->getAttribute('chinvoice')) $colspan++; +if ($bean->getAttribute('chtimesheet')) $colspan++; + // Assign variables that are used to alternate color of rows for different dates. $smarty->assign('prev_date', ''); $smarty->assign('cur_date', ''); @@ -290,6 +308,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('colspan', $colspan); $smarty->assign('bean', $bean); $smarty->assign('title', $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date']); $smarty->assign('content_page_name', 'report.tpl'); -- 2.20.1
 Anuko Time Tracker 1.18.57.4856 | Copyright © Anuko | +  Anuko Time Tracker 1.18.57.4857 | 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 9e215c4d..51afd6ca 100644 --- a/WEB-INF/templates/report.tpl +++ b/WEB-INF/templates/report.tpl @@ -48,7 +48,6 @@ {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} {if $bean->getAttribute('chpaid')}{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{/if} @@ -113,6 +110,12 @@ {if 2 == $item.type}
{$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}