From e3ff8854f97cb764179b4f2e170ad0eaa2f13b61 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 6 Apr 2024 22:07:29 -0400 Subject: [PATCH] Removed Task Descriptions as the name says it all --- database_updates.php | 14 +++++++++++--- database_version.php | 2 +- db.sql | 6 ++---- post/tasks.php | 6 ++---- task_edit_modal.php | 12 +----------- ticket.php | 6 +++++- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/database_updates.php b/database_updates.php index 4e8f39b9..ee17c8e4 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1835,10 +1835,18 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.2.2'"); } - // if (CURRENT_DATABASE_VERSION == '1.2.2') { - // // Insert queries here required to update to DB version 1.2.3 + if (CURRENT_DATABASE_VERSION == '1.2.2') { + + mysqli_query($mysqli, "ALTER TABLE `tasks` DROP `task_description`"); + mysqli_query($mysqli, "ALTER TABLE `task_templates` DROP `task_template_description`"); + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.2.3'"); + } + + // if (CURRENT_DATABASE_VERSION == '1.2.3') { + // // Insert queries here required to update to DB version 1.2.4 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.2.3"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.2.4"); // } } else { diff --git a/database_version.php b/database_version.php index 9f729f8e..55dd5a23 100644 --- a/database_version.php +++ b/database_version.php @@ -5,4 +5,4 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "1.2.2"); +DEFINE("LATEST_DATABASE_VERSION", "1.2.3"); diff --git a/db.sql b/db.sql index 9906984f..4f17595c 100644 --- a/db.sql +++ b/db.sql @@ -941,7 +941,7 @@ DROP TABLE IF EXISTS `project_template_ticket_templates`; CREATE TABLE `project_template_ticket_templates` ( `ticket_template_id` int(11) NOT NULL, `project_template_id` int(11) NOT NULL, - `ticket_template_order` int(11) NOT NULL, + `ticket_template_order` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`ticket_template_id`,`project_template_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1527,7 +1527,6 @@ DROP TABLE IF EXISTS `task_templates`; CREATE TABLE `task_templates` ( `task_template_id` int(11) NOT NULL AUTO_INCREMENT, `task_template_name` varchar(200) NOT NULL, - `task_template_description` text DEFAULT NULL, `task_template_order` int(11) NOT NULL DEFAULT 0, `task_template_created_at` datetime NOT NULL DEFAULT current_timestamp(), `task_template_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), @@ -1547,7 +1546,6 @@ DROP TABLE IF EXISTS `tasks`; CREATE TABLE `tasks` ( `task_id` int(11) NOT NULL AUTO_INCREMENT, `task_name` varchar(255) NOT NULL, - `task_description` text DEFAULT NULL, `task_status` varchar(255) DEFAULT NULL, `task_order` int(11) NOT NULL DEFAULT 0, `task_completed_at` datetime DEFAULT NULL, @@ -1896,4 +1894,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-04-06 18:36:53 +-- Dump completed on 2024-04-06 22:06:56 diff --git a/post/tasks.php b/post/tasks.php index 0dd09069..d2257591 100644 --- a/post/tasks.php +++ b/post/tasks.php @@ -10,7 +10,6 @@ if (isset($_POST['add_task'])) { $ticket_id = intval($_POST['ticket_id']); $task_name = sanitizeInput($_POST['name']); - $task_description = sanitizeInput($_POST['description']); // Get Client ID from tickets using the ticket_id $sql = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_id = $ticket_id"); @@ -18,7 +17,7 @@ if (isset($_POST['add_task'])) { $client_id = intval($row['ticket_client_id']); - mysqli_query($mysqli, "INSERT INTO tasks SET task_name = '$task_name', task_description = '$task_description', task_ticket_id = $ticket_id"); + mysqli_query($mysqli, "INSERT INTO tasks SET task_name = '$task_name', task_ticket_id = $ticket_id"); $task_id = mysqli_insert_id($mysqli); @@ -36,14 +35,13 @@ if (isset($_POST['edit_task'])) { $task_id = intval($_POST['task_id']); $task_name = sanitizeInput($_POST['name']); - $task_description = sanitizeInput($_POST['description']); // Get Client ID $sql = mysqli_query($mysqli, "SELECT * FROM tasks LEFT JOIN tickets ON ticket_id = task_ticket_id WHERE task_id = $task_id"); $row = mysqli_fetch_array($sql); $client_id = intval($row['ticket_client_id']); - mysqli_query($mysqli, "UPDATE tasks SET task_name = '$task_name', task_description = '$task_description' WHERE task_id = $task_id"); + mysqli_query($mysqli, "UPDATE tasks SET task_name = '$task_name' WHERE task_id = $task_id"); // Logging mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Task', log_action = 'Edit', log_description = '$session_name edited task $task_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $task_id"); diff --git a/task_edit_modal.php b/task_edit_modal.php index 96a6a711..86c8f4ed 100644 --- a/task_edit_modal.php +++ b/task_edit_modal.php @@ -2,7 +2,7 @@ diff --git a/ticket.php b/ticket.php index 0c03b31f..9c8f8e8f 100644 --- a/ticket.php +++ b/ticket.php @@ -805,7 +805,11 @@ if (isset($_GET['ticket_id'])) { - + +