From 989d67a231cebdd11211e6db16d1290b9b7413b7 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 12 Oct 2015 13:02:45 -0400 Subject: [PATCH] #365 Add html column to templates and canned responses table --- install/mods-for-hesk/sql/installSql.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 8aa201a6..48bc8824 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -831,5 +831,16 @@ function execute250Scripts() executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('display_user_agent_information', '0')"); executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('navbar_title_url', '" . hesk_dbEscape($hesk_settings['hesk_url']) . "'"); + executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` ADD COLUMN `html` MEDIUMTEXT"); + executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "ticket_templates` ADD COLUMN `html` MEDIUMTEXT"); + + $res = executeQuery("SELECT 1 FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'rich_text_for_tickets' AND `Value` = 1"); + + // If HTML is enabled, copy the canned responses to the html column. + if (hesk_dbNumRows($res) > 0) { + executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` SET `html` = `message`"); + executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "ticket_templates` SET `html` = `message`"); + } + } // END Version 2.5.0 \ No newline at end of file