X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttReportHelper.class.php;h=1f797ace4580068bd21bbaede3dd291f12c64650;hb=d40763fdef73f3118da81b497baafff29a73c5ba;hp=b5208bc7f6c8d0f13aebbfe59001c9a6f8891fcc;hpb=f0e54f23029d8b109c0ab554ab2b49195d204391;p=timetracker.git
diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php
index b5208bc7..1f797ace 100644
--- a/WEB-INF/lib/ttReportHelper.class.php
+++ b/WEB-INF/lib/ttReportHelper.class.php
@@ -368,12 +368,12 @@ class ttReportHelper {
// Add paid status.
if ($canViewReports && $bean->getAttribute('chpaid'))
array_push($fields, 'ei.paid as paid');
- // Add IP address. NULL for now for expenses.
+ // Add IP address.
if ($canViewReports && $bean->getAttribute('chip')) {
- array_push($fields, 'null as created');
- array_push($fields, 'null as created_ip');
- array_push($fields, 'null as modified');
- array_push($fields, 'null as modified_ip');
+ array_push($fields, 'ei.created as created');
+ array_push($fields, 'ei.created_ip as created_ip');
+ array_push($fields, 'ei.modified as modified');
+ array_push($fields, 'ei.modified_ip as modified_ip');
}
// Add invoice name if it is selected.
@@ -553,6 +553,16 @@ class ttReportHelper {
array_push($fields, "cast(l.billable * coalesce(upb.rate, 0) * time_to_sec(l.duration)/3600 as decimal(10,2)) as cost"); // Use project rate for user.
array_push($fields, "null as expense");
}
+ // Add paid status.
+ if ($canViewReports && $report['show_paid'])
+ array_push($fields, 'l.paid as paid');
+ // Add IP address.
+ if ($canViewReports && $report['show_ip']) {
+ array_push($fields, 'l.created as created');
+ array_push($fields, 'l.created_ip as created_ip');
+ array_push($fields, 'l.modified as modified');
+ array_push($fields, 'l.modified_ip as modified_ip');
+ }
// Add invoice name if it is selected.
if (($canViewReports || $isClient) && $report['show_invoice'])
array_push($fields, 'i.name as invoice');
@@ -619,6 +629,16 @@ class ttReportHelper {
array_push($fields, 'ei.name as note');
array_push($fields, 'ei.cost as cost');
array_push($fields, 'ei.cost as expense');
+ // Add paid status.
+ if ($canViewReports && $report['show_paid'])
+ array_push($fields, 'ei.paid as paid');
+ // Add IP address.
+ if ($canViewReports && $report['show_ip']) {
+ array_push($fields, 'ei.created as created');
+ array_push($fields, 'ei.created_ip as created_ip');
+ array_push($fields, 'ei.modified as modified');
+ array_push($fields, 'ei.modified_ip as modified_ip');
+ }
// Add invoice name if it is selected.
if (($canViewReports || $isClient) && $report['show_invoice'])
array_push($fields, 'i.name as invoice');
@@ -1254,6 +1274,8 @@ class ttReportHelper {
$body .= '
'.$i18n->getKey('label.cost').' | ';
if ($bean->getAttribute('chpaid'))
$body .= ''.$i18n->getKey('label.paid').' | ';
+ if ($bean->getAttribute('chip'))
+ $body .= ''.$i18n->getKey('label.ip').' | ';
if ($bean->getAttribute('chinvoice'))
$body .= ''.$i18n->getKey('label.invoice').' | ';
$body .= '';
@@ -1296,6 +1318,7 @@ class ttReportHelper {
$body .= '';
}
if ($bean->getAttribute('chpaid')) $body .= ' | ';
+ if ($bean->getAttribute('chip')) $body .= ' | ';
if ($bean->getAttribute('chinvoice')) $body .= ' | ';
$body .= '';
$body .= ' |
';
@@ -1333,6 +1356,11 @@ class ttReportHelper {
$body .= $record['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no');
$body .= '';
}
+ if ($bean->getAttribute('chip')) {
+ $body .= '';
+ $body .= $record['modified'] ? $record['modified_ip'].' '.$record['modified'] : $record['created_ip'].' '.$record['created'];
+ $body .= ' | ';
+ }
if ($bean->getAttribute('chinvoice'))
$body .= ''.htmlspecialchars($record['invoice']).' | ';
$body .= '';
@@ -1363,6 +1391,7 @@ class ttReportHelper {
$body .= '';
}
if ($bean->getAttribute('chpaid')) $body .= ' | ';
+ if ($bean->getAttribute('chip')) $body .= ' | ';
if ($bean->getAttribute('chinvoice')) $body .= ' | ';
$body .= '';
}
@@ -1386,6 +1415,7 @@ class ttReportHelper {
$body .= '';
}
if ($bean->getAttribute('chpaid')) $body .= ' | ';
+ if ($bean->getAttribute('chip')) $body .= ' | ';
if ($bean->getAttribute('chinvoice')) $body .= ' | ';
$body .= '';
@@ -1540,6 +1570,8 @@ class ttReportHelper {
$body .= ''.$i18n->getKey('label.cost').' | ';
if ($report['show_paid'])
$body .= ''.$i18n->getKey('label.paid').' | ';
+ if ($report['show_ip'])
+ $body .= ''.$i18n->getKey('label.ip').' | ';
if ($report['show_invoice'])
$body .= ''.$i18n->getKey('label.invoice').' | ';
$body .= '';
@@ -1582,6 +1614,7 @@ class ttReportHelper {
$body .= '';
}
if ($report['show_paid']) $body .= ' | ';
+ if ($report['show_ip']) $body .= ' | ';
if ($report['show_invoice']) $body .= ' | ';
$body .= '';
$body .= ' |
';
@@ -1619,6 +1652,11 @@ class ttReportHelper {
$body .= $record['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no');
$body .= '';
}
+ if ($report['show_ip']) {
+ $body .= '';
+ $body .= $record['modified'] ? $record['modified_ip'].' '.$record['modified'] : $record['created_ip'].' '.$record['created'];
+ $body .= ' | ';
+ }
if ($report['show_invoice'])
$body .= ''.htmlspecialchars($record['invoice']).' | ';
$body .= '';
@@ -1649,6 +1687,7 @@ class ttReportHelper {
$body .= '';
}
if ($report['show_paid']) $body .= ' | ';
+ if ($report['show_ip']) $body .= ' | ';
if ($report['show_invoice']) $body .= ' | ';
$body .= '';
}
@@ -1672,6 +1711,7 @@ class ttReportHelper {
$body .= '';
}
if ($report['show_paid']) $body .= ' | ';
+ if ($report['show_ip']) $body .= ' | ';
if ($report['show_invoice']) $body .= ' | ';
$body .= '';