X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=topdf.php;h=e3801d273ef3cb3cf5424399c16f4e88a3dffd11;hb=32173f5d1d4c523d9f3223489651049cafad9a5e;hp=0040c7be926bb504c9d9a1d9393f9e14eacb55a3;hpb=405a3dc75eaf770313b2da57bc25088e5c6e76bd;p=timetracker.git
diff --git a/topdf.php b/topdf.php
index 0040c7be..e3801d27 100644
--- a/topdf.php
+++ b/topdf.php
@@ -64,14 +64,15 @@ $totals_only = ($bean->getAttribute('chtotalsonly') == '1');
// Obtain items for report.
$options = ttReportHelper::getReportOptions($bean);
+$grouping = ttReportHelper::grouping($options);
if (!$totals_only)
$items = ttReportHelper::getItems($options); // Individual entries.
-if ($totals_only || 'no_grouping' != $group_by1)
+if ($totals_only || $grouping)
$subtotals = ttReportHelper::getSubtotals($options); // Subtotals for groups of items.
$totals = ttReportHelper::getTotals($options); // Totals for the entire report.
// Assign variables that are used to print subtotals.
-if ($items && 'no_grouping' != $group_by1) {
+if ($items && $grouping) {
$print_subtotals = true;
$first_pass = true;
$prev_grouped_by = '';
@@ -171,27 +172,27 @@ if ($totals_only) {
$html .= '
'.$i18n->get('label.subtotal').' | ';
if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) {
$html .= '';
- if ($group_by1 == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['user']);
$html .= ' | ';
}
if ($bean->getAttribute('chclient')) {
$html .= '';
- if ($group_by1 == 'client') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['client']);
$html .= ' | ';
}
if ($bean->getAttribute('chproject')) {
$html .= '';
- if ($group_by1 == 'project') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['project']);
$html .= ' | ';
}
if ($bean->getAttribute('chtask')) {
$html .= '';
- if ($group_by1 == 'task') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['task']);
$html .= ' | ';
}
if ($bean->getAttribute('chcf_1')) {
$html .= '';
- if ($group_by1 == 'cf_1') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['cf_1']);
$html .= ' | ';
}
if ($bean->getAttribute('chstart')) $html .= ' | ';
@@ -260,27 +261,27 @@ if ($totals_only) {
$html .= ''.$i18n->get('label.subtotal').' | ';
if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) {
$html .= '';
- if ($group_by1 == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['user']);
$html .= ' | ';
}
if ($bean->getAttribute('chclient')) {
$html .= '';
- if ($group_by1 == 'client') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['client']);
$html .= ' | ';
}
if ($bean->getAttribute('chproject')) {
$html .= '';
- if ($group_by1 == 'project') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['project']);
$html .= ' | ';
}
if ($bean->getAttribute('chtask')) {
$html .= '';
- if ($group_by1 == 'task') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['task']);
$html .= ' | ';
}
if ($bean->getAttribute('chcf_1')) {
$html .= '';
- if ($group_by1 == 'cf_1') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['cf_1']);
$html .= ' | ';
}
if ($bean->getAttribute('chstart')) $html .= ' | ';