From fb5b1697fdd701ada644b7e25f22a93a0893107c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 26 Apr 2019 20:12:03 +0000 Subject: [PATCH] Started to work on configurable holidays. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 10 ++++++---- mysql.sql | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index c4dd4795..c94bc7c0 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - + +
 Anuko Time Tracker 1.19.3.4988 | Copyright © Anuko | +  Anuko Time Tracker 1.19.4.4989 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index d318f9be..5dc943f2 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1161,7 +1161,7 @@ if ($_POST) { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to11903"]) { + if ($_POST["convert11900to11904"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1171,6 +1171,8 @@ if ($_POST) { ttExecute("INSERT INTO `tt_work_categories` (`id`, `parents`, `name`, `name_localized`) VALUES ('3', '1', 'PHP', NULL)"); ttExecute("INSERT INTO `tt_work_categories` (`id`, `parents`, `name`, `name_localized`) VALUES ('4', '1', 'C/C++', NULL)"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.3', modified = now() where param_name = 'version_db' and param_value = '1.19.0'"); + ttExecute("ALTER TABLE `tt_groups` ADD `holidays` text default null AFTER `lock_spec`"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.4', modified = now() where param_name = 'version_db' and param_value = '1.19.3'"); } if ($_POST["cleanup"]) { @@ -1220,7 +1222,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.19.3) + Create database structure (v1.19.4)
(applies only to new installations, do not execute when updating)
@@ -1269,8 +1271,8 @@ if ($_POST) {
Update database structure (v1.19 to v1.19.3)Update database structure (v1.19 to v1.19.4)
diff --git a/mysql.sql b/mysql.sql index bc79445e..be0d7edf 100644 --- a/mysql.sql +++ b/mysql.sql @@ -35,6 +35,7 @@ CREATE TABLE `tt_groups` ( `plugins` varchar(255) default NULL, # a list of enabled plugins for group `lock_spec` varchar(255) default NULL, # Cron specification for record locking, # for example: "0 10 * * 1" for "weekly on Mon at 10:00". + `holidays` text default NULL, # holidays specification `workday_minutes` smallint(4) default 480, # number of work minutes in a regular working day `custom_logo` tinyint(4) default 0, # whether to use a custom logo or not `config` text default NULL, # miscellaneous group configuration settings @@ -609,4 +610,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.19.3', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.19.4', now()); # TODO: change when structure changes. -- 2.20.1