From: Nik Okuntseff Date: Tue, 29 Mar 2016 03:31:38 +0000 (+0000) Subject: Cleaning up white space. X-Git-Tag: timetracker_1.19-1~1768 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=da102d8f0a2738cdbef4522abafc084c7cb66468;p=timetracker.git Cleaning up white space. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index f5f4cc8c..b815461b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1027,21 +1027,19 @@ class ttReportHelper { // The assignToInvoice assigns a set of records to a specific invoice. static function assignToInvoice($invoice_id, $time_log_ids, $expense_item_ids) { - $mdb2 = getConnection(); - if ($time_log_ids) { + $mdb2 = getConnection(); + if ($time_log_ids) { $sql = "update tt_log set invoice_id = ".$mdb2->quote($invoice_id). " where id in(".join(', ', $time_log_ids).")"; $affected = $mdb2->exec($sql); - if (is_a($affected, 'PEAR_Error')) - die($affected->getMessage()); - } + if (is_a($affected, 'PEAR_Error')) die($affected->getMessage()); + } if ($expense_item_ids) { $sql = "update tt_expense_items set invoice_id = ".$mdb2->quote($invoice_id). " where id in(".join(', ', $expense_item_ids).")"; $affected = $mdb2->exec($sql); - if (is_a($affected, 'PEAR_Error')) - die($affected->getMessage()); - } + if (is_a($affected, 'PEAR_Error')) die($affected->getMessage()); + } } // prepareReportBody - prepares an email body for report. @@ -1055,7 +1053,7 @@ class ttReportHelper { if ($group_by && 'no_grouping' != $group_by) $subtotals = ttReportHelper::getSubtotals($bean); $totals = ttReportHelper::getTotals($bean); - + // Use custom fields plugin if it is enabled. if (in_array('cf', explode(',', $user->plugins))) $custom_fields = new CustomFields($user->team_id); @@ -1071,21 +1069,21 @@ class ttReportHelper { $cellRightAligned = 'text-align: right; vertical-align: top;'; $cellLeftAlignedSubtotal = 'font-weight: bold; text-align: left; vertical-align: top;'; $cellRightAlignedSubtotal = 'font-weight: bold; text-align: right; vertical-align: top;'; - + // Start creating email body. $body = ''; $body .= ''; $body .= ''; - + // Output title. $body .= '

'.$i18n->getKey('form.mail.report_subject').': '.$totals['start_date'].' - '.$totals['end_date'].'

'; - + // Output comment. if ($comment) $body .= '

'.htmlspecialchars($comment).'

'; if ($bean->getAttribute('chtotalsonly')) { // Totals only report. Output subtotals. - + // Determine group_by header. if ('cf_1' == $group_by) $group_by_header = htmlspecialchars($custom_fields->fields[0]['label']); @@ -1093,7 +1091,7 @@ class ttReportHelper { $key = 'label.'.$group_by; $group_by_header = $i18n->getKey($key); } - + $body .= ''; $body .= ''; $body .= ''; @@ -1117,27 +1115,27 @@ class ttReportHelper { } $body .= ''; } - + // Print totals. $body .= ''; $body .= ''; $body .= ''; if ($bean->getAttribute('chduration')) { - $body .= ''; + $body .= ''; } if ($bean->getAttribute('chcost')) { - $body .= ''; + $body .= ''; } $body .= ''; - + $body .= '
'.$group_by_header.'
 
'.$i18n->getKey('label.total').''; - if ($totals['time'] <> '0:00') $body .= $totals['time']; - $body .= ''; + if ($totals['time'] <> '0:00') $body .= $totals['time']; + $body .= ''.htmlspecialchars($user->currency).' '; + $body .= ''.htmlspecialchars($user->currency).' '; $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; - $body .= '
'; } else { // Regular report. - + // Print table header. $body .= ''; $body .= ''; @@ -1165,7 +1163,7 @@ class ttReportHelper { if ($bean->getAttribute('chinvoice')) $body .= ''; $body .= ''; - + // Initialize variables to print subtotals. if ($items && 'no_grouping' != $group_by) { $print_subtotals = true; @@ -1177,7 +1175,7 @@ class ttReportHelper { $prev_date = ''; $cur_date = ''; $row_style = $rowItem; - + // Print report items. if (is_array($items)) { foreach ($items as $record) { @@ -1199,9 +1197,9 @@ class ttReportHelper { if ($bean->getAttribute('chduration')) $body .= ''; if ($bean->getAttribute('chnote')) $body .= ''; if ($bean->getAttribute('chcost')) { - $body .= ''; + $body .= ''; } if ($bean->getAttribute('chinvoice')) $body .= ''; $body .= ''; @@ -1209,7 +1207,7 @@ class ttReportHelper { } $first_pass = false; } - + // Print a regular row. if ($cur_date != $prev_date) $row_style = ($row_style == $rowItem) ? $rowItemAlt : $rowItem; @@ -1238,13 +1236,13 @@ class ttReportHelper { if ($bean->getAttribute('chinvoice')) $body .= ''; $body .= ''; - + $prev_date = $record['date']; if ($print_subtotals) $prev_grouped_by = $record['grouped_by']; } } - + // Print a terminating subtotal. if ($print_subtotals) { $body .= ''; @@ -1267,7 +1265,7 @@ class ttReportHelper { if ($bean->getAttribute('chinvoice')) $body .= ''; $body .= ''; } - + // Print totals. $body .= ''; $body .= ''; @@ -1282,16 +1280,16 @@ class ttReportHelper { if ($bean->getAttribute('chduration')) $body .= ''; if ($bean->getAttribute('chnote')) $body .= ''; if ($bean->getAttribute('chcost')) { - $body .= ''; + $body .= ''; } if ($bean->getAttribute('chinvoice')) $body .= ''; $body .= ''; - + $body .= '
'.$i18n->getKey('label.invoice').'
'.$subtotals[$prev_grouped_by]['time'].''; - $body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses']; - $body .= ''; + $body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses']; + $body .= '
'.htmlspecialchars($record['invoice']).'
 
'.$totals['time'].''.htmlspecialchars($user->currency).' '; - $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; - $body .= ''.htmlspecialchars($user->currency).' '; + $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; + $body .= '
'; } - + // Output footer. if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) $body .= '

'.$i18n->getKey('form.mail.footer').'

'; @@ -1301,19 +1299,19 @@ class ttReportHelper { return $body; } - -// prepareFavReportBody - prepares an email body for a favorite report. + + // prepareFavReportBody - prepares an email body for a favorite report. static function prepareFavReportBody($report) { - global $user; - global $i18n; - - $items = ttReportHelper::getFavItems($report); + global $user; + global $i18n; + + $items = ttReportHelper::getFavItems($report); $group_by = $report['group_by']; - if ($group_by && 'no_grouping' != $group_by) - $subtotals = ttReportHelper::getFavSubtotals($report); - $totals = ttReportHelper::getFavTotals($report); - + if ($group_by && 'no_grouping' != $group_by) + $subtotals = ttReportHelper::getFavSubtotals($report); + $totals = ttReportHelper::getFavTotals($report); + // Use custom fields plugin if it is enabled. if (in_array('cf', explode(',', $user->plugins))) $custom_fields = new CustomFields($user->team_id); @@ -1329,12 +1327,12 @@ class ttReportHelper { $cellRightAligned = 'text-align: right; vertical-align: top;'; $cellLeftAlignedSubtotal = 'font-weight: bold; text-align: left; vertical-align: top;'; $cellRightAlignedSubtotal = 'font-weight: bold; text-align: right; vertical-align: top;'; - + // Start creating email body. $body = ''; $body .= ''; $body .= ''; - + // Output title. $body .= '

'.$i18n->getKey('form.mail.report_subject').': '.$totals['start_date'].' - '.$totals['end_date'].'

'; @@ -1343,7 +1341,7 @@ class ttReportHelper { if ($report['show_totals_only']) { // Totals only report. Output subtotals. - + // Determine group_by header. if ('cf_1' == $group_by) $group_by_header = htmlspecialchars($custom_fields->fields[0]['label']); @@ -1351,7 +1349,7 @@ class ttReportHelper { $key = 'label.'.$group_by; $group_by_header = $i18n->getKey($key); } - + $body .= ''; $body .= ''; $body .= ''; @@ -1375,27 +1373,27 @@ class ttReportHelper { } $body .= ''; } - + // Print totals. $body .= ''; $body .= ''; $body .= ''; if ($report['show_duration']) { - $body .= ''; + $body .= ''; } if ($report['show_cost']) { - $body .= ''; + $body .= ''; } $body .= ''; - + $body .= '
'.$group_by_header.'
 
'.$i18n->getKey('label.total').''; - if ($totals['time'] <> '0:00') $body .= $totals['time']; - $body .= ''; + if ($totals['time'] <> '0:00') $body .= $totals['time']; + $body .= ''.htmlspecialchars($user->currency).' '; + $body .= ''.htmlspecialchars($user->currency).' '; $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; - $body .= '
'; } else { // Regular report. - + // Print table header. $body .= ''; $body .= ''; @@ -1423,7 +1421,7 @@ class ttReportHelper { if ($report['show_invoice']) $body .= ''; $body .= ''; - + // Initialize variables to print subtotals. if ($items && 'no_grouping' != $group_by) { $print_subtotals = true; @@ -1435,7 +1433,7 @@ class ttReportHelper { $prev_date = ''; $cur_date = ''; $row_style = $rowItem; - + // Print report items. if (is_array($items)) { foreach ($items as $record) { @@ -1463,11 +1461,11 @@ class ttReportHelper { } if ($report['show_invoice']) $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; } $first_pass = false; - } - + } + // Print a regular row. if ($cur_date != $prev_date) $row_style = ($row_style == $rowItem) ? $rowItemAlt : $rowItem; @@ -1496,13 +1494,13 @@ class ttReportHelper { if ($report['show_invoice']) $body .= ''; $body .= ''; - + $prev_date = $record['date']; if ($print_subtotals) $prev_grouped_by = $record['grouped_by']; } } - + // Print a terminating subtotal. if ($print_subtotals) { $body .= ''; @@ -1525,7 +1523,7 @@ class ttReportHelper { if ($report['show_invoice']) $body .= ''; $body .= ''; } - + // Print totals. $body .= ''; $body .= ''; @@ -1540,16 +1538,16 @@ class ttReportHelper { if ($report['show_duration']) $body .= ''; if ($report['show_note']) $body .= ''; if ($report['show_cost']) { - $body .= ''; + $body .= ''; } if ($report['show_invoice']) $body .= ''; $body .= ''; - + $body .= '
'.$i18n->getKey('label.invoice').'
 
 
'.htmlspecialchars($record['invoice']).'
 
'.$totals['time'].''.htmlspecialchars($user->currency).' '; - $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; - $body .= ''.htmlspecialchars($user->currency).' '; + $body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses']; + $body .= '
'; } - + // Output footer. if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) $body .= '

'.$i18n->getKey('form.mail.footer').'

'; @@ -1559,17 +1557,17 @@ class ttReportHelper { return $body; } - + // sendFavReport - sends a favorite report to a specified email, called from cron.php static function sendFavReport($report, $email) { // We are called from cron.php, we have no $bean in session. // cron.php set global $user and $i18n objects to match our favorite report user. global $user; global $i18n; - + // Prepare report body. $body = ttReportHelper::prepareFavReportBody($report); - + import('mail.Mailer'); $mailer = new Mailer(); $mailer->setCharSet(CHARSET); @@ -1579,7 +1577,7 @@ class ttReportHelper { $mailer->setSendType(MAIL_MODE); if (!$mailer->send($report['name'], $body)) return false; - + return true; } } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ce8a0e5f..fb4ff530 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.20.3451 | Copyright © Anuko | +  Anuko Time Tracker 1.9.20.3452 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}