Added timesheet output to CSV, XML, and PDF reports.
authorNik Okuntseff <support@anuko.com>
Sat, 23 Feb 2019 15:30:54 +0000 (15:30 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 23 Feb 2019 15:30:54 +0000 (15:30 +0000)
WEB-INF/templates/footer.tpl
tofile.php
topdf.php

index 22f2835..494d7e1 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.37.4758 | 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.37.4759 | 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 3ddce97..f4d5b29 100644 (file)
@@ -146,6 +146,7 @@ if ('xml' == $type) {
         print "\t<ip><![CDATA[".$ip."]]></ip>\n";
       }
       if ($bean->getAttribute('chinvoice')) print "\t<invoice><![CDATA[".$item['invoice']."]]></invoice>\n";
+      if ($bean->getAttribute('chtimesheet')) print "\t<timesheet><![CDATA[".$item['timesheet_name']."]]></timesheet>\n";
 
       print "</row>\n";
     }
@@ -209,6 +210,7 @@ if ('csv' == $type) {
     if ($bean->getAttribute('chpaid')) print ',"'.$i18n->get('label.paid').'"';
     if ($bean->getAttribute('chip')) print ',"'.$i18n->get('label.ip').'"';
     if ($bean->getAttribute('chinvoice')) print ',"'.$i18n->get('label.invoice').'"';
+    if ($bean->getAttribute('chtimesheet')) print ',"'.$i18n->get('label.timesheet').'"';
     print "\n";
 
     // Print items.
@@ -241,6 +243,7 @@ if ('csv' == $type) {
         print ',"'.$ip.'"';
       }
       if ($bean->getAttribute('chinvoice')) print ',"'.str_replace('"','""',$item['invoice']).'"';
+      if ($bean->getAttribute('chtimesheet')) print ',"'.str_replace('"','""',$item['timesheet_name']).'"';
       print "\n";
     }
   }
index 181dec6..a0be19e 100644 (file)
--- a/topdf.php
+++ b/topdf.php
@@ -159,6 +159,7 @@ if ($totals_only) {
   if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.paid').'</td>'; }
   if ($bean->getAttribute('chip')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.ip').'</td>'; }
   if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= '<td>'.$i18n->get('label.invoice').'</td>'; }
+  if ($bean->getAttribute('chtimesheet')) { $colspan++; $html .= '<td>'.$i18n->get('label.timesheet').'</td>'; }
   $html .= '</tr>';
   $html .= '</thead>';
 
@@ -211,6 +212,7 @@ if ($totals_only) {
         if ($bean->getAttribute('chpaid')) $html .= '<td></td>';
         if ($bean->getAttribute('chip')) $html .= '<td></td>';
         if ($bean->getAttribute('chinvoice')) $html .= '<td></td>';
+        if ($bean->getAttribute('chtimesheet')) $html .= '<td></td>';
         $html .= '</tr>';
         $html .= '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>';
       }
@@ -249,6 +251,7 @@ if ($totals_only) {
         $html .= '</td>';
     }
     if ($bean->getAttribute('chinvoice')) $html .= '<td>'.htmlspecialchars($item['invoice']).'</td>';
+    if ($bean->getAttribute('chtimesheet')) $html .= '<td>'.htmlspecialchars($item['timesheet_name']).'</td>';
     $html .= '</tr>';
 
     $prev_date = $item['date'];
@@ -300,6 +303,7 @@ if ($totals_only) {
     if ($bean->getAttribute('chpaid')) $html .= '<td></td>';
     if ($bean->getAttribute('chip')) $html .= '<td></td>';
     if ($bean->getAttribute('chinvoice')) $html .= '<td></td>';
+    if ($bean->getAttribute('chtimesheet')) $html .= '<td></td>';
     $html .= '</tr>';
   }
 
@@ -328,6 +332,7 @@ if ($totals_only) {
   if ($bean->getAttribute('chpaid')) $html .= '<td></td>';
   if ($bean->getAttribute('chip')) $html .= '<td></td>';
   if ($bean->getAttribute('chinvoice')) $html .= '<td></td>';
+  if ($bean->getAttribute('chtimesheet')) $html .= '<td></td>';
   $html .= '</tr>';
   $html .= '</table>';
 }