From 5bf6f99b605df560c18fb8c68ef9738b627a9cfb Mon Sep 17 00:00:00 2001 From: Louis BAYLE Date: Sat, 1 Apr 2017 20:49:33 +0200 Subject: [PATCH] INSTALL: Add CodevTT to mantis menu --- install/install_step3.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install/install_step3.php b/install/install_step3.php index dcc1506d4..8ef8ab2ca 100644 --- a/install/install_step3.php +++ b/install/install_step3.php @@ -152,6 +152,7 @@ function appendToFile($destFile, $toAppendFile, $checkStr = NULL) { function updateMantisCustomFiles() { $mantisPath = Constants::$mantisPath; + $codevttURL = Constants::$codevURL; // --- check mantis version (config files have been moved in v1.3) if (is_dir($mantisPath.DIRECTORY_SEPARATOR.'config')) { @@ -177,6 +178,20 @@ function updateMantisCustomFiles() { appendToFile($path_mantis_config.'/custom_relationships_inc.php', Install::FILENAME_CUSTOM_RELATIONSHIPS_CODEVTT, 'BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY'); + + // add COdevTT to mantis menu + $path_mantis_config_inc = $path_mantis_config.'/config_inc.php'; + if (is_writable($path_mantis_config_inc)) { + + $stringToAdd = "# --- Add CodevTT to mantis main menu ---\n"; + $stringToAdd .= "array_push(\$g_main_menu_custom_options, array( 'CodevTT', NULL, '$codevttURL' ));\n"; + + $errStr = @file_put_contents($path_mantis_config_inc, $stringToAdd, FILE_APPEND); + if (FALSE === $errStr) { + throw new Exception ("Could not update file " . $path_mantis_config_inc . ": ".$errStr); + } + } + return NULL; }