From a22c9c386768ae6028e2d26ae8866ed2d1fa54d6 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 12 Apr 2015 23:47:14 -0400 Subject: [PATCH] #146 Add file update to install script --- install/mods-for-hesk/sql/installSql.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 4c5b3cad..4401cc5d 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -411,4 +411,20 @@ function execute220Scripts() { executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `Closable` = 'yes'"); executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.2.0' WHERE `Key` = 'modsForHeskVersion'"); } + +function execute220FileUpdate() { + //-- Add the new attachment property to modsForHesk_settings.inc.php + $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[\'attachments\']') === false) + { + $file .= ' + + //-- Setting for adding attachments to email messages. Either 0 for default-HESK behavior, or 1 to send as attachments +$modsForHesk_settings[\'attachments\'] = 0;'; + } + + return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file); +} // END Version 2.2.0 \ No newline at end of file