X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=tofile.php;h=f4d5b29e83e455b8d13a4668ff08d6f7b076ee85;hb=1e2a1839bd4b4530a43dfcdc3f0582623edd5486;hp=445b32d941e7f2189e3ed7ac8155140dda416eb4;hpb=7faef0e6d81444ad3ae10d1a2ce62fa753c80a9f;p=timetracker.git
diff --git a/tofile.php b/tofile.php
index 445b32d9..f4d5b29e 100644
--- a/tofile.php
+++ b/tofile.php
@@ -32,7 +32,7 @@ import('form.ActionForm');
import('ttReportHelper');
// Access checks.
-if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports'))) {
+if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports') || ttAccessAllowed('view_client_reports'))) {
header('Location: access_denied.php');
exit();
}
@@ -41,7 +41,7 @@ if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports'))) {
// Use custom fields plugin if it is enabled.
if ($user->isPluginEnabled('cf')) {
require_once('plugins/CustomFields.class.php');
- $custom_fields = new CustomFields($user->group_id);
+ $custom_fields = new CustomFields();
}
// Report settings are stored in session bean before we get here.
@@ -94,7 +94,7 @@ if ('xml' == $type) {
print "\t<".$group_by_tag.">".$group_by_tag.">\n";
if ($bean->getAttribute('chduration')) {
$val = $subtotal['time'];
- if($val && isTrue(EXPORT_DECIMAL_DURATION))
+ if($val && isTrue('EXPORT_DECIMAL_DURATION'))
$val = time_to_decimal($val);
print "\t\n";
}
@@ -126,7 +126,7 @@ if ('xml' == $type) {
if ($bean->getAttribute('chfinish')) print "\t\n";
if ($bean->getAttribute('chduration')) {
$duration = $item['duration'];
- if($duration && isTrue(EXPORT_DECIMAL_DURATION))
+ if($duration && isTrue('EXPORT_DECIMAL_DURATION'))
$duration = time_to_decimal($duration);
print "\t\n";
}
@@ -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";
}
@@ -179,7 +180,7 @@ if ('csv' == $type) {
print '"'.$subtotal['name'].'"';
if ($bean->getAttribute('chduration')) {
$val = $subtotal['time'];
- if($val && isTrue(EXPORT_DECIMAL_DURATION))
+ if($val && isTrue('EXPORT_DECIMAL_DURATION'))
$val = time_to_decimal($val);
print ',"'.$val.'"';
}
@@ -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.
@@ -223,7 +225,7 @@ if ('csv' == $type) {
if ($bean->getAttribute('chfinish')) print ',"'.$item['finish'].'"';
if ($bean->getAttribute('chduration')) {
$val = $item['duration'];
- if($val && isTrue(EXPORT_DECIMAL_DURATION))
+ if($val && isTrue('EXPORT_DECIMAL_DURATION'))
$val = time_to_decimal($val);
print ',"'.$val.'"';
}
@@ -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";
}
}