X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=tofile.php;h=5a190f4bb595e6505706283b8d8ca094db5a9197;hb=e4ddcc8ecb86ac997048d648ed82402eff2cbb4a;hp=909fdd3eb9d3602714d685957e2969b67e2828f5;hpb=047bc803a5228a0a786462cabdfa5fdd9be762a4;p=timetracker.git diff --git a/tofile.php b/tofile.php index 909fdd3e..5a190f4b 100644 --- a/tofile.php +++ b/tofile.php @@ -58,10 +58,11 @@ $type = $request->getParameter('type'); $totals_only = $bean->getAttribute('chtotalsonly'); // Obtain items. +$options = ttReportHelper::getReportOptions($bean); if ($totals_only) - $subtotals = ttReportHelper::getSubtotals($bean); + $subtotals = ttReportHelper::getSubtotals($bean, $options); else - $items = ttReportHelper::getItems($bean); + $items = ttReportHelper::getItems($bean, $options); // Build a string to use as filename for the files being downloaded. $filename = strtolower($i18n->get('title.report')).'_'.$bean->mValues['start_date'].'_'.$bean->mValues['end_date']; @@ -95,6 +96,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 +128,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 +189,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 +209,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 +233,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())