diff --git a/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php b/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php index 69fb18808c47f2401c083e93c2a06cac2eae4bfa..6bd70a62decdb3a1a74fb5c5d7e76530868f1d37 100755 --- a/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php +++ b/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php @@ -594,7 +594,7 @@ abstract class business_app_tools_Abstract extends Database //Find value in the xml database_version tag if ($xmlBase) { $_SESSION['maarch_entreprise'] - ['xml_versionbase'] = (string) $xmlBase->majorVersion; + ['xml_versionbase'] = (string) $xmlBase->version; } else { $_SESSION['maarch_entreprise']['xml_versionbase'] = 'none'; } @@ -607,8 +607,7 @@ abstract class business_app_tools_Abstract extends Database $_SESSION['maarch_entreprise']['database_version'] = "none"; } else { $vbg = $stmt->fetchObject(); - $_SESSION['maarch_entreprise']['database_version'] = substr($vbg->param_value_string, 0, 5); - $_SESSION['maarch_entreprise']['database_version_minor'] = (string) $xmlBase->minorVersion; + $_SESSION['maarch_entreprise']['database_version'] = $vbg->param_value_string; } //If this two parameters is not find, this is the end of this function if ($_SESSION['maarch_entreprise']['xml_versionbase'] <> 'none' ) { diff --git a/apps/maarch_entreprise/xml/applicationVersion.xml b/apps/maarch_entreprise/xml/applicationVersion.xml index e46649ad951cccbe35c8971bbe8d95722b7362a8..9e91e685aecadc46f07fde487ea9e66ba0c554ad 100755 --- a/apps/maarch_entreprise/xml/applicationVersion.xml +++ b/apps/maarch_entreprise/xml/applicationVersion.xml @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <root> - <majorVersion>19.04</majorVersion> - <minorVersion>19.04.1</minorVersion> + <version>19.10.1</version> </root> diff --git a/install/controller/update_backup_controller.php b/install/controller/update_backup_controller.php deleted file mode 100755 index 66a989912ebaca120a1252131df1d5913776e49d..0000000000000000000000000000000000000000 --- a/install/controller/update_backup_controller.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//CONTROLLER - - //TITLE - $shortTitle = _UPDATE_BACKUP; - $longTitle = _UPDATE_BACKUP; - - //ALLOWED SQL - //$listSql = $Class_Install->getDataList(); - - //PROGRESS - $stepNb = 2; - $stepNbTotal = 6; - -//VIEW - $view = 'update_backup'; diff --git a/install/controller/update_deploy_controller.php b/install/controller/update_deploy_controller.php deleted file mode 100755 index 06b401bf2c6222e602b59736adbfbfe6aaa3e9ed..0000000000000000000000000000000000000000 --- a/install/controller/update_deploy_controller.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//CONTROLLER - - //TITLE - $shortTitle = _UPDATE_DEPLOY; - $longTitle = _UPDATE_DEPLOY; - - //PROGRESS - $stepNb = 4; - $stepNbTotal = 6; - -//VIEW - $view = 'update_deploy'; diff --git a/install/controller/update_download_controller.php b/install/controller/update_download_controller.php deleted file mode 100755 index 70836abf97dedb4155468c537c45a7440dad8b9b..0000000000000000000000000000000000000000 --- a/install/controller/update_download_controller.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//CONTROLLER - - //TITLE - $shortTitle = _UPDATE_DOWNLOAD; - $longTitle = _UPDATE_DOWNLOAD; - - //PROGRESS - $stepNb = 3; - $stepNbTotal = 6; - -//VIEW - $view = 'update_download'; diff --git a/install/controller/update_end_controller.php b/install/controller/update_end_controller.php deleted file mode 100755 index 772f3ed66bdafbf24df8c615efc566c08b365987..0000000000000000000000000000000000000000 --- a/install/controller/update_end_controller.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//CONTROLLER - - //TITLE - $shortTitle = _UPDATE_END; - $longTitle = _UPDATE_END; - - //ALLOWED SQL - //$listSql = $Class_Install->getDataList(); - - //PROGRESS - $stepNb = 6; - $stepNbTotal = 6; - -//VIEW - $view = 'update_end'; diff --git a/install/controller/update_language_controller.php b/install/controller/update_language_controller.php deleted file mode 100755 index e3f8330f5c2a5634b190abf3f240ea882b0b1572..0000000000000000000000000000000000000000 --- a/install/controller/update_language_controller.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/* -* Copyright 2008-2012 Maarch -* -* This file is part of Maarch Framework. -* -* Maarch Framework is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Maarch Framework is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>. -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//CONTROLLER - //TITLES - $shortTitle = _LANGUAGE; - $longTitle = _CHOOSE_LANGUAGE; - - //ALLOWED LANGUAGES - $listLang = $Class_Install->getLangList(); - - //PROGRESS - $stepNb = 1; - $stepNbTotal = 6; - -//VIEW - $view = 'update_language'; diff --git a/install/controller/update_welcome_controller.php b/install/controller/update_welcome_controller.php deleted file mode 100755 index c700fc811623703aa3cfd47823337d6c892449bc..0000000000000000000000000000000000000000 --- a/install/controller/update_welcome_controller.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//CONTROLLER - - //TITLE - $shortTitle = _UPDATE_WELCOME; - $longTitle = _UPDATE_WELCOME; - - //ALLOWED SQL - //$listSql = $Class_Install->getDataList(); - - //PROGRESS - $stepNb = 1; - $stepNbTotal = 6; - -//VIEW - $view = 'update_welcome'; diff --git a/install/scripts/backupVersion.php b/install/scripts/backupVersion.php deleted file mode 100755 index beefe73e525740a5951136790a907eed6b64aecf..0000000000000000000000000000000000000000 --- a/install/scripts/backupVersion.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -require_once 'core/init.php'; -require_once 'install/class/Class_Install.php'; - -$Class_Install = new Install(); -$listLang = $Class_Install->loadLang(); - -if (!empty($_REQUEST['myVar'])) { - $path = $_REQUEST['myVar']; -} else { - $return['status'] = 0; - $return['text'] = _UPDATE_BACKUP_PATH_EMPTY; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -$checkRoot = $Class_Install->checkPathRoot( - $path -); - -if ($checkRoot !== true) { - $return['status'] = 0; - $return['text'] = $checkRoot; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -$path .= '/backupMaarchCourrier_' . date('Y-m-d'); - -if (!$Class_Install->createPath($path)) { - $return['status'] = 0; - $return['text'] = _CAN_NOT_CREATE_SUB_PATH; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -if (!$Class_Install->copy_dir($_SESSION['config']['corepath'], $path . DIRECTORY_SEPARATOR, false, true, ['logs', 'log', 'tmp'])) { - $return['status'] = 0; - $return['text'] = _CAN_NOT_COPY_TO . ' : ' . $path . '<br>' . _CHECK_RIGHT_SOURCE_FOLDER; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -$return['status'] = 1; -$return['text'] = ''; - -$jsonReturn = json_encode($return); - -echo $jsonReturn; -exit; diff --git a/install/scripts/deployVersion.php b/install/scripts/deployVersion.php deleted file mode 100755 index 5f6b7f43c8438e5994554b07b4d9234d5fbdda58..0000000000000000000000000000000000000000 --- a/install/scripts/deployVersion.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -require_once 'core/init.php'; -require_once 'install/class/Class_Install.php'; - -$Class_Install = new Install(); -$listLang = $Class_Install->loadLang(); - -$versionPath = 'NEW_VERSION'; -if (!is_dir($versionPath)) { - $return['status'] = 0; - $return['text'] = 'NEW_VERSION ' . _NOT_A_DIRECTORY; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -$fileTab = scandir($versionPath); -$nbFiles = count($fileTab); -for ($n = 0;$n < count($fileTab);$n++) { - $currentFileName = array(); - if ( - $fileTab[$n] <> '.' - && $fileTab[$n] <> '..' - && is_dir($versionPath . '/' . $fileTab[$n]) - ) { - $finalVersionPath = $versionPath . '/' . $fileTab[$n]; - } -} -if (empty($finalVersionPath)) { - $return['status'] = 0; - $return['text'] = 'finalVersionPath ' . _EMPTY; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -$excludeExt = ['xml','sh']; -if (!$Class_Install->copy_dir( - $finalVersionPath . DIRECTORY_SEPARATOR, - //'/opt/maarch/test' . DIRECTORY_SEPARATOR - $_SESSION['config']['corepath'], - $excludeExt - ) -) { - $return['status'] = 0; - $return['text'] = _CAN_NOT_COPY_TO . ':' . $_SESSION['config']['corepath']; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} else { - require_once "core/class/class_functions.php"; - require_once "core/class/class_db_pdo.php"; - $db = new Database(); - $query = "UPDATE parameters SET param_value_string = ? where id = 'database_version'"; - $stmt = $db->query($query, [$_SESSION['lastTagVersion']]); - - include_once 'core/docservers_tools.php'; - Ds_washTmp($versionPath); - echo '{"status":1}'; - exit; -} -exit; diff --git a/install/scripts/downloadVersion.php b/install/scripts/downloadVersion.php deleted file mode 100755 index dd477aaabf37cbebfc15efe4f86104d826d45966..0000000000000000000000000000000000000000 --- a/install/scripts/downloadVersion.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -require_once 'core/init.php'; -require_once 'install/class/Class_Install.php'; -include_once 'core/docservers_tools.php'; - -$Class_Install = new Install(); -$listLang = $Class_Install->loadLang(); - -if (!empty($_REQUEST['myVar'])) { - $version = $_REQUEST['myVar']; - $_SESSION['lastTagVersion'] = $version; -} else { - $return['status'] = 0; - $return['text'] = _VERSION_EMPTY; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} -//retrieve required sources for Maarch labs -$versionPath = 'NEW_VERSION'; -if (is_dir($versionPath)) { - Ds_washTmp($versionPath); -} - -$versionFile = $version . '.zip'; -if(!file_exists($versionFile)) { - file_put_contents( - $versionFile, - fopen("https://labs.maarch.org/maarch/MaarchCourrier/repository/archive.zip?ref=" . $version, 'r') - ); -} - -if (!file_exists($versionFile)) { - $return['status'] = 0; - $return['text'] = _VERSION_NOT_DOWNLOADED; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} - -umask(0022); -if (!is_dir($versionPath)) { - mkdir($versionPath, 0770); -} - -$zip = new ZipArchive; -if ($zip->open($versionFile) === TRUE) { - $zip->extractTo($versionPath); - $zip->close(); -} else { - $return['status'] = 0; - $return['text'] = _CANNOT_EXTRACT; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} -//$phar = new PharData($versionFile); -//$phar->extractTo($versionPath, null, true); - -$fileTab = scandir($versionPath); -$nbFiles = count($fileTab); -for ($n = 0;$n < count($fileTab);$n++) { - $currentFileName = array(); - if ( - $fileTab[$n] <> '.' - && $fileTab[$n] <> '..' - && is_dir($versionPath . '/' . $fileTab[$n]) - ) { - $finalVersionPath = $versionPath . '/' . $fileTab[$n]; - } -} - -if (empty($finalVersionPath)) { - $return['status'] = 0; - $return['text'] = _VERSION_NOT_EXTRACTED; - - $jsonReturn = json_encode($return); - - echo $jsonReturn; - exit; -} else { - Ds_washTmp($finalVersionPath . '/install'); - unlink($versionFile); - echo '{"status":1}'; - exit; -} -exit; diff --git a/install/scripts/language_update.php b/install/scripts/language_update.php deleted file mode 100755 index 8874c6f755ed99a59f097dae181c035021cab557..0000000000000000000000000000000000000000 --- a/install/scripts/language_update.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/* -* Copyright 2008-2012 Maarch -* -* This file is part of Maarch Framework. -* -* Maarch Framework is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Maarch Framework is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>. -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -//MODEL - include_once '../../core/init.php'; -//CONTROLLER - if (!isset($_REQUEST['languageSelect']) || empty($_REQUEST['languageSelect'])) { - header("Location: ../error.php?error=badForm"); exit; - } - - $_SESSION['lang'] = $_REQUEST['languageSelect']; - header("Location: ../index.php?step=update_welcome"); diff --git a/install/view/update_backup_view.php b/install/view/update_backup_view.php deleted file mode 100755 index 0f31b6a92e70495bed472e048118feb163f6cb8a..0000000000000000000000000000000000000000 --- a/install/view/update_backup_view.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Laurent Giovannoni -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ -if ($_SESSION['user']['UserId'] <> 'superadmin') { - header('location: ' . $_SESSION['config']['businessappurl'] - . 'index.php?page=update_control&admin=update_control'); - exit(); -} -?> -<script> - function launchProcess( - myVar - ) { - $(document).ready(function() { - var oneIsEmpty = false; - if (myVar.length < 1) { - var oneIsEmpty = true; - } - - if (oneIsEmpty) { - $('#ajaxReturn_ko').html('<?php echo _MUST_CHOOSE_PATH_ROOT;?>'); - $('#ajaxReturn_button').css('display', 'block'); - return; - } - $('#ajaxReturn_ko').html(''); - - ajax( - 'backupVersion', - 'myVar|' + myVar, - 'ajaxReturn', - 'false' - ); - - }); - } -</script> -<div class="ajaxReturn_testConnect"> - <div class="blockWrapper"> - <div class="titleBlock"> - <h2 onClick="slide('database');" style="cursor: pointer;"> - <?php echo _UPDATE_BACKUP_INFOS;?> - </h2> - </div> - <div class="contentBlock" id="database"> - <p> - <h6> - <?php echo _UPDATE_BACKUP_DETAILS;?> - </h6> - <form> - <table> - <tr> - <td> - <?php echo _ACTUAL_VERSION_PATH;?> - </td> - <td> - : - </td> - <td> - <input type="text" id="actualPath" size="60" disabled name="actualPath" value="<?php echo $_SESSION['config']['corepath'];?>" /> - </td> - </tr> - <tr> - <td> - <?php echo _UPDATE_BACKUP_PATH;?> - </td> - <td> - : - </td> - <td> - <input type="text" id="path" size="60" name="backupPath" value="" /> - </td> - </tr> - <tr> - <td> </td> - <td> </td> - <td> </td> - </tr> - <tr> - <td></td> - <td></td> - <td> - <input type="button" name="Submit" id="ajaxReturn_button" value="<?php echo _BACKUP_ACTUAL_VERSION;?>" onClick="$(this).css('display', 'none');launchProcess($('#path').val());" /> - </td> - </tr> - </table> - </form> - <br /> - <div id="ajaxReturn_ko"></div> - <div align="center"> - <img src="img/wait.gif" width="100" class="wait" style="display: none; background-color: rgba(0, 0, 0, 0.2);" /> - </div> - </p> - </div> - </div> -</div> -<br /> -<div class="blockWrapper"> - <div class="contentBlock"> - <p> - <div id="buttons"> - <div style="float: left;" class="previousButton" id="previous"> - <a href="#" onClick="goTo('index.php?step=update_welcome');"> - <?php echo _PREVIOUS_INSTALL;?> - </a> - </div> - <div style="float: right;" class="nextButton" id="next"> - <a href="#" onClick="goTo('index.php?step=update_download');" id="ajaxReturn" style="display: none;"> - <?php echo _NEXT_INSTALL;?> - </a> - </div> - </div> - <br /> - <br /> - </p> - </div> -</div> \ No newline at end of file diff --git a/install/view/update_deploy_view.php b/install/view/update_deploy_view.php deleted file mode 100755 index b5ec344e2ff37251a07ca29fa815fb888645fc89..0000000000000000000000000000000000000000 --- a/install/view/update_deploy_view.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Laurent Giovannoni -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ -if ($_SESSION['user']['UserId'] <> 'superadmin') { - header('location: ' . $_SESSION['config']['businessappurl'] - . 'index.php?page=update_control&admin=update_control'); - exit(); -} -?> -<script> - function launchProcess( - myVar - ) - { - $(document).ready(function() { - $('#ajaxReturn_ko').html(''); - - ajax( - 'deployVersion', - 'myVar|'+myVar, - 'ajaxReturn', - 'false' - ); - - }); - } -</script> -<div class="ajaxReturn_testConnect"> - <div class="blockWrapper"> - <div class="titleBlock"> - <h2 onClick="slide('database');" style="cursor: pointer;"> - <?php echo _UPDATE_DEPLOY_INFOS;?> - </h2> - </div> - <div class="contentBlock" id="database"> - <p> - <h6> - <?php echo _UPDATE_DEPLOY_DETAILS;?> - </h6> - <form> - <table> - <tr> - <td> </td> - <td> </td> - <td> </td> - </tr> - <tr> - <td></td> - <td></td> - <td> - <input - type="button" - name="Submit" id="ajaxReturn_button" value="<?php echo _DEPLOY_VERSION;?>" - onClick="$(this).css('display', 'none');launchProcess($('#version').val());" - /> - </td> - </tr> - </table> - </form> - <br /> - <div id="ajaxReturn_ko"></div> - <div align="center"> - <img src="img/wait.gif" width="100" class="wait" style="display: none; background-color: rgba(0, 0, 0, 0.2);"/> - </div> - </p> - </div> - </div> -</div> -<br /> -<div class="blockWrapper"> - <div class="contentBlock"> - <p> - <div id="buttons"> - <div style="float: left;" class="previousButton" id="previous"> - <a href="#" onClick="goTo('index.php?step=update_download');"> - <?php echo _PREVIOUS_INSTALL;?> - </a> - </div> - <div style="float: right;" class="nextButton" id="next"> - <a href="#" onClick="goTo('index.php?step=update_end');" class="ajaxReturn" id="ajaxReturn_ok" style="display: none;"> - <?php echo _NEXT_INSTALL;?> - </a> - </div> - </div> - <br /> - <br /> - </p> - </div> -</div> diff --git a/install/view/update_download_view.php b/install/view/update_download_view.php deleted file mode 100755 index 4e90781c0ed7ec3227e11467930ab5128ea1d535..0000000000000000000000000000000000000000 --- a/install/view/update_download_view.php +++ /dev/null @@ -1,217 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Laurent Giovannoni -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ -if ($_SESSION['user']['UserId'] <> 'superadmin') { - header('location: ' . $_SESSION['config']['businessappurl'] - . 'index.php?page=update_control&admin=update_control'); - exit(); -} - -//retrives tags -$client = \Gitlab\Client::create('https://labs.maarch.org/api/v4/'); - -$tags = $client->api('tags')->all('12'); - -//retrieve current version -$db = new Database(); -$query = "SELECT param_value_string FROM parameters WHERE id = 'database_version'"; -$stmt = $db->query($query, []); -$currentVersion = $stmt->fetchObject(); - -$currentVersionBranch = substr($currentVersion->param_value_string, 0, 5); -$currentVersionBranchYear = substr($currentVersion->param_value_string, 0, 2); -$currentVersionBranchMonth = substr($currentVersion->param_value_string, 3, 2); -$currentVersionTag = substr($currentVersion->param_value_string, 6); - -$allCurrentTags = []; -$allNextTags = []; -$cptCurrentTags = 0; -$isAnyAvailableTag = false; -$isAnyAvailableVersion = false; - -foreach ($tags as $value) { - if (!preg_match("/^\d{2}\.\d{2}\.\d+$/", $value['name'])) { - continue; - } - $tag = substr($value['name'], 6); - $pos = strpos($value['name'], $currentVersionBranch); - if ($pos === false) { - $year = substr($value['name'], 0, 2); - $month = substr($value['name'], 3, 2); - if (($year == $currentVersionBranchYear && $month > $currentVersionBranchMonth) || $year > $currentVersionBranchYear) { - $isAnyAvailableVersion = true; - $allNextTags[] = $value['name']; - } - } else { - $allCurrentTags[$cptCurrentTags] = []; - $allCurrentTags[$cptCurrentTags]['name'] = $value['name']; - if ($tag > $currentVersionTag) { - $allCurrentTags[$cptCurrentTags]['enabled'] = true; - $isAnyAvailableTag = true; - } else { - $allCurrentTags[$cptCurrentTags]['enabled'] = false; - } - ++$cptCurrentTags; - } -} - -?> -<script> - function launchProcess(myVar) { - $(document).ready(function() { - var oneIsEmpty = false; - if (myVar.length < 1) { - var oneIsEmpty = true; - } - - if (oneIsEmpty) { - $('#ajaxReturn_ko').html('<?php echo _MUST_CHOOSE_VERSION;?>'); - $('#ajaxReturn_button').css('display', 'block'); - return; - } - $('#ajaxReturn_ko').html(''); - - ajax( - 'downloadVersion', - 'myVar|'+myVar, - 'ajaxReturn', - 'false' - ); - - }); - } -</script> - -<div class="ajaxReturn_testConnect"> - <div class="blockWrapper"> - <div class="titleBlock"> - <h2 onClick="slide('database');" style="cursor: pointer;"> - <?php echo _LAST_RELEASE_INFOS;?> - </h2> - </div> - <div class="contentBlock" id="database"> - <p> - <h6> - <?php echo _LAST_RELEASE_DETAILS;?> - </h6> - <form> - <table align="center" style="margin-top:50px"> - <tr> - <td><?php echo _YOUR_VERSION;?></td> - <td>:</td> - <td> - <?php echo '<b>' . $currentVersion->param_value_string . '</b>';?> - </td> - </tr> - <tr> - <td colspan="3"> </td> - </tr> - <tr> - <td><?php echo _CHOOSE_VERSION_TO_UPDATE;?></td> - <td>:</td> - <td> - <?php - if (count($tags)>0) { - ?> - <select id="version" id="name"> - <?php - for ($i=0;$i<count($allCurrentTags);$i++) { - if ($allCurrentTags[$i]['enabled']) { - echo '<option value="' . $allCurrentTags[$i]['name'] . '">'; - echo $allCurrentTags[$i]['name']; - echo '</option>'; - } else { - echo '<option value="' . $allCurrentTags[$i]['name'] . '" disabled>'; - echo $allCurrentTags[$i]['name']; - echo '</option>'; - } - } ?> - </select> - <?php - } else { - echo _NO_AVAILABLE_TAG_TO_UPDATE . '<br />'; - } - ?> - </td> - </tr> - <tr><td colspan="3"> </td></tr> - - <?php if(!$Class_Install->isPhpRequirements('zip')){ ?> - <tr><td colspan="3"> </td></tr> - <tr><td><?php echo _MISSING_PREREQUISITE_UPDATE ;?></td><td colspan="2"></td></tr> - <tr> - <td> - <?php echo $Class_Install->checkPrerequisites(false);?> - </td> - <td></td> - <td> - <?php echo _ZIP_LIB;?> - </td> - </tr> - <?php } else { ?> - <tr> - <td colspan="3"> - <input - type="button" - name="Submit" id="ajaxReturn_button" value="<?php echo _DOWNLOAD_VERSION;?>" - onClick="$(this).css('display', 'none');launchProcess($('#version').val());" - /> - </td> - </tr> - <?php } ?> - </table> - <div align="center" style="margin-bottom:50px"> - <?php - if ($isAnyAvailableVersion) { - echo '<br><br><br><b>' . _NEW_MAJOR_VERSION_AVAILABLE . '</b> : <br>'; - for ($j=0;$j<count($allNextTags);$j++) { - echo $allNextTags[$j] . '<br />'; - } - } - ?> - </div> - </form> - <br /> - <div id="ajaxReturn_ko"></div> - <div align="center"> - <img src="img/wait.gif" width="100" class="wait" style="display: none; background-color: rgba(0, 0, 0, 0.2);"/> - </div> - </p> - </div> - </div> -</div> -<br /> -<div class="blockWrapper"> - <div class="contentBlock"> - <p> - <div id="buttons"> - <div style="float: left;" class="previousButton" id="previous"> - <a href="#" onClick="goTo('index.php?step=update_backup');"> - <?php echo _PREVIOUS_INSTALL;?> - </a> - </div> - <div style="float: right;" class="nextButton" id="next"> - <a href="#" onClick="goTo('index.php?step=update_deploy');" class="ajaxReturn" id="ajaxReturn_ok" style="display: none;"> - <?php echo _NEXT_INSTALL;?> - </a> - </div> - </div> - <br /> - <br /> - </p> - </div> -</div> diff --git a/install/view/update_end_view.php b/install/view/update_end_view.php deleted file mode 100755 index 73cd76731c1a7739e193d25a70a574b3d46ef05a..0000000000000000000000000000000000000000 --- a/install/view/update_end_view.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ - -if ($_SESSION['user']['UserId'] <> 'superadmin') { - header('location: ' . $_SESSION['config']['businessappurl'] - . 'index.php?page=update_control&admin=update_control'); - exit(); -} -?> -<div class="blockWrapper"> - <div class="titleBlock"> - <h2 onClick="slide('welcome');" style="cursor: pointer;"> - <?php echo _UPDATE_END;?> - </h2> - </div> - <div class="contentBlock" id="welcome"> - <p> - <?php echo _UPDATE_DESC_END;?> - </p> - </div> -</div> -<br /> -<div class="blockWrapper"> - <div class="contentBlock" id="welcome"> - <p> - <div id="buttons"> -<!-- <div style="float: left;" class="previousButton" id="previous"> - <a href="#" onClick="goTo('index.php?step=update_deploy');"> - <?php echo _PREVIOUS_INSTALL;?> - </a> - </div> --> - <div style="float: right;" class="nextButton" id="start"> - <a href="#" onClick="goTo('../index.php');"> - <?php echo _START_MEP_1_3;?> - </a> - </div> - </div> - <br /> - <br /> - </p> - </div> -</div> - diff --git a/install/view/update_language_view.php b/install/view/update_language_view.php deleted file mode 100755 index 2d39fa370582a6cc9ce47f010b8664c4ba6066de..0000000000000000000000000000000000000000 --- a/install/view/update_language_view.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ -if ($_SESSION['user']['UserId'] <> 'superadmin') { - header('location: ' . $_SESSION['config']['businessappurl'] - . 'index.php?page=update_control&admin=update_control'); - exit(); -} -?> -<div class="blockWrapper"> - <div class="titleBlock"> - <h2 onClick="slide('chooseLanguage');" style="cursor: pointer;"> - <?php echo _CHOOSE_LANGUAGE;?> - </h2> - </div> - <div class="contentBlock" id="chooseLanguage"> - <p> - <form action="scripts/language_update.php" method="post"> - <select name="languageSelect" id="languageSelect" onChange="checkLanguage(this.value)"> - <option value="default">Select a language</option> - <?php - for($i=0; $i<count($listLang);$i++) { - echo '<option '; - echo 'value="'.$listLang[$i].'"'; - echo '>'; - if ($listLang[$i] == "fr") { - echo "French"; - } else if ($listLang[$i] == "en") { - echo "English"; - } else { - echo $listLang[$i]; - } - echo '</option>'; - } - ?> - </select> - </form> - </p> - </div> -</div> -<br /> -<div class="blockWrapper"> - <div class="contentBlock" id="chooseLanguage"> - <p> - <div id="buttons"> - <div style="float: left;" class="previousButton"> - </div> - <div style="float: right;" class="nextButton" id="next"> - <span id="returnCheckLanguage" style="display: none;"> - <a href="#" onClick="$('form').submit();"> - <?php echo _NEXT_INSTALL;?> - </a> - </span> - </div> - </div> - <br /> - <br /> - </p> - </div> -</div> diff --git a/install/view/update_welcome_view.php b/install/view/update_welcome_view.php deleted file mode 100755 index b5f59975b42137e5c25825c300bbff32b5e1a99e..0000000000000000000000000000000000000000 --- a/install/view/update_welcome_view.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief class of install tools -* -* @file -* @author Arnaud Veber -* @date $date$ -* @version $Revision$ -* @ingroup install -*/ -if ($_SESSION['user']['UserId'] <> 'superadmin') { - header('location: ' . $_SESSION['config']['businessappurl'] - . 'index.php?page=update_control&admin=update_control'); - exit(); -} -?> -<div class="blockWrapper"> - <div class="titleBlock"> - <h2 onClick="slide('welcome');" style="cursor: pointer;"> - <?php echo _UPDATE_WELCOME_INSTALL;?> - </h2> - </div> - <div class="contentBlock" id="welcome"> - <p> - <?php echo _UPDATE_DESC_INSTALL;?> - </p> - </div> -</div> -<br /> -<div class="blockWrapper"> - <div class="contentBlock" id="welcome"> - <p> - <div id="buttons"> - <div style="float: left;" class="previousButton" id="previous"> - <a href="#" onClick="goTo('index.php?step=update_language');"> - <?php echo _PREVIOUS_INSTALL;?> - </a> - </div> - <div style="float: right;" class="nextButton" id="next"> - <a href="#" onClick="goTo('index.php?step=update_backup');"> - <?php echo _NEXT_INSTALL;?> - </a> - </div> - </div> - <br /> - <br /> - </p> - </div> -</div> - diff --git a/src/app/versionUpdate/controllers/VersionUpdateController.php b/src/app/versionUpdate/controllers/VersionUpdateController.php index e3e107f4d18accbe8ea8abd2a249801a50be9774..4c307e39549d29a5cf4ae67a9ae4a74e0fc3d81e 100755 --- a/src/app/versionUpdate/controllers/VersionUpdateController.php +++ b/src/app/versionUpdate/controllers/VersionUpdateController.php @@ -40,7 +40,7 @@ class VersionUpdateController if (empty($applicationVersion)) { return $response->withStatus(400)->withJson(['errors' => "Can't load xml applicationVersion"]); } else { - $currentVersion = $applicationVersion['applicationMinorVersion']; + $currentVersion = $applicationVersion; } $versions = explode('.', $currentVersion); @@ -118,7 +118,7 @@ class VersionUpdateController if (empty($applicationVersion)) { return $response->withStatus(400)->withJson(['errors' => "Can't load xml applicationVersion"]); } else { - $currentVersion = $applicationVersion['applicationMinorVersion']; + $currentVersion = $applicationVersion; } $versions = explode('.', $currentVersion); diff --git a/src/core/controllers/CoreController.php b/src/core/controllers/CoreController.php index 342b4fa9bd01b3cac27aa8bb07f2f3d5318c468d..63d9d54d58b112ca5e5614d50ded820755699fc3 100755 --- a/src/core/controllers/CoreController.php +++ b/src/core/controllers/CoreController.php @@ -31,7 +31,7 @@ class CoreController $aInit = []; $aInit['coreUrl'] = str_replace('rest/', '', \Url::coreurl()); $aInit['applicationName'] = CoreConfigModel::getApplicationName(); - $aInit['applicationMinorVersion'] = CoreConfigModel::getApplicationVersion()['applicationMinorVersion']; + $aInit['applicationVersion'] = CoreConfigModel::getApplicationVersion(); $aInit['lang'] = CoreConfigModel::getLanguage(); $aInit['user'] = UserModel::getByLogin(['login' => $GLOBALS['userId'], 'select' => ['id', 'user_id', 'firstname', 'lastname']]); diff --git a/src/core/models/CoreConfigModel.php b/src/core/models/CoreConfigModel.php index 492afbcc3ac7c57305ca23c342442c1b0e97199b..e0ad1fe4786c3556f26222477d35a3522e84af84 100755 --- a/src/core/models/CoreConfigModel.php +++ b/src/core/models/CoreConfigModel.php @@ -83,14 +83,11 @@ class CoreConfigModel { $loadedXml = CoreConfigModel::getXmlLoaded(['path' => 'apps/maarch_entreprise/xml/applicationVersion.xml']); - if ($loadedXml) { - return [ - 'applicationVersion' => (string)$loadedXml->majorVersion, - 'applicationMinorVersion' => (string)$loadedXml->minorVersion, - ]; + if (empty($loadedXml)) { + return ''; } - return []; + return (string)$loadedXml->version; } public static function getLanguage() diff --git a/src/frontend/app/about-us.component.html b/src/frontend/app/about-us.component.html index b5352d597e9090e827c6df772350a25610e5337c..b3511da874074f509cab2d2399d64fb7fb32ddaa 100755 --- a/src/frontend/app/about-us.component.html +++ b/src/frontend/app/about-us.component.html @@ -11,7 +11,7 @@ </div> <mat-card *ngIf="!loading" class="card-app-content"> <div class="col-sm-8"> - <h3>Maarch Courrier {{applicationMinorVersion}} </h3> + <h3>Maarch Courrier {{applicationVersion}} </h3> <hr/> <p><em>Copyright © 2008-2019 Maarch SAS {{lang.groupeCompany}}</em></p> <p>{{lang.maarchLicence}} diff --git a/src/frontend/app/about-us.component.ts b/src/frontend/app/about-us.component.ts index ae348368713d3c21337b521573b13f86de25f6ad..06ec449a61dcebd6388080728c90a2508a897f56 100755 --- a/src/frontend/app/about-us.component.ts +++ b/src/frontend/app/about-us.component.ts @@ -23,7 +23,7 @@ export class AboutUsComponent implements OnInit { private _mobileQueryListener: () => void; mobileQuery: MediaQueryList; mobileMode : boolean = false; - applicationMinorVersion : string; + applicationVersion : string; coreUrl: string; lang: any = LANG; @@ -44,7 +44,7 @@ export class AboutUsComponent implements OnInit { window['MainHeaderComponent'].setSnavRight(null); this.coreUrl = angularGlobals.coreUrl; - this.applicationMinorVersion = angularGlobals.applicationMinorVersion; + this.applicationVersion = angularGlobals.applicationVersion; this.loading = false; }