X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/32acd0caf0385a9fb7014af70d1a0ad438191dd7..2995ff2439adb92ded267c1fb15c24f6001db648:/dbinstall.php diff --git a/dbinstall.php b/dbinstall.php index 74d566cc..d1b67d89 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -92,6 +92,11 @@ if ($request->isGet()) { echo('Error: PHP version is not high enough: '.phpversion().'. Required: '.$required_version.'.
'); } + // Check if PHP session path is writeable. + if (!is_writable(session_save_path())) { + echo('Error: PHP session path '.session_save_path().' is not writable.
'); + } + // Depending on DSN, require either mysqli or mysql extensions. if (strrpos(DSN, 'mysqli://', -strlen(DSN)) !== FALSE) { if (extension_loaded('mysqli')) { @@ -131,6 +136,11 @@ if ($request->isGet()) { } } + // Check is libxml is enabled (which is a PHP default). + if (!function_exists('libxml_clear_errors')) { + echo('Error: libxml is not enabled. It is required for import group operation (to parse XML).
'); + } + // Check database access. require_once('MDB2.php'); $conn = MDB2::connect(DSN); @@ -957,7 +967,7 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11836"]) { + if ($_POST["convert11797to11837"]) { 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`"); @@ -1044,6 +1054,14 @@ if ($_POST) { ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.34', modified = now() where param_name = 'version_db' and param_value = '1.18.26'"); ttExecute("update `tt_users` u inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.34') set u.quota_percent = 100.00 where u.quota_percent is null"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.36', modified = now() where param_name = 'version_db' and param_value = '1.18.34'"); + ttExecute("update `tt_users` u inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.36') set u.quota_percent = 100.00 where u.quota_percent is null"); + ttExecute("ALTER TABLE `tt_users` modify `quota_percent` float(6,2) NOT NULL default '100.00'"); + ttExecute("CREATE TABLE `tt_timesheets` (`id` int(11) NOT NULL auto_increment, `user_id` int(11) NOT NULL, `group_id` int(11) default NULL, `org_id` int(11) default NULL, `client_id` int(11) default NULL, `name` varchar(80) COLLATE utf8mb4_bin NOT NULL, `submit_status` tinyint(4) default NULL, `submitter_comment` text, `approval_status` tinyint(4) default NULL, `manager_comment` text, `created` datetime default NULL, `created_ip` varchar(45) default NULL, `created_by` int(11) default NULL, `modified` datetime default NULL, `modified_ip` varchar(45) default NULL, `modified_by` int(11) default NULL, `status` tinyint(4) default 1, PRIMARY KEY (`id`))"); + ttExecute("ALTER TABLE `tt_log` ADD `timesheet_id` int(11) default NULL AFTER `task_id`"); + ttExecute("create index timesheet_idx on tt_log(timesheet_id)"); + ttExecute("ALTER TABLE `tt_expense_items` ADD `timesheet_id` int(11) default NULL AFTER `project_id`"); + ttExecute("create index timesheet_idx on tt_expense_items(timesheet_id)"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.37', modified = now() where param_name = 'version_db' and param_value = '1.18.36'"); } if ($_POST["cleanup"]) { @@ -1091,7 +1109,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.36) + Create database structure (v1.18.37)
(applies only to new installations, do not execute when updating)
@@ -1136,8 +1154,8 @@ if ($_POST) { - Update database structure (v1.17.97 to v1.18.36) - + Update database structure (v1.17.97 to v1.18.37) +