diff --git a/cron_ticket_email_parser.php b/cron_ticket_email_parser.php index a8259e9d..0db99a50 100644 --- a/cron_ticket_email_parser.php +++ b/cron_ticket_email_parser.php @@ -337,7 +337,8 @@ if ($emails) { $attachments = $parser->getAttachments(); $message = $parser->getMessageBody('text'); - //$message .= $parser->getMessageBody('htmlEmbedded'); + // If below is enabled and up above is enabled text based emails get cut out + //$message = $parser->getMessageBody('htmlEmbedded'); // Check if we can identify a ticket number (in square brackets) if (preg_match("/\[$config_ticket_prefix\d+\]/", $subject, $ticket_number)) { diff --git a/database_updates.php b/database_updates.php index 690783c5..e3ae607c 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1156,11 +1156,27 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.4'"); } - //if (CURRENT_DATABASE_VERSION == '0.6.4') { + if (CURRENT_DATABASE_VERSION == '0.6.4') { //Insert queries here required to update to DB version 0.6.5 + mysqli_query($mysqli, "CREATE TABLE `ticket_watchers` ( + `watcher_id` int(11) NOT NULL AUTO_INCREMENT, + `watcher_name` varchar(255) NULL DEFAULT NULL, + `watcher_email` varchar(255) NOT NULL, + `watcher_created_at` datetime NOT NULL DEFAULT current_timestamp(), + `watcher_ticket_id` int(11) NOT NULL, + PRIMARY KEY (`watcher_id`) + )"); + // Then, update the database to the next sequential version - //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.5'"); + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.5'"); + } + + //if (CURRENT_DATABASE_VERSION == '0.6.5') { + //Insert queries here required to update to DB version 0.6.6 + + // Then, update the database to the next sequential version + //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.6'"); //} } else { diff --git a/database_version.php b/database_version.php index 0045edad..eccee4ab 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", "0.6.4"); +DEFINE("LATEST_DATABASE_VERSION", "0.6.5"); diff --git a/db.sql b/db.sql index 554a640b..361758fe 100644 --- a/db.sql +++ b/db.sql @@ -1419,6 +1419,23 @@ CREATE TABLE `ticket_views` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `ticket_watchers` +-- + +DROP TABLE IF EXISTS `ticket_watchers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ticket_watchers` ( + `watcher_id` int(11) NOT NULL AUTO_INCREMENT, + `watcher_name` varchar(255) DEFAULT NULL, + `watcher_email` varchar(255) NOT NULL, + `watcher_created_at` datetime NOT NULL DEFAULT current_timestamp(), + `watcher_ticket_id` int(11) NOT NULL, + PRIMARY KEY (`watcher_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `tickets` -- @@ -1621,4 +1638,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2023-07-15 15:32:02 +-- Dump completed on 2023-08-01 13:03:12