$backlogField = Config::getInstance()->getValue(Config::id_customField_backlog); $fieldList = array('project_id', 'category_id', 'custom_' . $customField_type, 'codevtt_elapsed', 'custom_' . $backlogField, 'codevtt_drift'); $serialized = serialize($fieldList); Config::setValue('issue_tooltip_fields', $serialized, Config::configType_string, 'fields to be displayed in issue tooltip'); // Add custom fields to existing projects echo "DEBUG 15/16 Prepare existing projects<br/>"; if (isset($_POST['projects']) && !empty($_POST['projects'])) { $selectedProjects = $_POST['projects']; foreach ($selectedProjects as $projectid) { $project = ProjectCache::getInstance()->getProject($projectid); echo "DEBUG prepare project: " . $project->getName() . "<br/>"; Project::prepareProjectToCodev($projectid); } } echo "DEBUG 16/16 Install Mantis plugins<br/>"; installMantisPlugin('CodevTT', true); installMantisPlugin('FilterBugList', false); echo "DEBUG done.<br/>"; // load homepage #echo ("<script type='text/javascript'> alert('install done.'); </script>"); echo "<script type='text/javascript'> parent.location.replace('install_step4.php'); </script>"; } // ----- DISPLAY PAGE #displayStepInfo(); #echo "<hr align='left' width='20%'/>\n"; $extIdCustomFieldCandidates = getExtIdCustomFieldCandidates(); displayForm($originPage, $codevOutputDir, $checkReportsDirError, $isJob2, $isJob3, $isJob4, $isJob5, $job2, $job3, $job4, $job5, $job_support, $job_sideTasks, $jobSupport_color, $jobNA_color, $job2_color, $job3_color, $job4_color, $job5_color, $projectList, $groupExtID, $extIdCustomFieldCandidates, $extIdCustomField, $userList, $admin_id, $statusList, $status_new, $status_feedback, $status_open, $status_closed, $is_modified); ?> </div>
/** * update 1.0.x to 1.1.0 (DB v14 to DB v15) * * - clasmap.ser * - config.ini * - remove from mantis menu * - mantis-plugins if mantis v1.3 * - DB */ function update_v14_to_v15() { echo "- Update classmap.ser<br>"; try { Tools::createClassMap(); } catch (Exception $e) { echo "<span class='error_font'>Could not create classmap: " . $e->getMessage() . "</span><br/>"; exit; } echo "- Add [mantis] 'status_enum_workflow' to config.ini<br>"; // reload mantis config files $path_config_defaults_inc = Constants::$mantisPath . DIRECTORY_SEPARATOR . "config_defaults_inc.php"; $path_core_constant_inc = Constants::$mantisPath . DIRECTORY_SEPARATOR . "core" . DIRECTORY_SEPARATOR . "constant_inc.php"; $path_mantis_config = Constants::$mantisPath; if (is_dir(Constants::$mantisPath . DIRECTORY_SEPARATOR . 'config')) { $path_mantis_config .= DIRECTORY_SEPARATOR . 'config'; // mantis v1.3 or higher } $path_mantis_config_inc = $path_mantis_config . DIRECTORY_SEPARATOR . 'config_inc.php'; $path_custom_constants = $path_mantis_config . DIRECTORY_SEPARATOR . 'custom_constants_inc.php'; global $g_status_enum_workflow; include_once $path_core_constant_inc; include_once $path_custom_constants; include_once $path_config_defaults_inc; include_once $path_mantis_config_inc; // set status_enum_workflow Constants::$status_enum_workflow = $g_status_enum_workflow; if (!is_array(Constants::$status_enum_workflow)) { echo "<span class='error_font'>Could not retrieve status_enum_workflow from Mantis config files</span><br/>"; exit; } // write new config file if (!update_config_file()) { // ask for manual update echo "<span class='error_font'>Could not update config.ini</span><br/>"; exit; } // if Mantis 1.3, plugins must be updated if (Tools::isMantisV1_3()) { echo "- Remove 'CodevTT' from Mantis main menu (CodevTT v1.0.x is incompatible with Mantis v1.3.x)<br>"; $query = "DELETE FROM `mantis_config_table` WHERE config_id = 'main_menu_custom_options'"; $result = execQuery($query); echo "- Install Mantis plugin: CodevTT (for mantis v1.3.x)<br>"; if (checkMantisPluginDir()) { $errStr = installMantisPlugin('CodevTT', true); if (NULL !== $errStr) { echo "<span class='error_font'>Please update 'CodevTT' mantis-plugin manualy</span><br/>"; echo "<script type=\"text/javascript\">console.error(\"{$errStr}\");</script>"; } echo "- Install Mantis plugin: FilterBugList (for mantis v1.3.x)<br>"; $errStr = installMantisPlugin('FilterBugList', true); if (NULL !== $errStr) { echo "<span class='error_font'>Please update 'FilterBugList' mantis-plugin manualy</span><br/>"; echo "<script type=\"text/javascript\">console.error(\"{$errStr}\");</script>"; } } } // execute the SQL script $sqlScriptFilename = Constants::$codevRootDir . '/install/codevtt_update_v14_v15.sql'; if (!file_exists($sqlScriptFilename)) { echo "<span class='error_font'>SQL script not found:{$sqlScriptFilename}</span><br/>"; exit; } echo "- Execute SQL script: {$sqlScriptFilename}<br>"; $retCode = Tools::execSQLscript2($sqlScriptFilename); if (0 != $retCode) { echo "<span class='error_font'>Could not execSQLscript: {$sqlScriptFilename}</span><br/>"; exit; } }