From 8ff2387ff0c042b1e67a3815c1d422a67cad1498 Mon Sep 17 00:00:00 2001 From: "Patrick Allaire, ptre" Date: Tue, 17 Dec 2019 22:18:37 -0500 Subject: [PATCH] Update du update --- .../views/administration/update/index.php | 12 +++++++++--- install/MySQL_DB_Schema.sql | 12 +++++++++++- install/update_v1-8_3a.sql | 10 ++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/app/application/views/administration/update/index.php b/app/application/views/administration/update/index.php index a529f2486..6ba16bb46 100644 --- a/app/application/views/administration/update/index.php +++ b/app/application/views/administration/update/index.php @@ -192,11 +192,17 @@ function versionsSQL ($comparable) { echo ''; echo ''; + //Mise à jour de la liste des installations dans le fichier local file_put_contents ("../install/get_updates_list", ''); - //Mise à jour de l'historique des installations dans la base de données - $CetteVersion = include("../app/application/config/tinyissue.php","r"); - (mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO update_history (Description, DteRelease, DteInstall) VALUES ('".$CetteVersion['version']." ".$CetteVersion['release']."','".$CetteVersion['release_date']."', NOW())")); + $CetteVersion = include("../app/application/config/tinyissue.php"); + $MaDate = explode("-", $CetteVersion["release_date"]); + $CetteVersion["release_date"] = (strlen($MaDate[0]) == 4) ? $CetteVersion["release_date"] : $MaDate[2].'-'.$MaDate[1].'-'.$MaDate[0]; + \DB::table('update_history')->insert(array( + 'Description'=>$CetteVersion['version'].$CetteVersion['release'], + 'DteRelease'=>$CetteVersion["release_date"], + 'DteInstall'=>date("Y-m-d H:i:s") + )); } else { echo 'Accès interdit'; echo ''; diff --git a/install/MySQL_DB_Schema.sql b/install/MySQL_DB_Schema.sql index 58b9c5938..f8f36f17f 100755 --- a/install/MySQL_DB_Schema.sql +++ b/install/MySQL_DB_Schema.sql @@ -297,4 +297,14 @@ VALUES ('6', 'Updated issue tags', 'update-issue-tags'); ##--# email = myemail@email.com ##--# password = admin INSERT INTO `users` (`id`, `role_id`, `email`, `password`, `firstname`, `lastname`, `language`, `created_at`, `updated_at`, `deleted`) VALUES -(NULL, 4, 'myemail@email.com', 'XhS.DHsB8wt1o', 'admin', 'admin', 'en', NOW(), NOW(), 0) \ No newline at end of file +(NULL, 4, 'myemail@email.com', 'XhS.DHsB8wt1o', 'admin', 'admin', 'en', NOW(), NOW(), 0); + +CREATE TABLE `update_history` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `Footprint` varchar(25) DEFAULT NULL, + `Description` varchar(100) DEFAULT NULL, + `DteRelease` datetime DEFAULT NULL, + `DteInstall` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/install/update_v1-8_3a.sql b/install/update_v1-8_3a.sql index fbc6da815..3aae1b71e 100644 --- a/install/update_v1-8_3a.sql +++ b/install/update_v1-8_3a.sql @@ -1 +1,11 @@ INSERT INTO activity (id, description,activity) VALUES (8, 'Move an issue from project A to project B', 'Changed issue`s project'); + +CREATE TABLE `update_history` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `Footprint` varchar(25) DEFAULT NULL, + `Description` varchar(100) DEFAULT NULL, + `DteRelease` datetime DEFAULT NULL, + `DteInstall` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +