diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index a9726bd7baf..37aadd8c2ad 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -85,31 +85,37 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE)); } +$version = DOL_VERSION; +if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log. +print ' '.$langs->trans("SeeChangeLog").''; + +$newversion = ''; if (function_exists('curl_init')) { - $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; - print ' - '; - if ($action == 'getlastversion') - { - if ($sfurl) - { - while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) - { - $title = $sfurl->channel[0]->item[$i]->title; - if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) - { - $newversion = $reg[1]; - $newversionarray = explode('.', $newversion); - $versionarray = explode('.', $version); - //var_dump($newversionarray);var_dump($versionarray); - if (versioncompare($newversionarray, $versionarray) > 0) $version = $newversion; - } - $i++; - } + $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; + print ' - '; + if ($action == 'getlastversion') { + if ($sfurl) { + $i = 0; + while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) { + $title = $sfurl->channel[0]->item[$i]->title; + $reg = array(); + if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) { + $newversion = $reg[1]; + $newversionarray = explode('.', $newversion); + $versionarray = explode('.', $version); + //var_dump($newversionarray);var_dump($versionarray); + if (versioncompare($newversionarray, $versionarray) > 0) $version = $newversion; + } + $i++; + } // Show version print $langs->trans("LastStableVersion").' : '.(($version != '0.0') ? $version : $langs->trans("Unknown")).''; - } else { + if ($version != '0.0') { + print ' '.$langs->trans("SeeChangeLog").''; + } + } else { print $langs->trans("LastStableVersion").' : '.$langs->trans("UpdateServerOffline").''; } } else { @@ -118,12 +124,11 @@ if (function_exists('curl_init')) } // Now show link to the changelog -print ' - '; +//print ' - '; $version = DOL_VERSION; if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log. -print ''.$langs->trans("SeeChangeLog").''; print ''."\n"; print '