X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=tofile.php;h=a06a986677cb48d3a3ee7b1cd8c85efd77c3ddbc;hb=de20a2009639bd1064c8d2b61a79d449c352409c;hp=62632fa979ee2ef76f0edcc3209bc2956e95cfea;hpb=45c855269d952873285f7a835e82fc2b3eff3971;p=timetracker.git
diff --git a/tofile.php b/tofile.php
index 62632fa9..a06a9866 100644
--- a/tofile.php
+++ b/tofile.php
@@ -95,9 +95,12 @@ if ('xml' == $type) {
$val = time_to_decimal($val);
print "\t\n";
}
+ if ($bean->getAttribute('chunits')) {
+ print "\t\n";
+ }
if ($bean->getAttribute('chcost')) {
print "\tcanManageTeam() || $user->isClient())
+ if ($user->can('manage_invoices') || $user->isClient())
print $subtotal['cost'];
else
print $subtotal['expenses'];
@@ -111,7 +114,7 @@ if ('xml' == $type) {
print "\n";
print "\t\n";
- if ($user->canManageTeam() || $user->isClient()) print "\t\n";
+ if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) print "\t\n";
if ($bean->getAttribute('chclient')) print "\t\n";
if ($bean->getAttribute('chproject')) print "\t\n";
if ($bean->getAttribute('chtask')) print "\t\n";
@@ -124,10 +127,11 @@ 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 "\tcanManageTeam() || $user->isClient())
+ if ($user->can('manage_invoices') || $user->isClient())
print $item['cost'];
else
print $item['expense'];
@@ -171,6 +175,7 @@ if ('csv' == $type) {
// Print headers.
print '"'.$group_by_header.'"';
if ($bean->getAttribute('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,8 +188,9 @@ if ('csv' == $type) {
$val = time_to_decimal($val);
print ',"'.$val.'"';
}
+ if ($bean->getAttribute('chunits')) print ',"'.$subtotal['units'].'"';
if ($bean->getAttribute('chcost')) {
- if ($user->canManageTeam() || $user->isClient())
+ if ($user->can('manage_invoices') || $user->isClient())
print ',"'.$subtotal['cost'].'"';
else
print ',"'.$subtotal['expenses'].'"';
@@ -194,7 +200,7 @@ if ('csv' == $type) {
} else {
// Normal report. Print headers.
print '"'.$i18n->get('label.date').'"';
- if ($user->canManageTeam() || $user->isClient()) print ',"'.$i18n->get('label.user').'"';
+ if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) print ',"'.$i18n->get('label.user').'"';
if ($bean->getAttribute('chclient')) print ',"'.$i18n->get('label.client').'"';
if ($bean->getAttribute('chproject')) print ',"'.$i18n->get('label.project').'"';
if ($bean->getAttribute('chtask')) print ',"'.$i18n->get('label.task').'"';
@@ -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').'"';
@@ -212,7 +219,7 @@ if ('csv' == $type) {
// Print items.
foreach ($items as $item) {
print '"'.$item['date'].'"';
- if ($user->canManageTeam() || $user->isClient()) print ',"'.str_replace('"','""',$item['user']).'"';
+ if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) print ',"'.str_replace('"','""',$item['user']).'"';
if ($bean->getAttribute('chclient')) print ',"'.str_replace('"','""',$item['client']).'"';
if ($bean->getAttribute('chproject')) print ',"'.str_replace('"','""',$item['project']).'"';
if ($bean->getAttribute('chtask')) print ',"'.str_replace('"','""',$item['task']).'"';
@@ -225,9 +232,10 @@ 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->canManageTeam() || $user->isClient())
+ if ($user->can('manage_invoices') || $user->isClient())
print ',"'.$item['cost'].'"';
else
print ',"'.$item['expense'].'"';