From a536a682560e3f5d21c960994ebe410e5aef5931 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 20 Jul 2018 18:29:32 +0000 Subject: [PATCH] Fixed export to CSV and XML to include work units. --- WEB-INF/templates/footer.tpl | 2 +- tofile.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 95dec628..3d617784 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.92.4277 | Copyright © Anuko | +  Anuko Time Tracker 1.17.92.4278 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/tofile.php b/tofile.php index 909fdd3e..a06a9866 100644 --- a/tofile.php +++ b/tofile.php @@ -95,6 +95,9 @@ if ('xml' == $type) { $val = time_to_decimal($val); print "\t\n"; } + if ($bean->getAttribute('chunits')) { + print "\t\n"; + } if ($bean->getAttribute('chcost')) { print "\tcan('manage_invoices') || $user->isClient()) @@ -124,6 +127,7 @@ if ('xml' == $type) { $duration = time_to_decimal($duration); print "\t\n"; } + if ($bean->getAttribute('chunits')) print "\t\n"; if ($bean->getAttribute('chnote')) print "\t\n"; if ($bean->getAttribute('chcost')) { print "\tgetAttribute('chduration')) print ',"'.$i18n->get('label.duration').'"'; + if ($bean->getAttribute('chunits')) print ',"'.$i18n->get('label.work_units_short').'"'; if ($bean->getAttribute('chcost')) print ',"'.$i18n->get('label.cost').'"'; print "\n"; @@ -183,6 +188,7 @@ if ('csv' == $type) { $val = time_to_decimal($val); print ',"'.$val.'"'; } + if ($bean->getAttribute('chunits')) print ',"'.$subtotal['units'].'"'; if ($bean->getAttribute('chcost')) { if ($user->can('manage_invoices') || $user->isClient()) print ',"'.$subtotal['cost'].'"'; @@ -202,6 +208,7 @@ if ('csv' == $type) { if ($bean->getAttribute('chstart')) print ',"'.$i18n->get('label.start').'"'; if ($bean->getAttribute('chfinish')) print ',"'.$i18n->get('label.finish').'"'; if ($bean->getAttribute('chduration')) print ',"'.$i18n->get('label.duration').'"'; + if ($bean->getAttribute('chunits')) print ',"'.$i18n->get('label.work_units_short').'"'; if ($bean->getAttribute('chnote')) print ',"'.$i18n->get('label.note').'"'; if ($bean->getAttribute('chcost')) print ',"'.$i18n->get('label.cost').'"'; if ($bean->getAttribute('chpaid')) print ',"'.$i18n->get('label.paid').'"'; @@ -225,6 +232,7 @@ if ('csv' == $type) { $val = time_to_decimal($val); print ',"'.$val.'"'; } + if ($bean->getAttribute('chunits')) print ',"'.$item['units'].'"'; if ($bean->getAttribute('chnote')) print ',"'.str_replace('"','""',$item['note']).'"'; if ($bean->getAttribute('chcost')) { if ($user->can('manage_invoices') || $user->isClient()) -- 2.20.1