Updated installer. Still need to test actual install script

merge-requests/29/head
Mike Koch 8 years ago
parent ea75c7d1f4
commit 5ca17fb9e9

@ -36,8 +36,8 @@
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
// We will be installing this HESK version:
define('HESK_NEW_VERSION','2.6.7');
define('MODS_FOR_HESK_NEW_VERSION','2.6.4');
define('HESK_NEW_VERSION','2.7.0');
define('MODS_FOR_HESK_NEW_VERSION','3.0.0');
define('REQUIRE_PHP_VERSION','5.3.0');
define('REQUIRE_MYSQL_VERSION','5.0.7');

@ -68,6 +68,8 @@ if ($version == 2) {
execute263Scripts();
} elseif ($version == 31) {
execute264Scripts();
} elseif ($version == 32) {
execute300Scripts();
} else {
$response = 'The version "' . $version . '" was not recognized. Check the value submitted and try again.';
print $response;

@ -40,6 +40,7 @@ $buildToVersionMap = array(
29 => '2.6.2',
30 => '2.6.3',
31 => '2.6.4',
32 => '3.0.0',
);
function echoInitialVersionRows($version, $build_to_version_map)

@ -89,6 +89,9 @@ function processUpdates(startingVersion) {
} else if (startingVersion < 31) {
startVersionUpgrade('264');
executeUpdate(31, '264', '2.6.4');
} else if (startingVersion < 32) {
startVersionUpgrade('300');
executeUpdate(32, '300', '3.0.0');
} else {
installationFinished();
}

@ -117,6 +117,7 @@ hesk_dbConnect();
<div class="col-md-8">
<select name="current-version" class="form-control">
<optgroup label="Mods for HESK 2">
<option value="31">2.6.3</option>
<option value="30">2.6.3</option>
<option value="29">2.6.2</option>
<option value="28">2.6.1</option>

@ -820,4 +820,72 @@ function execute264Scripts() {
hesk_dbConnect();
updateVersion('2.6.4');
}
// Verison 3.0.0
function execute300Scripts() {
global $hesk_settings;
hesk_dbConnect();
$hesk_statuses = executeQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_statuses` ORDER BY `order`");
$next_status_id_rs = executeQuery("SELECT MAX(`ID`) AS `last_id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses`");
$next_status_id_row = hesk_dbFetchAssoc($next_status_id_rs);
$next_status_id = intval($next_status_id_row['last_id']) + 1;
$next_sort_rs = executeQuery("SELECT MAX(`sort`) AS `last_sort` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses`");
$next_sort_row = hesk_dbFetchAssoc($next_sort_rs);
$next_sort = intval($next_sort_row['last_sort']) + 10;
while ($row = hesk_dbFetchAssoc($hesk_statuses)) {
$closable = $row['can_customers_change'] == '1' ? 'yes' : 'sonly';
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` (`ID`,
`TextColor`,
`IsNewTicketStatus`,
`IsClosed`,
`IsClosedByClient`,
`IsCustomerReplyStatus`,
`IsStaffClosedOption`,
`IsStaffReopenedStatus`,
`IsDefaultStaffReplyStatus`,
`LockedTicketStatus`,
`IsAutocloseOption`,
`Closable`,
`Key`,
`sort`)
VALUES (" . $next_status_id . ",
'#" . $row['color'] . "',
0,
0,
0,
0,
0,
0,
0,
0,
0,
'" . $closable . "',
'STORED IN XREF TABLE',
" . $next_sort . ")");
$languages = json_decode($row['name']);
foreach ($languages as $language => $text) {
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "text_to_status_xref` (`language`, `text`, `status_id`)
VALUES ('" . $language . "', '" . $text . "', " . $next_status_id . ")");
}
// Increment the next ID and sort
$next_status_id++;
$next_sort += 10;
}
// Migrate user's autorefresh columns to the new autoreload column
// Mods for HESK is in millis; HESK is in seconds.
executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `autoreload` = `autorefresh` / 10");
// Add the admin_color_scheme setting
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('admin_color_scheme', 'skin_blue')");
updateVersion('3.0.0');
}
Loading…
Cancel
Save