Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Add 2.1.1 AJAX PHP logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-koch committed Mar 23, 2015
1 parent 4a3c9fc commit 19b2582
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions install/mods-for-hesk/ajax/install-database-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
} 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;
Expand Down
19 changes: 18 additions & 1 deletion install/mods-for-hesk/sql/installSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
}
}

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

0 comments on commit 19b2582

Please sign in to comment.