3059 - Automatically set the documentation URLs

This commit is contained in:
bruno DA SILVA
2020-07-16 16:11:15 +02:00
parent 7ed1feff3e
commit 82ba53d40b
3 changed files with 20 additions and 2 deletions

View File

@@ -2088,6 +2088,24 @@ class utils
return COMPILATION_TIMESTAMP;
}
/**
* @return string eg : '2_7_0'
*/
public static function GetItopVersionWikiSyntax()
{
$sVersionShort = self::GetItopVersionShort();
return str_replace('.', '_', $sVersionShort);
}
/**
* @return string eg '2.7.0' if ITOP_VERSION is '2.7.0-dev'
*/
public static function GetItopVersionShort()
{
$aExplodedVersion = explode('-', ITOP_VERSION);
return $aExplodedVersion[0];
}
/**
* Check if the given class if configured as a high cardinality class.
*

View File

@@ -22,7 +22,7 @@
define('ITOP_APPLICATION', 'iTop');
define('ITOP_APPLICATION_SHORT', 'iTop');
define('ITOP_VERSION', '2.7.0-dev');
define('ITOP_VERSION', '2.7.0-dev'); // @see utils::GetItopVersionShort() and utils::GetItopVersionWikiSyntax()
define('ITOP_REVISION', 'svn');
define('ITOP_BUILD_DATE', '$WCNOW$');
define('ITOP_VERSION_FULL', ITOP_VERSION.'-'.ITOP_REVISION);

View File

@@ -916,7 +916,7 @@ class SetupUtils
$oPage, $bIsItopInstall, $sDBServer, $sDBUser, $sDBPwd, $sDBName, $sDBPrefix, $bTlsEnabled, $sTlsCA,
$sNewDBName = ''
) {
$sWikiVersion = '2_7_0';
$sWikiVersion = utils::GetItopVersionWikiSyntax(); //eg : '2_7_0';
$sMysqlTlsWikiPageUrl = 'https://wiki.openitop.org/doku.php?id='.$sWikiVersion.':install:php_and_mysql_tls';
$oPage->add('<tr><td colspan="2">');