From c3c1f2a43cc1bdf4ac3f9fd32a1e615af7ba6712 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 4 Jul 2015 19:47:59 -0400 Subject: [PATCH] #218 Add SQL to create quick_help_sections table --- install/mods-for-hesk/sql/installSql.php | 38 +++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 93e3e9de..ca8e1d3e 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -540,4 +540,40 @@ function execute232Scripts() { hesk_dbConnect(); executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.3.2' WHERE `Key` = 'modsForHeskVersion'"); } -// END Version 2.3.2 \ No newline at end of file +// END Version 2.3.2 + +// BEGIN Version 2.4.0 +function execute240Scripts() { + global $hesk_settings; + + hesk_dbConnect(); + executeQuery("CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections` ( + `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + `location` VARCHAR(100) NOT NULL, + `show` ENUM('0','1') NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); + + executeQuery("INSERT INTO `hesk_quick_help_sections` (`location`, `show`) + VALUES ('create_ticket', '1')"); + executeQuery("INSERT INTO `hesk_quick_help_sections` (`location`, `show`) + VALUES ('view_ticket_form', '1')"); + executeQuery("INSERT INTO `hesk_quick_help_sections` (`location`, `show`) + VALUES ('view_ticket', '1')"); + executeQuery("INSERT INTO `hesk_quick_help_sections` (`location`, `show`) + VALUES ('knowledgebase', '1')"); +} + +function execute240FileUpdate() { + $file = file_get_contents(HESK_PATH . 'modsForHesk_settings.inc.php'); + + //-- Only add the additional settings if they aren't already there. + if (strpos($file, '$modsForHesk_settings[\'category_order_column\']') === false) + { + $file .= ' + + //-- Column to sort categories by. Can be either \'name\' or \'cat_order\' +$modsForHesk_settings[\'category_order_column\'] = \'cat_order\';'; + } + + return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file); +} \ No newline at end of file