2018-05-03 09:39:10 +02:00
|
|
|
<?php
|
|
|
|
|
|
2019-01-14 16:19:24 +01:00
|
|
|
function processmaker_update() {
|
2018-05-03 09:39:10 +02:00
|
|
|
global $DB;
|
|
|
|
|
|
|
|
|
|
// update from older versions
|
|
|
|
|
// load config to get current version
|
2019-01-14 16:19:24 +01:00
|
|
|
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "db_version" )) {
|
2018-05-03 09:39:10 +02:00
|
|
|
$current_version = '2.4.1';
|
|
|
|
|
} else {
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/inc/config.class.php");
|
|
|
|
|
$config = PluginProcessmakerConfig::getInstance();
|
|
|
|
|
$current_version = $config->fields['db_version'];
|
2019-05-21 10:47:15 +02:00
|
|
|
if (empty($current_version)) {
|
|
|
|
|
$current_version = '2.4.1';
|
|
|
|
|
}
|
2018-05-03 09:39:10 +02:00
|
|
|
}
|
|
|
|
|
|
2019-01-14 16:19:24 +01:00
|
|
|
switch ($current_version) {
|
2018-05-03 09:39:10 +02:00
|
|
|
case '2.4.1' :
|
|
|
|
|
// will upgrade any old versions (< 3.2.8) to 3.2.8
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_to_3_2_8.php");
|
2018-05-21 09:46:43 +02:00
|
|
|
$new_version = update_to_3_2_8();
|
2018-05-03 09:39:10 +02:00
|
|
|
|
|
|
|
|
case '3.2.8' :
|
|
|
|
|
// will upgrade 3.2.8 to 3.2.9
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_2_8_to_3_2_9.php");
|
2018-05-21 09:46:43 +02:00
|
|
|
$new_version = update_3_2_8_to_3_2_9();
|
2018-05-03 09:39:10 +02:00
|
|
|
|
2018-05-21 09:46:43 +02:00
|
|
|
case '3.2.9' :
|
2018-05-03 09:39:10 +02:00
|
|
|
// will upgrade 3.2.9 to 3.3.0
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_2_9_to_3_3_0.php");
|
2018-05-21 09:46:43 +02:00
|
|
|
$new_version = update_3_2_9_to_3_3_0();
|
2018-08-06 16:12:16 +02:00
|
|
|
|
|
|
|
|
case '3.3.0' :
|
|
|
|
|
// will upgrade 3.3.0 to 3.3.1
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_3_0_to_3_3_1.php");
|
|
|
|
|
$new_version = update_3_3_0_to_3_3_1();
|
2019-01-14 16:19:24 +01:00
|
|
|
case '3.3.1' :
|
|
|
|
|
// will upgrade 3.3.1 to 3.3.8
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_3_1_to_3_3_8.php");
|
|
|
|
|
$new_version = update_3_3_1_to_3_3_8();
|
2019-05-21 10:47:15 +02:00
|
|
|
case '3.3.8' :
|
|
|
|
|
// will upgrade 3.3.8 to 3.4.9
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_3_8_to_3_4_9.php");
|
|
|
|
|
$new_version = update_3_3_8_to_3_4_9();
|
2020-10-07 15:40:05 +02:00
|
|
|
case '3.4.9' :
|
|
|
|
|
// will upgrade 3.4.9 to 3.4.10
|
|
|
|
|
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_4_9_to_3_4_10.php");
|
|
|
|
|
$new_version = update_3_4_9_to_3_4_10();
|
2018-05-03 09:39:10 +02:00
|
|
|
}
|
|
|
|
|
|
2019-01-14 16:19:24 +01:00
|
|
|
if (isset($new_version)) {
|
|
|
|
|
// end update by updating the db version number
|
|
|
|
|
$query = "UPDATE `glpi_plugin_processmaker_configs` SET `db_version` = '$new_version' WHERE `id` = 1;";
|
2018-05-03 09:39:10 +02:00
|
|
|
|
2019-01-14 16:19:24 +01:00
|
|
|
$DB->query($query) or die("error when updating db_version field in glpi_plugin_processmaker_configs" . $DB->error());
|
|
|
|
|
}
|
2018-05-21 09:46:43 +02:00
|
|
|
|
2018-05-03 09:39:10 +02:00
|
|
|
}
|