X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=topdf.php;h=fd3016e5528d7489648c4e96bd91b03883d044bc;hb=54bb71ed8e6b7f79e3b26bc1c8a70a95793950c8;hp=23f29d5084c3ef0905652faf3809681d2ec1839c;hpb=913eba1427598741fcfb8d1e53746923c1f9e0e4;p=timetracker.git diff --git a/topdf.php b/topdf.php index 23f29d50..fd3016e5 100644 --- a/topdf.php +++ b/topdf.php @@ -52,7 +52,7 @@ require_once('WEB-INF/lib/tcpdf/tcpdf.php'); // 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. @@ -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 || ttReportHelper::grouping($options)) +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 .= '';