X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/2cb68f81bd4dd4f4a83afc87bbc292df6b7d7039..101cdfe54c97350fc65b140f3f27c5bdd466844e:/WEB-INF/lib/ttReportHelper.class.php diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 223d8e4b..bd882559 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -291,6 +291,13 @@ class ttReportHelper { // Add paid status. if ($canViewReports && $bean->getAttribute('chpaid')) array_push($fields, 'l.paid as paid'); + // Add IP address. + if ($canViewReports && $bean->getAttribute('chip')) { + 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) && $bean->getAttribute('chinvoice')) @@ -361,6 +368,14 @@ 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. + if ($canViewReports && $bean->getAttribute('chip')) { + 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) && $bean->getAttribute('chinvoice')) array_push($fields, 'i.name as invoice'); @@ -1239,6 +1254,8 @@ class ttReportHelper { $body .= '
| '.$i18n->getKey('label.date').' | '; - if ($user->canManageTeam() || $user->isClient()) + if ($canViewReports || $isClient) $body .= ''.$i18n->getKey('label.user').' | '; if ($report['show_client']) $body .= ''.$i18n->getKey('label.client').' | '; @@ -1548,7 +1577,7 @@ class ttReportHelper { $body .= '||||||
| '.$i18n->getKey('label.subtotal').' | '; $subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']); - if ($user->canManageTeam() || $user->isClient()) $body .= ''.($group_by == 'user' ? $subtotal_name : '').' | '; + if ($canViewReports || $isClient) $body .= ''.($group_by == 'user' ? $subtotal_name : '').' | '; if ($report['show_client']) $body .= ''.($group_by == 'client' ? $subtotal_name : '').' | '; if ($report['show_project']) $body .= ''.($group_by == 'project' ? $subtotal_name : '').' | '; if ($report['show_task']) $body .= ''.($group_by == 'task' ? $subtotal_name : '').' | '; @@ -1559,7 +1588,7 @@ class ttReportHelper { if ($report['show_note']) $body .= ''; if ($report['show_cost']) { $body .= ' | '; - $body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses']; + $body .= ($canViewReports || $isClient) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses']; $body .= ' | '; } if ($report['show_paid']) $body .= ''; @@ -1575,7 +1604,7 @@ class ttReportHelper { $row_style = ($row_style == $rowItem) ? $rowItemAlt : $rowItem; $body .= ' |
| '.$record['date'].' | '; - if ($user->canManageTeam() || $user->isClient()) + if ($canViewReports || $isClient) $body .= ''.htmlspecialchars($record['user']).' | '; if ($report['show_client']) $body .= ''.htmlspecialchars($record['client']).' | '; @@ -1615,7 +1644,7 @@ class ttReportHelper { $body .= '||||||
| '.$i18n->getKey('label.subtotal').' | '; $subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']); - if ($user->canManageTeam() || $user->isClient()) $body .= ''.($group_by == 'user' ? $subtotal_name : '').' | '; + if ($canViewReports || $isClient) $body .= ''.($group_by == 'user' ? $subtotal_name : '').' | '; if ($report['show_client']) $body .= ''.($group_by == 'client' ? $subtotal_name : '').' | '; if ($report['show_project']) $body .= ''.($group_by == 'project' ? $subtotal_name : '').' | '; if ($report['show_task']) $body .= ''.($group_by == 'task' ? $subtotal_name : '').' | '; @@ -1626,7 +1655,7 @@ class ttReportHelper { if ($report['show_note']) $body .= ''; if ($report['show_cost']) { $body .= ' | '; - $body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$cur_grouped_by]['cost'] : $subtotals[$cur_grouped_by]['expenses']; + $body .= ($canViewReports || $isClient) ? $subtotals[$cur_grouped_by]['cost'] : $subtotals[$cur_grouped_by]['expenses']; $body .= ' | '; } if ($report['show_paid']) $body .= ''; @@ -1638,7 +1667,7 @@ class ttReportHelper { $body .= ' |
| '.$i18n->getKey('label.total').' | '; - if ($user->canManageTeam() || $user->isClient()) $body .= ''; + if ($canViewReports || $isClient) $body .= ' | '; if ($report['show_client']) $body .= ' | '; if ($report['show_project']) $body .= ' | '; if ($report['show_task']) $body .= ' | '; @@ -1649,7 +1678,7 @@ class ttReportHelper { if ($report['show_note']) $body .= ' | '; if ($report['show_cost']) { $body .= ' | '.htmlspecialchars($user->currency).' '; - $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; + $body .= ($canViewReports || $isClient) ? $totals['cost'] : $totals['expenses']; $body .= ' | '; } if ($report['show_paid']) $body .= ''; |