From fa647157935f37f999ae81377b19f5ea72e7bbbb Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 1 Mar 2019 15:49:45 +0000 Subject: [PATCH] Changed structure of tt_timesheets table as part of redesign work. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 15 +++++++++++---- mysql.sql | 10 ++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index eb0fd592..ed56fe1f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - + +
 Anuko Time Tracker 1.18.46.4797 | Copyright © Anuko | +  Anuko Time Tracker 1.18.47.4798 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 09d55292..c6a72415 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -972,7 +972,7 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11846"]) { + if ($_POST["convert11797to11847"]) { ttExecute("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`"); @@ -1102,6 +1102,13 @@ if ($_POST) { ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.45', modified = now() where param_name = 'version_db' and param_value = '1.18.44'"); ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.45') set rights = replace(rights, 'view_client_timesheets,', '')"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.46', modified = now() where param_name = 'version_db' and param_value = '1.18.45'"); + ttExecute("ALTER TABLE `tt_timesheets` ADD `comment` text AFTER `name`"); + ttExecute("ALTER TABLE `tt_timesheets` ADD `start_date` date NOT NULL AFTER `comment`"); + ttExecute("ALTER TABLE `tt_timesheets` ADD `end_date` date NOT NULL AFTER `start_date`"); + ttExecute("ALTER TABLE `tt_timesheets` DROP `submitter_comment`"); + ttExecute("ALTER TABLE `tt_timesheets` CHANGE `approval_status` `approve_status` tinyint(4) default NULL"); + ttExecute("ALTER TABLE `tt_timesheets` CHANGE `manager_comment` `approve_comment` text"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.47', modified = now() where param_name = 'version_db' and param_value = '1.18.46'"); } if ($_POST["cleanup"]) { @@ -1150,7 +1157,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.46) + Create database structure (v1.18.47)
(applies only to new installations, do not execute when updating)
@@ -1195,8 +1202,8 @@ if ($_POST) {
Update database structure (v1.17.97 to v1.18.46)Update database structure (v1.17.97 to v1.18.47)
diff --git a/mysql.sql b/mysql.sql index d6cb375f..126902d1 100644 --- a/mysql.sql +++ b/mysql.sql @@ -496,10 +496,12 @@ CREATE TABLE `tt_timesheets` ( `org_id` int(11) default NULL, # organization id `client_id` int(11) default NULL, # client id `name` varchar(80) COLLATE utf8mb4_bin NOT NULL, # timesheet name + `comment` text, # timesheet comment + `start_date` date NOT NULL, # timesheet start date + `end_date` date NOT NULL, # timesheet end date `submit_status` tinyint(4) default NULL, # submit status - `submitter_comment` text, # submitter comment - `approval_status` tinyint(4) default NULL, # approval status - `manager_comment` text, # manager comment + `approve_status` tinyint(4) default NULL, # approve status + `approve_comment` text, # approve comment `created` datetime default NULL, # creation timestamp `created_ip` varchar(45) default NULL, # creator ip `created_by` int(11) default NULL, # creator user_id @@ -524,4 +526,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.46', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.47', now()); # TODO: change when structure changes. -- 2.20.1