From 19b2582a19782bd474411454d455b94197ebe339 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 23 Mar 2015 01:23:15 -0400 Subject: [PATCH] Add 2.1.1 AJAX PHP logic --- .../ajax/install-database-ajax.php | 3 +++ install/mods-for-hesk/sql/installSql.php | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/install/mods-for-hesk/ajax/install-database-ajax.php b/install/mods-for-hesk/ajax/install-database-ajax.php index d5078e4d..5ae4b616 100644 --- a/install/mods-for-hesk/ajax/install-database-ajax.php +++ b/install/mods-for-hesk/ajax/install-database-ajax.php @@ -30,6 +30,9 @@ if ($version == 1) { } elseif ($version == 210) { execute210Scripts(); execute210FileUpdate(); +} elseif ($version == 211) { + execute211Scripts(); + execute211FileUpdate(); } else { $response = 'The version "'.$version.'" was not recognized. Check the value submitted and try again.'; print $response; diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index d631c8b7..a38e4f60 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -378,4 +378,21 @@ function execute211Scripts() { ADD INDEX ( `openedby` , `firstreplyby` , `closedby` ), ADD INDEX(`dt`)"); executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.1.1' WHERE `Key` = 'modsForHeskVersion'"); -} \ No newline at end of file +} + +function execute211FileUpdate() { + //-- Add the boostrap theme 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, 'new_kb_article_visibility') === false) + { + $file .= ' + + //-- Default value for new Knowledgebase article: 0 = Published, 1 = Private, 2 = Draft +$modsForHesk_settings[\'new_kb_article_visibility\'] = 0;'; + } + + return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file); +} +// END Version 2.1.1 \ No newline at end of file