From 073ce24b1ae308defce4e057fc990607a3034380 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 28 Mar 2016 16:19:12 +0000 Subject: [PATCH] Refactoring whate space --- WEB-INF/lib/ttReportHelper.class.php | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 2aac4684..96dd24f0 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -385,44 +385,44 @@ class ttReportHelper { $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) { - if ($convertTo12Hour) { - if($val['start'] != '') - $val['start'] = ttTimeHelper::to12HourFormat($val['start']); - if($val['finish'] != '') - $val['finish'] = ttTimeHelper::to12HourFormat($val['finish']); + if ($convertTo12Hour) { + if($val['start'] != '') + $val['start'] = ttTimeHelper::to12HourFormat($val['start']); + if($val['finish'] != '') + $val['finish'] = ttTimeHelper::to12HourFormat($val['finish']); + } + if (isset($val['cost'])) { + if ('.' != $user->decimal_mark) + $val['cost'] = str_replace('.', $user->decimal_mark, $val['cost']); + } + if (isset($val['expense'])) { + if ('.' != $user->decimal_mark) + $val['expense'] = str_replace('.', $user->decimal_mark, $val['expense']); + } + if ('no_grouping' != $group_by_option) { + $val['grouped_by'] = $val[$group_by_option]; + if ('date' == $group_by_option) { + // This is needed to get the date in user date format. + $o_date = new DateAndTime(DB_DATEFORMAT, $val['grouped_by']); + $val['grouped_by'] = $o_date->toString($user->date_format); + unset($o_date); } - if (isset($val['cost'])) { - if ('.' != $user->decimal_mark) - $val['cost'] = str_replace('.', $user->decimal_mark, $val['cost']); - } - if (isset($val['expense'])) { - if ('.' != $user->decimal_mark) - $val['expense'] = str_replace('.', $user->decimal_mark, $val['expense']); - } - if ('no_grouping' != $group_by_option) { - $val['grouped_by'] = $val[$group_by_option]; - if ('date' == $group_by_option) { - // This is needed to get the date in user date format. - $o_date = new DateAndTime(DB_DATEFORMAT, $val['grouped_by']); - $val['grouped_by'] = $o_date->toString($user->date_format); - unset($o_date); - } - } - - // This is needed to get the date in user date format. - $o_date = new DateAndTime(DB_DATEFORMAT, $val['date']); - $val['date'] = $o_date->toString($user->date_format); - unset($o_date); - - $row = $val; - $report_items[] = $row; } - } else - die($res->getMessage()); + + // This is needed to get the date in user date format. + $o_date = new DateAndTime(DB_DATEFORMAT, $val['date']); + $val['date'] = $o_date->toString($user->date_format); + unset($o_date); + + $row = $val; + $report_items[] = $row; + } + } else + die($res->getMessage()); return $report_items; } - + // getFavItems retrieves all items associated with a favorite report. // It combines tt_log and tt_expense_items in one array for presentation in one table using mysql union all. // Expense items use the "note" field for item name. -- 2.20.1