Work in progress improving report formatting by placing note on a separate row.
authorNik Okuntseff <support@anuko.com>
Sun, 10 Mar 2019 17:48:44 +0000 (17:48 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 10 Mar 2019 17:48:44 +0000 (17:48 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/report.tpl
report.php

index a624fe1..30e8b2e 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.57.4856 | 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.57.4857 | 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 9e215c4..51afd6c 100644 (file)
@@ -48,7 +48,6 @@
   {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')}<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,7 +72,6 @@
         {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')}<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}
     {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')}<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}{/if}
     {if $bean->getAttribute('chpaid')}<td class="cellRightAligned">{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{/if}
       {if 2 == $item.type}<td bgcolor="white"><input type="checkbox" name="item_id_{$item.id}"></td>{/if}
     {/if}
       </tr>
+    {if $bean->getAttribute('chnote')}
+      <tr>
+        <td class="cellRightAligned">{$i18n.label.note}:</td>
+        <td colspan="{$colspan}">{$item.note|escape}</td>
+      </tr>
+    {/if}
     {$prev_date = $item.date}
     {if $print_subtotals} {$prev_grouped_by = $item.grouped_by} {/if}
   {/foreach}
     {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')}<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}
     {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')}<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}
index 4a29c32..9f29069 100644 (file)
@@ -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');