From 47b6c704a5375b9f98376bf4eb727d4ee49fe3e2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 28 Oct 2018 18:43:40 +0000 Subject: [PATCH] Some fixes associated with renaming the group_by field. --- WEB-INF/lib/ttFavReportHelper.class.php | 10 +++++----- WEB-INF/lib/ttReportHelper.class.php | 8 ++++---- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/reports.tpl | 4 ++-- report.php | 10 +++++----- reports.php | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index adc6e2eb..96188f22 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -96,7 +96,7 @@ class ttFavReportHelper { $fields['chclient'].", ".$fields['chinvoice'].", ".$fields['chpaid'].", ".$fields['chip'].", ". $fields['chproject'].", ".$fields['chstart'].", ".$fields['chduration'].", ".$fields['chcost'].", ". $fields['chtask'].", ".$fields['chfinish'].", ".$fields['chnote'].", ".$fields['chcf_1'].", ".$fields['chunits'].", ". - $mdb2->quote($fields['group_by']).", ".$fields['chtotalsonly'].")"; + $mdb2->quote($fields['group_by1']).", ".$fields['chtotalsonly'].")"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; @@ -139,7 +139,7 @@ class ttFavReportHelper { "show_note = ".$fields['chnote'].", ". "show_custom_field_1 = ".$fields['chcf_1'].", ". "show_work_units = ".$fields['chunits'].", ". - "group_by1 = ".$mdb2->quote($fields['group_by']).", ". + "group_by1 = ".$mdb2->quote($fields['group_by1']).", ". "show_totals_only = ".$fields['chtotalsonly']. " where id = ".$fields['id']; $affected = $mdb2->exec($sql); @@ -209,7 +209,7 @@ class ttFavReportHelper { 'chnote'=>$bean->getAttribute('chnote'), 'chcf_1'=>$bean->getAttribute('chcf_1'), 'chunits'=>$bean->getAttribute('chunits'), - 'group_by'=>$bean->getAttribute('group_by'), + 'group_by1'=>$bean->getAttribute('group_by1'), 'chtotalsonly'=>$bean->getAttribute('chtotalsonly')); $id = false; @@ -270,7 +270,7 @@ class ttFavReportHelper { $bean->setAttribute('chnote', $val['show_note']); $bean->setAttribute('chcf_1', $val['show_custom_field_1']); $bean->setAttribute('chunits', $val['show_work_units']); - $bean->setAttribute('group_by', $val['group_by1']); + $bean->setAttribute('group_by1', $val['group_by1']); $bean->setAttribute('chtotalsonly', $val['show_totals_only']); $bean->setAttribute('new_fav_report', $val['name']); } else { @@ -295,7 +295,7 @@ class ttFavReportHelper { 'chnote'=>'1', 'chcf_1'=>'', 'chunits'=>'', - 'group_by'=>'', + 'group_by1'=>'', 'chtotalsonly'=>'', 'new_fav_report'=>'')); $bean->setAttributes($attrs); diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index e2bb8ddb..538830c3 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -127,7 +127,7 @@ class ttReportHelper { $canViewReports = $user->can('view_reports') || $user->can('view_all_reports'); $isClient = $user->isClient(); - $group_by_option = $options['group_by']; + $group_by_option = $options['group_by1']; $convertTo12Hour = ('%I:%M %p' == $user->time_format) && ($options['show_start'] || $options['show_end']); // Prepare a query for time items in tt_log table. @@ -394,7 +394,7 @@ class ttReportHelper { static function getSubtotals($options) { global $user; - $group_by_option = $options['group_by']; + $group_by_option = $options['group_by1']; if ('no_grouping' == $group_by_option) return null; $mdb2 = getConnection(); @@ -667,7 +667,7 @@ class ttReportHelper { $isClient = $user->isClient(); $items = ttReportHelper::getItems($options); - $group_by = $options['group_by']; + $group_by = $options['group_by1']; if ($group_by && 'no_grouping' != $group_by) $subtotals = ttReportHelper::getSubtotals($options); $totals = ttReportHelper::getTotals($options); @@ -1062,7 +1062,7 @@ class ttReportHelper { $options['show_custom_field_1'] = $bean->getAttribute('chcf_1'); $options['show_work_units'] = $bean->getAttribute('chunits'); $options['show_totals_only'] = $bean->getAttribute('chtotalsonly'); - $options['group_by'] = $bean->getAttribute('group_by'); + $options['group_by1'] = $bean->getAttribute('group_by1'); return $options; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 52a5e808..a54d6aa6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - + diff --git a/report.php b/report.php index cd093e40..efbaccea 100644 --- a/report.php +++ b/report.php @@ -69,7 +69,7 @@ $client_id = $bean->getAttribute('client'); // Do we need to show checkboxes? if ($bean->getAttribute('chpaid') || - ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by')) && !$user->isClient())) { + ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by1')) && !$user->isClient())) { if ($user->can('manage_invoices')) $smarty->assign('use_checkboxes', true); } @@ -92,7 +92,7 @@ if ($user->can('manage_invoices') && $bean->getAttribute('chpaid')) { // Controls for "Assign to invoice" block. if ($user->can('manage_invoices') && - ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by')) && !$user->isClient())) { + ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by1')) && !$user->isClient())) { // Client is selected and we are displaying the invoice column. $recent_invoices = ttTeamHelper::getRecentInvoices($user->group_id, $client_id); if ($recent_invoices) { @@ -170,7 +170,7 @@ if ($request->isPost()) { } } // isPost -$group_by = $bean->getAttribute('group_by'); +$group_by = $bean->getAttribute('group_by1'); $options = ttReportHelper::getReportOptions($bean); $report_items = ttReportHelper::getItems($options); @@ -183,10 +183,10 @@ if ('no_grouping' != $group_by) $totals = ttReportHelper::getTotals($options); // Assign variables that are used to print subtotals. -if ($report_items && 'no_grouping' != $group_by) { +if ($report_items && 'no_grouping' != $group_by1) { $smarty->assign('print_subtotals', true); $smarty->assign('first_pass', true); - $smarty->assign('group_by', $group_by); + $smarty->assign('group_by1', $group_by1); $smarty->assign('prev_grouped_by', ''); $smarty->assign('cur_grouped_by', ''); } diff --git a/reports.php b/reports.php index dae0c180..39f09c0b 100644 --- a/reports.php +++ b/reports.php @@ -233,7 +233,7 @@ if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['ty $group_by_options['cf_1'] = $custom_fields->fields[0]['label']; } $group_by_options_size = sizeof($group_by_options); -$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by','data'=>$group_by_options)); +$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by1','data'=>$group_by_options)); if (defined('MULTIPLE_GROUP_BY_DEBUG') && isTrue(MULTIPLE_GROUP_BY_DEBUG)) { if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','name'=>'group_by2','data'=>$group_by_options)); if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','name'=>'group_by3','data'=>$group_by_options)); -- 2.20.1
 Anuko Time Tracker 1.18.00.4325 | Copyright © Anuko | +  Anuko Time Tracker 1.18.01.4326 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 9c8221ad..feb5800f 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -138,7 +138,7 @@ function selectAssignedUsers(project_id) { function handleCheckboxes() { var totalsOnlyCheckbox = document.getElementById("chtotalsonly"); var totalsOnlyLabel = document.getElementById("totals_only_label"); - if ("no_grouping" == document.getElementById("group_by").value) { + if ("no_grouping" == document.getElementById("group_by1").value) { // Unmark and disable the "Totals only" checkbox. totalsOnlyCheckbox.checked = false; totalsOnlyCheckbox.style.visibility = "hidden"; @@ -302,7 +302,7 @@ function handleCheckboxes() { {$i18n.form.reports.group_by}
{$forms.reportForm.group_by.control}{$forms.reportForm.group_by1.control} {$forms.reportForm.group_by2.control} {$forms.reportForm.group_by3.control}