From 85329fe7459e5892082de3bd40459e7dfdb36f11 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 28 Oct 2018 17:56:59 +0000 Subject: [PATCH] Added 2 additional group by fields in database as part of ongoing work on multiple level grouping. --- WEB-INF/lib/ttFavReportHelper.class.php | 6 +++--- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 16 ++++++++++++++-- mysql.sql | 6 ++++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index 069ecbb5..adc6e2eb 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -84,7 +84,7 @@ class ttFavReportHelper { show_client, show_invoice, show_paid, show_ip, show_project, show_start, show_duration, show_cost, show_task, show_end, show_note, show_custom_field_1, show_work_units, - group_by, show_totals_only) + group_by1, show_totals_only) values(". $mdb2->quote($fields['name']).", ".$fields['user_id'].", ". $mdb2->quote($fields['client']).", ".$mdb2->quote($fields['option']).", ". @@ -139,7 +139,7 @@ class ttFavReportHelper { "show_note = ".$fields['chnote'].", ". "show_custom_field_1 = ".$fields['chcf_1'].", ". "show_work_units = ".$fields['chunits'].", ". - "group_by = ".$mdb2->quote($fields['group_by']).", ". + "group_by1 = ".$mdb2->quote($fields['group_by']).", ". "show_totals_only = ".$fields['chtotalsonly']. " where id = ".$fields['id']; $affected = $mdb2->exec($sql); @@ -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_by']); + $bean->setAttribute('group_by', $val['group_by1']); $bean->setAttribute('chtotalsonly', $val['show_totals_only']); $bean->setAttribute('new_fav_report', $val['name']); } else { diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 7167ac7f..52a5e808 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - + + + + + +
 Anuko Time Tracker 1.17.100.4324 | Copyright © Anuko | +  Anuko Time Tracker 1.18.00.4325 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 5144d196..097d2abe 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -956,6 +956,13 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } + if ($_POST["convert11797to11800"]) { + setChange("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL"); + setChange("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`"); + setChange("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`"); + setChange("UPDATE `tt_site_config` SET param_value = '1.18.00', modified = now() where param_name = 'version_db' and param_value = '1.17.97'"); + } + if ($_POST["cleanup"]) { $mdb2 = getConnection(); @@ -999,7 +1006,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.17.97) + Create database structure (v1.18.00)
(applies only to new installations, do not execute when updating)
@@ -1040,7 +1047,12 @@ if ($_POST) {
Update database structure (v1.17.44 to v1.17.97)

Update database structure (v1.17.97 to v1.18.00)
diff --git a/mysql.sql b/mysql.sql index 62c1d7c4..07a2323a 100644 --- a/mysql.sql +++ b/mysql.sql @@ -269,7 +269,9 @@ CREATE TABLE `tt_fav_reports` ( `show_custom_field_1` tinyint(4) NOT NULL default 0, # whether to show custom field 1 `show_work_units` tinyint(4) NOT NULL default 0, # whether to show work units `show_totals_only` tinyint(4) NOT NULL default 0, # whether to show totals only - `group_by` varchar(20) default NULL, # group by field + `group_by1` varchar(20) default NULL, # group by field 1 + `group_by2` varchar(20) default NULL, # group by field 2 + `group_by3` varchar(20) default NULL, # group by field 3 `status` tinyint(4) default 1, # favorite report status PRIMARY KEY (`id`) ); @@ -454,4 +456,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.17.97', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.00', now()); # TODO: change when structure changes. -- 2.20.1