From 18ecb507a76c7960dd3d8d2c64264e1f4f4b8952 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 23 Feb 2019 15:30:54 +0000 Subject: [PATCH] Added timesheet output to CSV, XML, and PDF reports. --- WEB-INF/templates/footer.tpl | 2 +- tofile.php | 3 +++ topdf.php | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 22f28353..494d7e18 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- '; } if ($bean->getAttribute('chip')) { $colspan++; $html .= "'; } if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chtimesheet')) { $colspan++; $html .= ''; } $html .= ''; $html .= ''; @@ -211,6 +212,7 @@ if ($totals_only) { if ($bean->getAttribute('chpaid')) $html .= ''; if ($bean->getAttribute('chip')) $html .= ''; if ($bean->getAttribute('chinvoice')) $html .= ''; + if ($bean->getAttribute('chtimesheet')) $html .= ''; $html .= ''; $html .= ''; } @@ -249,6 +251,7 @@ if ($totals_only) { $html .= ''; } if ($bean->getAttribute('chinvoice')) $html .= ''; + if ($bean->getAttribute('chtimesheet')) $html .= ''; $html .= ''; $prev_date = $item['date']; @@ -300,6 +303,7 @@ if ($totals_only) { if ($bean->getAttribute('chpaid')) $html .= ''; if ($bean->getAttribute('chip')) $html .= ''; if ($bean->getAttribute('chinvoice')) $html .= ''; + if ($bean->getAttribute('chtimesheet')) $html .= ''; $html .= ''; } @@ -328,6 +332,7 @@ if ($totals_only) { if ($bean->getAttribute('chpaid')) $html .= ''; if ($bean->getAttribute('chip')) $html .= ''; if ($bean->getAttribute('chinvoice')) $html .= ''; + if ($bean->getAttribute('chtimesheet')) $html .= ''; $html .= ''; $html .= '
 Anuko Time Tracker 1.18.37.4758 | Copyright © Anuko | +  Anuko Time Tracker 1.18.37.4759 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/tofile.php b/tofile.php index 3ddce979..f4d5b29e 100644 --- a/tofile.php +++ b/tofile.php @@ -146,6 +146,7 @@ if ('xml' == $type) { print "\t\n"; } if ($bean->getAttribute('chinvoice')) print "\t\n"; + if ($bean->getAttribute('chtimesheet')) print "\t\n"; print "\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"; } } diff --git a/topdf.php b/topdf.php index 181dec69..a0be19ec 100644 --- a/topdf.php +++ b/topdf.php @@ -159,6 +159,7 @@ if ($totals_only) { if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "".$i18n->get('label.paid').'".$i18n->get('label.ip').''.$i18n->get('label.invoice').''.$i18n->get('label.timesheet').'
 
'.htmlspecialchars($item['invoice']).''.htmlspecialchars($item['timesheet_name']).'
'; } -- 2.20.1