From d32925eefcb2a4faf7177dca6ce063e5428570b0 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 13 Mar 2024 14:03:07 -0400 Subject: [PATCH 01/24] Tidy --- post/event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post/event.php b/post/event.php index 2955a31cf..aa729f8d2 100644 --- a/post/event.php +++ b/post/event.php @@ -74,7 +74,7 @@ 'subject' => $subject, 'body' => $body ] - ]; + ]; $mail = addToMailQueue($mysqli, $data); // Logging for email (success/fail) From 27a96c2293ef5ce7344a70cc8e0a6a8990529b38 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 15 Mar 2024 18:32:42 -0400 Subject: [PATCH 02/24] Add Important asset, document, file, add file Description to DB Structure --- database_updates.php | 17 ++++++++++++++--- database_version.php | 2 +- db.sql | 6 +++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/database_updates.php b/database_updates.php index f509e09a4..74f606911 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1636,10 +1636,21 @@ mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.0'"); } - // if (CURRENT_DATABASE_VERSION == '1.1.0') { - // // Insert queries here required to update to DB version 1.1.1 + if (CURRENT_DATABASE_VERSION == '1.1.0') { + mysqli_query($mysqli, "ALTER TABLE `files` ADD `file_description` TEXT DEFAULT NULL AFTER `file_name`"); + mysqli_query($mysqli, "ALTER TABLE `files` ADD `file_important` TINYINT(1) NOT NULL DEFAULT '0' AFTER `file_hash`"); + + mysqli_query($mysqli, "ALTER TABLE `documents` ADD `document_important` TINYINT(1) NOT NULL DEFAULT '0' AFTER `document_content_raw`"); + + mysqli_query($mysqli, "ALTER TABLE `assets` ADD `asset_important` TINYINT(1) NOT NULL DEFAULT '0' AFTER `asset_notes`"); + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.1'"); + } + + // if (CURRENT_DATABASE_VERSION == '1.1.1') { + // // Insert queries here required to update to DB version 1.1.2 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.1'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.2'"); // } } else { diff --git a/database_version.php b/database_version.php index c33ccb54c..04a479379 100644 --- a/database_version.php +++ b/database_version.php @@ -5,5 +5,5 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "1.1.0"); +DEFINE("LATEST_DATABASE_VERSION", "1.1.1"); diff --git a/db.sql b/db.sql index d0f5546ec..4f1d619fe 100644 --- a/db.sql +++ b/db.sql @@ -143,6 +143,7 @@ CREATE TABLE `assets` ( `asset_warranty_expire` date DEFAULT NULL, `asset_install_date` date DEFAULT NULL, `asset_notes` text DEFAULT NULL, + `asset_important` tinyint(1) NOT NULL DEFAULT 0, `asset_created_at` datetime NOT NULL DEFAULT current_timestamp(), `asset_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `asset_archived_at` datetime DEFAULT NULL, @@ -461,6 +462,7 @@ CREATE TABLE `documents` ( `document_description` text DEFAULT NULL, `document_content` longtext NOT NULL, `document_content_raw` longtext NOT NULL, + `document_important` tinyint(1) NOT NULL DEFAULT 0, `document_parent` int(11) NOT NULL DEFAULT 0, `document_created_at` datetime NOT NULL DEFAULT current_timestamp(), `document_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), @@ -591,8 +593,10 @@ CREATE TABLE `files` ( `file_id` int(11) NOT NULL AUTO_INCREMENT, `file_reference_name` varchar(200) DEFAULT NULL, `file_name` varchar(200) NOT NULL, + `file_description` text DEFAULT NULL, `file_ext` varchar(200) DEFAULT NULL, `file_hash` varchar(200) DEFAULT NULL, + `file_important` tinyint(1) NOT NULL DEFAULT 0, `file_created_at` datetime NOT NULL DEFAULT current_timestamp(), `file_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `file_archived_at` datetime DEFAULT NULL, @@ -1769,4 +1773,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-03-05 18:47:45 +-- Dump completed on 2024-03-15 18:31:42 From cdd16bd460204379608045082d2f301078bc34d6 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 15 Mar 2024 18:44:16 -0400 Subject: [PATCH 03/24] Add file Description below filename, still need to work on the UI a bit --- client_file_upload_modal.php | 12 ++++++++++++ client_files.php | 6 +++++- post/file.php | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/client_file_upload_modal.php b/client_file_upload_modal.php index 89b6c3ac6..68e297482 100644 --- a/client_file_upload_modal.php +++ b/client_file_upload_modal.php @@ -11,7 +11,19 @@