diff --git a/apps/maarch_entreprise/admin/update_control/update_control.php b/apps/maarch_entreprise/admin/update_control/update_control.php new file mode 100644 index 0000000000000000000000000000000000000000..265fc490df26eff1a90b04ab2d386149bc0ecfae --- /dev/null +++ b/apps/maarch_entreprise/admin/update_control/update_control.php @@ -0,0 +1,205 @@ +<?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 Maarch version test +* +* @file +* @author dev@maarch.org +* @date $date$ +* @version $Revision$ +* @ingroup admin +*/ + +core_tools::load_lang(); +$core_tools = new core_tools(); +//$core_tools->test_admin('admin_update_control', 'apps'); + +$init = false; +if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == 'true') { + $init = true; +} + +$pagePath = $_SESSION['config']['businessappurl'] . 'index.php?page=' + . 'update_control&admin=update_control'; +$pageLabel = _ADMIN_UPDATE_CONTROL; +$pageId = 'update_control'; +$level = ''; +if (isset($_REQUEST['level']) + && ($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 + || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1)) { + $level = $_REQUEST['level']; +} +$core_tools->manage_location_bar($pagePath, $pageLabel, $pageId, $init, $level); + +//retrives tags +$client = new \Gitlab\Client('https://labs.maarch.org/api/v4/'); +//$client->authenticate('aSecretToken', \Gitlab\Client::AUTH_URL_TOKEN); + +// $project = $client->api('projects')->show('12'); +// var_dump($project); + +$tags = $client->api('tags')->all('12'); +//var_dump($tags); + +//retrieve current version +$db = new Database(); +$query = "select param_value_int, param_value_string from parameters where id = 'database_version'"; +$stmt = $db->query($query, []); +$currentVersion = $stmt->fetchObject(); +// var_dump($currentVersion); +$currentVersionNumeric = preg_replace("/[^0-9,]/", "", $currentVersion->param_value_int); +if (!empty($currentVersion->param_value_string)) { + $currentVersionTagNumeric = preg_replace("/[^0-9,]/", "", $currentVersion->param_value_string); +} + +$allTagsNumeric = []; +$allCurrentTags = []; +$allNextTags = []; +$cptCurrentTags = 0; +$isAnyAvailableTag = false; +$isAnyAvailableVersion = false; + +foreach ($tags as $key => $value) { + //echo $tags[$key]['name'] . ' ' . preg_replace("/[^0-9,]/", "", $tags[$key]['name']) . '<br />'; + $tagNumeric = preg_replace("/[^0-9,]/", "", $tags[$key]['name']); + $allTagsNumeric[] = $tagNumeric; + $pos = strpos($tagNumeric, $currentVersionNumeric); + if ($pos === false) { + //echo 'tag not in currentVersion:'; + $isAnyAvailableVersion = true; + $allNextTags[] = $tags[$key]['name']; + } else { + //echo 'tag in currentVersion:'; + $allCurrentTags[$cptCurrentTags] = []; + $allCurrentTags[$cptCurrentTags]['name'] = $tags[$key]['name']; + $allCurrentTags[$cptCurrentTags]['numeric'] = $tagNumeric; + if ($tagNumeric > $currentVersionTagNumeric) { + $allCurrentTags[$cptCurrentTags]['enabled'] = true; + $isAnyAvailableTag = true; + } else { + $allCurrentTags[$cptCurrentTags]['enabled'] = false; + } + $cptCurrentTags++; + } + //echo $tagNumeric . '<br />'; +} +//var_dump($allCurrentTags); +?> +<h1><?php echo _ADMIN_UPDATE_CONTROL;?></h1> +<br/> +<br/> +<br/> +<br/> +<br/> +<br/> +<br/> +<table align="center"> + <tr> + <td> + <?php echo _YOUR_VERSION;?> + </td> + <td> + : + </td> + <td> + <?php echo _BRANCH_VERSION . ':' . $currentVersion->param_value_int + . ' ' . _TAG_VERSION . ':' . $currentVersion->param_value_string;?> + </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> + <?php echo _AVAILABLE_VERSION_TO_UPDATE;?> + </td> + <td> + : + </td> + <td> + <?php + if (count($tags)>0) { + ?> + <select id="version" id="name"> + <!--option value="default"><?php echo _SELECT_A_VERSION;?></option--> + <?php + for ($i=0;$i<count($allCurrentTags);$i++) { + if ($allCurrentTags[$i]['enabled']) { + echo '<option '; + echo 'value="' . $allCurrentTags[$i]['name'] . '"'; + echo '>'; + echo $allCurrentTags[$i]['name']; + echo '</option>'; + } else { + echo '<option '; + echo 'value="' . $allCurrentTags[$i]['name'] . '"'; + echo ' disabled>'; + echo $allCurrentTags[$i]['name']; + echo '</option>'; + } + } + ?> + </select> + <?php + if ($_SESSION['user']['UserId'] == 'superadmin') { + ?> + <a href="<?php echo $_SESSION['config']['coreurl'];?>install/index.php?step=update_welcome"><?php echo ' ' . _CLICK_HERE_TO_GO_TO_UPDATE_MANAGEMENT;?></a> + <?php + } else { + echo _CONNECT_YOU_IN_SUPERADMIN; + } + } else { + echo _NO_AVAILABLE_TAG_TO_UPDATE . '<br />'; + } + ?> + </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> + <?php + if (!$isAnyAvailableTag) { + echo _NO_AVAILABLE_TAG_TO_UPDATE . '<br />'; + }?> + </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> + <?php + if ($isAnyAvailableVersion) { + echo '<b>' . _NEW_MAJOR_VERSION_AVAILABLE . '</b>:'; + for ($j=0;$j<count($allNextTags);$j++) { + echo $allNextTags[$j] . '<br />'; + } + }?> + </td> + </tr> +</table> +<br/> +<br/> +<br/> +<br/> +<br/> +<br/> +<br/> \ No newline at end of file diff --git a/apps/maarch_entreprise/lang/en.php b/apps/maarch_entreprise/lang/en.php index 60d4194fadaa59c34907bb55fe22e093f6deff3c..7ab6386de91a3210bfc32bb04bb78865dd9ecd3e 100644 --- a/apps/maarch_entreprise/lang/en.php +++ b/apps/maarch_entreprise/lang/en.php @@ -1897,3 +1897,63 @@ if (!defined('_UPDATED_EMAIL_SIGNATURE')) if (!defined('_DELETED_EMAIL_SIGNATURE')) define('_DELETED_EMAIL_SIGNATURE', 'Mail signature deleted'); /***** Profile *****/ + +/**** admin update control ****/ +if (!defined('_ADMIN_UPDATE_CONTROL')) + define('_ADMIN_UPDATE_CONTROL', 'Verify update'); +if (!defined('_ADMIN_UPDATE_CONTROL_DESC')) + define('_ADMIN_UPDATE_CONTROL_DESC', 'Verify update'); +if (!defined('_YOUR_VERSION')) + define('_YOUR_VERSION', 'Your version'); +if (!defined('_AVAILABLE_VERSION_TO_UPDATE')) + define('_AVAILABLE_VERSION_TO_UPDATE', 'Available versions'); +if (!defined('_CLICK_HERE_TO_GO_TO_UPDATE_MANAGEMENT')) + define('_CLICK_HERE_TO_GO_TO_UPDATE_MANAGEMENT', 'Click here to begin the update process'); +if (!defined('_NEW_MAJOR_VERSION_AVAILABLE')) + define('_NEW_MAJOR_VERSION_AVAILABLE', 'New major version available'); +if (!defined('_BRANCH_VERSION')) + define('_BRANCH_VERSION', 'Branch'); +if (!defined('_TAG_VERSION')) + define('_TAG_VERSION', 'Tag'); +if (!defined('_CONNECT_YOU_IN_SUPERADMIN')) + define('_CONNECT_YOU_IN_SUPERADMIN', 'You have to be connected with superadmin profile to process update'); +if (!defined('_UPDATE_WELCOME')) + define('_UPDATE_WELCOME', 'Update'); +if (!defined('_UPDATE_WELCOME_INSTALL')) + define('_UPDATE_WELCOME_INSTALL', 'Update process'); +if (!defined('_UPDATE_DESC_INSTALL')) + define('_UPDATE_DESC_INSTALL', 'Update MaarchCourrier (only minor version)'); +if (!defined('_UPDATE_BACKUP')) + define('_UPDATE_BACKUP', 'Backup'); +if (!defined('_UPDATE_BACKUP_INFOS')) + define('_UPDATE_BACKUP_INFOS', 'Backup your version'); +if (!defined('_UPDATE_BACKUP_DETAILS')) + define('_UPDATE_BACKUP_DETAILS', 'Backup your version, you can restore it if necessary'); +if (!defined('_ACTUAL_VERSION_PATH')) + define('_ACTUAL_VERSION_PATH', 'Path of your installation'); +if (!defined('_UPDATE_BACKUP_PATH')) + define('_UPDATE_BACKUP_PATH', 'Path of your backup'); +if (!defined('_BACKUP_ACTUAL_VERSION')) + define('_BACKUP_ACTUAL_VERSION', 'Backup your version'); +if (!defined('_UPDATE_DOWNLOAD')) + define('_UPDATE_DOWNLOAD', 'Download'); +if (!defined('_LAST_RELEASE_INFOS')) + define('_LAST_RELEASE_INFOS', 'Download last minor version'); +if (!defined('_LAST_RELEASE_DETAILS')) + define('_LAST_RELEASE_DETAILS', 'Available minor versions'); +if (!defined('_CHOOSE_VERSION_TO_UPDATE')) + define('_CHOOSE_VERSION_TO_UPDATE', 'Choose the version'); +if (!defined('_DOWNLOAD_VERSION')) + define('_DOWNLOAD_VERSION', 'Download the version'); +if (!defined('_UPDATE_DEPLOY')) + define('_UPDATE_DEPLOY', 'Deploiement'); +if (!defined('_UPDATE_DEPLOY_INFOS')) + define('_UPDATE_DEPLOY_INFOS', 'Deploiement of the downloaded version'); +if (!defined('_UPDATE_DEPLOY_DETAILS')) + define('_UPDATE_DEPLOY_DETAILS', 'Deploiement of the downloaded version'); +if (!defined('_DEPLOY_VERSION')) + define('_DEPLOY_VERSION', 'Deploy the version'); +if (!defined('_UPDATE_END')) + define('_UPDATE_END', 'Update sucessful'); +if (!defined('_UPDATE_DESC_END')) + define('_UPDATE_DESC_END', 'Update sucessful'); \ No newline at end of file diff --git a/apps/maarch_entreprise/lang/fr.php b/apps/maarch_entreprise/lang/fr.php index b82223820bd0b3724f6b42d4e97532189070c5a9..66437d48c96ed91015400b48baacb641c08b0378 100755 --- a/apps/maarch_entreprise/lang/fr.php +++ b/apps/maarch_entreprise/lang/fr.php @@ -1906,3 +1906,63 @@ if (!defined('_UPDATED_EMAIL_SIGNATURE')) if (!defined('_DELETED_EMAIL_SIGNATURE')) define('_DELETED_EMAIL_SIGNATURE', 'Signature de mail supprimée'); /***** Profile *****/ + +/**** admin update control ****/ +if (!defined('_ADMIN_UPDATE_CONTROL')) + define('_ADMIN_UPDATE_CONTROL', 'Vérification mise à jour'); +if (!defined('_ADMIN_UPDATE_CONTROL_DESC')) + define('_ADMIN_UPDATE_CONTROL_DESC', 'Vérification mise à jour'); +if (!defined('_YOUR_VERSION')) + define('_YOUR_VERSION', 'Votre version'); +if (!defined('_AVAILABLE_VERSION_TO_UPDATE')) + define('_AVAILABLE_VERSION_TO_UPDATE', 'Versions disponibles'); +if (!defined('_CLICK_HERE_TO_GO_TO_UPDATE_MANAGEMENT')) + define('_CLICK_HERE_TO_GO_TO_UPDATE_MANAGEMENT', 'Cliquez ici pour commencer la procédure de mise à jour'); +if (!defined('_NEW_MAJOR_VERSION_AVAILABLE')) + define('_NEW_MAJOR_VERSION_AVAILABLE', 'Nouvelle version majeure disponible'); +if (!defined('_BRANCH_VERSION')) + define('_BRANCH_VERSION', 'Branche'); +if (!defined('_TAG_VERSION')) + define('_TAG_VERSION', 'Tag'); +if (!defined('_CONNECT_YOU_IN_SUPERADMIN')) + define('_CONNECT_YOU_IN_SUPERADMIN', 'Vous devez être connecté en superadmin pour accéder à la procédure de mise à jour'); +if (!defined('_UPDATE_WELCOME')) + define('_UPDATE_WELCOME', 'Mise à jour'); +if (!defined('_UPDATE_WELCOME_INSTALL')) + define('_UPDATE_WELCOME_INSTALL', 'Procédure de mise à jour'); +if (!defined('_UPDATE_DESC_INSTALL')) + define('_UPDATE_DESC_INSTALL', 'Procédure de mise à jour de MaarchCourrier (versions mineures uniquement)'); +if (!defined('_UPDATE_BACKUP')) + define('_UPDATE_BACKUP', 'Sauvegarde'); +if (!defined('_UPDATE_BACKUP_INFOS')) + define('_UPDATE_BACKUP_INFOS', 'Sauvegarde de votre version actuelle'); +if (!defined('_UPDATE_BACKUP_DETAILS')) + define('_UPDATE_BACKUP_DETAILS', 'Procédure de sauvegarde de votre version actuelle afin de pouvoir la restaurer si besoin'); +if (!defined('_ACTUAL_VERSION_PATH')) + define('_ACTUAL_VERSION_PATH', 'Chemin de votre installation'); +if (!defined('_UPDATE_BACKUP_PATH')) + define('_UPDATE_BACKUP_PATH', 'Chemin de votre sauvegarde'); +if (!defined('_BACKUP_ACTUAL_VERSION')) + define('_BACKUP_ACTUAL_VERSION', 'Sauvegarder votre version'); +if (!defined('_UPDATE_DOWNLOAD')) + define('_UPDATE_DOWNLOAD', 'Téléchargement'); +if (!defined('_LAST_RELEASE_INFOS')) + define('_LAST_RELEASE_INFOS', 'Téléchargement de la dernière version mineure'); +if (!defined('_LAST_RELEASE_DETAILS')) + define('_LAST_RELEASE_DETAILS', 'Détails des versions mineures disponibles'); +if (!defined('_CHOOSE_VERSION_TO_UPDATE')) + define('_CHOOSE_VERSION_TO_UPDATE', 'Choisissez la version'); +if (!defined('_DOWNLOAD_VERSION')) + define('_DOWNLOAD_VERSION', 'Télécharger la version'); +if (!defined('_UPDATE_DEPLOY')) + define('_UPDATE_DEPLOY', 'Déploiement'); +if (!defined('_UPDATE_DEPLOY_INFOS')) + define('_UPDATE_DEPLOY_INFOS', 'Déploiement de la version téléchargée'); +if (!defined('_UPDATE_DEPLOY_DETAILS')) + define('_UPDATE_DEPLOY_DETAILS', 'Déploiement de la version téléchargée'); +if (!defined('_DEPLOY_VERSION')) + define('_DEPLOY_VERSION', 'Déployer la version'); +if (!defined('_UPDATE_END')) + define('_UPDATE_END', 'Mise à jour réussi'); +if (!defined('_UPDATE_DESC_END')) + define('_UPDATE_DESC_END', 'Mise à jour réussi'); diff --git a/apps/maarch_entreprise/xml/services.xml b/apps/maarch_entreprise/xml/services.xml index 5c3a87b6c9945142763bef4c1f1edc4542650de1..315ad6b612698bdaeba5f65787c3c5dd58d991e5 100644 --- a/apps/maarch_entreprise/xml/services.xml +++ b/apps/maarch_entreprise/xml/services.xml @@ -375,4 +375,14 @@ <system_service>false</system_service> <enabled>true</enabled> </SERVICE> + <SERVICE> + <id>admin_update_control</id> + <name>_ADMIN_UPDATE_CONTROL</name> + <comment>_ADMIN_UPDATE_CONTROL_DESC</comment> + <servicepage>index.php?page=update_control&admin=update_control</servicepage> + <servicetype>admin</servicetype> + <system_service>true</system_service> + <style>fa fa-thumbs-o-up</style> + <enabled>true</enabled> + </SERVICE> </root> diff --git a/install/class/Class_Install.php b/install/class/Class_Install.php index 4201e8fcea0325e48f7e18cc51917e9586e37b83..1f51ef355f8f09ae50c1194a54bc32c380ccacf7 100755 --- a/install/class/Class_Install.php +++ b/install/class/Class_Install.php @@ -2161,9 +2161,11 @@ class Install extends functions // Si oui, on l'ouvre if ($dh = opendir($dir2copy)) { + $copyIt = true; // On liste les dossiers et fichiers de $dir2copy while (($file = readdir($dh)) !== false) { + $copyIt = true; // Si le dossier dans lequel on veut coller n'existe pas, on le cree if (!is_dir($dir_paste)) { mkdir ($dir_paste, 0777); @@ -2172,7 +2174,15 @@ class Install extends functions if (is_dir($dir2copy.$file) && $file != '..' && $file != '.') { $this->copy_dir($dir2copy.$file.'/' , $dir_paste.$file.'/', $excludeExt); } elseif ($file != '..' && $file != '.') { - if (strtolower($excludeExt) <> strtolower(pathinfo($dir2copy . $file, PATHINFO_EXTENSION))) { + if (count($excludeExt>0) && is_array($excludeExt)) { + $copyIt = true; + foreach ($excludeExt as $key => $value) { + if (strtolower($value) == strtolower(pathinfo($dir2copy . $file, PATHINFO_EXTENSION))) { + $copyIt = false; + } + } + } + if ($copyIt) { copy($dir2copy.$file, $dir_paste.$file); } } diff --git a/install/scripts/deployVersion.php b/install/scripts/deployVersion.php index 0672152c4a3c18347d861b2ad66d3127d1ef4731..5f6b7f43c8438e5994554b07b4d9234d5fbdda58 100644 --- a/install/scripts/deployVersion.php +++ b/install/scripts/deployVersion.php @@ -45,11 +45,12 @@ if (empty($finalVersionPath)) { exit; } +$excludeExt = ['xml','sh']; if (!$Class_Install->copy_dir( $finalVersionPath . DIRECTORY_SEPARATOR, //'/opt/maarch/test' . DIRECTORY_SEPARATOR $_SESSION['config']['corepath'], - 'xml' + $excludeExt ) ) { $return['status'] = 0; diff --git a/install/scripts/language_update.php b/install/scripts/language_update.php index 1c19feda5a6bc58a926f20dbfce256326bcf92ff..8874c6f755ed99a59f097dae181c035021cab557 100644 --- a/install/scripts/language_update.php +++ b/install/scripts/language_update.php @@ -30,7 +30,6 @@ //MODEL include_once '../../core/init.php'; - //CONTROLLER if (!isset($_REQUEST['languageSelect']) || empty($_REQUEST['languageSelect'])) { header("Location: ../error.php?error=badForm"); exit; diff --git a/install/view/update_backup_view.php b/install/view/update_backup_view.php index 52a26db94712cebc9b4b7204076d88dcdaf69a72..1131ad485f61a1938ba3998c6fe0ab23d32b4309 100644 --- a/install/view/update_backup_view.php +++ b/install/view/update_backup_view.php @@ -15,6 +15,11 @@ * @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( diff --git a/install/view/update_deploy_view.php b/install/view/update_deploy_view.php index 0d2a953320733365b603ec0fb4f0fd8c7e999626..b5ec344e2ff37251a07ca29fa815fb888645fc89 100644 --- a/install/view/update_deploy_view.php +++ b/install/view/update_deploy_view.php @@ -15,6 +15,11 @@ * @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( @@ -38,13 +43,13 @@ <div class="blockWrapper"> <div class="titleBlock"> <h2 onClick="slide('database');" style="cursor: pointer;"> - <?php echo _LAST_RELEASE_INFOS;?> + <?php echo _UPDATE_DEPLOY_INFOS;?> </h2> </div> <div class="contentBlock" id="database"> <p> <h6> - <?php echo _LAST_RELEASE_DETAILS;?> + <?php echo _UPDATE_DEPLOY_DETAILS;?> </h6> <form> <table> diff --git a/install/view/update_download_view.php b/install/view/update_download_view.php index 8ff96b90b4c4f7d72cb4ed2fcbee5209bfbdd521..643b025c557cc580ea40b9cad3541fa8b4181806 100644 --- a/install/view/update_download_view.php +++ b/install/view/update_download_view.php @@ -15,7 +15,11 @@ * @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 = new \Gitlab\Client('https://labs.maarch.org/api/v4/'); @@ -33,6 +37,42 @@ $query = "select param_value_int, param_value_string from parameters where id = $stmt = $db->query($query, []); $currentVersion = $stmt->fetchObject(); // var_dump($currentVersion); +$currentVersionNumeric = preg_replace("/[^0-9,]/", "", $currentVersion->param_value_int); +if (!empty($currentVersion->param_value_string)) { + $currentVersionTagNumeric = preg_replace("/[^0-9,]/", "", $currentVersion->param_value_string); +} + +$allTagsNumeric = []; +$allCurrentTags = []; +$allNextTags = []; +$cptCurrentTags = 0; +$isAnyAvailableTag = false; +$isAnyAvailableVersion = false; + +foreach ($tags as $key => $value) { + //echo $tags[$key]['name'] . ' ' . preg_replace("/[^0-9,]/", "", $tags[$key]['name']) . '<br />'; + $tagNumeric = preg_replace("/[^0-9,]/", "", $tags[$key]['name']); + $allTagsNumeric[] = $tagNumeric; + $pos = strpos($tagNumeric, $currentVersionNumeric); + if ($pos === false) { + //echo 'tag not in currentVersion:'; + $isAnyAvailableVersion = true; + $allNextTags[] = $tags[$key]['name']; + } else { + //echo 'tag in currentVersion:'; + $allCurrentTags[$cptCurrentTags] = []; + $allCurrentTags[$cptCurrentTags]['name'] = $tags[$key]['name']; + $allCurrentTags[$cptCurrentTags]['numeric'] = $tagNumeric; + if ($tagNumeric > $currentVersionTagNumeric) { + $allCurrentTags[$cptCurrentTags]['enabled'] = true; + $isAnyAvailableTag = true; + } else { + $allCurrentTags[$cptCurrentTags]['enabled'] = false; + } + $cptCurrentTags++; + } + //echo $tagNumeric . '<br />'; +} ?> <script> @@ -102,33 +142,33 @@ $currentVersion = $stmt->fetchObject(); if (count($tags)>0) { ?> <select id="version" id="name"> - <option value="default">Select a version</option> + <!--option value="default"><?php echo _SELECT_A_VERSION;?></option--> <?php - foreach ($tags as $key => $value) { - echo $tags[$key]['name'] . '<br />'; - echo '<option '; - echo 'value="' . $tags[$key]['name'] . '"'; - echo '>'; - echo $tags[$key]['name']; - echo '</option>'; + for ($i=0;$i<count($allCurrentTags);$i++) { + if ($allCurrentTags[$i]['enabled']) { + echo '<option '; + echo 'value="' . $allCurrentTags[$i]['name'] . '"'; + echo '>'; + echo $allCurrentTags[$i]['name']; + echo '</option>'; + } else { + echo '<option '; + echo 'value="' . $allCurrentTags[$i]['name'] . '"'; + echo ' disabled>'; + echo $allCurrentTags[$i]['name']; + echo '</option>'; + } } ?> </select> <?php } else { - ?> - No version available for update - <?php + echo _NO_AVAILABLE_TAG_TO_UPDATE . '<br />'; } ?> </td> </tr> - <tr> - <td> </td> - <td> </td> - <td> </td> - </tr> <tr> <td></td> <td></td> @@ -140,6 +180,39 @@ $currentVersion = $stmt->fetchObject(); /> </td> </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> + <?php + if (!$isAnyAvailableTag) { + echo _NO_AVAILABLE_TAG_TO_UPDATE . '<br />'; + }?> + </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td> </td> + <td> </td> + <td> + <?php + if ($isAnyAvailableVersion) { + echo '<b>' . _NEW_MAJOR_VERSION_AVAILABLE . '</b>:'; + for ($j=0;$j<count($allNextTags);$j++) { + echo $allNextTags[$j] . '<br />'; + } + }?> + </td> + </tr> </table> </form> <br /> diff --git a/install/view/update_end_view.php b/install/view/update_end_view.php index 987a8746ac5ab64aa8c758cfe6348decd759bb3a..b15d26cd19f720599b5641639b7abccdc4f268d5 100644 --- a/install/view/update_end_view.php +++ b/install/view/update_end_view.php @@ -15,6 +15,12 @@ * @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"> diff --git a/install/view/update_language_view.php b/install/view/update_language_view.php index 10772dfb8a060573e584b884ffe8d49f2ea4a57e..2d39fa370582a6cc9ce47f010b8664c4ba6066de 100644 --- a/install/view/update_language_view.php +++ b/install/view/update_language_view.php @@ -1,21 +1,9 @@ <?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. +/** +* 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. * -* You should have received a copy of the GNU General Public License -* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>. */ /** @@ -27,6 +15,11 @@ * @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"> diff --git a/install/view/update_welcome_view.php b/install/view/update_welcome_view.php index 1f4e6a377f407970d63bea1938173fc9ec9401c7..6f9acec091ab1efb7fb0d153060e578d099728bd 100644 --- a/install/view/update_welcome_view.php +++ b/install/view/update_welcome_view.php @@ -1,21 +1,9 @@ <?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. +/** +* 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. * -* You should have received a copy of the GNU General Public License -* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>. */ /** @@ -27,6 +15,11 @@ * @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"> @@ -45,11 +38,11 @@ <div class="contentBlock" id="welcome"> <p> <div id="buttons"> - <div style="float: left;" class="previousButton" id="previous"> + <!--div style="float: left;" class="previousButton" id="previous"> <a href="#" onClick="goTo('index.php?step=update_language');"> <?php echo _PREVIOUS_INSTALL;?> </a> - </div> + </div--> <div style="float: right;" class="nextButton" id="next"> <a href="#" onClick="goTo('index.php?step=update_backup');"> <?php echo _NEXT_INSTALL;?> diff --git a/sql/index_creation.sql b/sql/index_creation.sql old mode 100644 new mode 100755 index 124ddb18b03d1fd53f2c7682e8309be9af0f1bb0..ad91cb8629c4d561ab836c4c9dc1410c8fa8ffd9 --- a/sql/index_creation.sql +++ b/sql/index_creation.sql @@ -11,8 +11,14 @@ CREATE INDEX res_letterbox_docserver_id_idx ON res_letterbox (docserver_id); CREATE INDEX res_letterbox_filename_idx ON res_letterbox (filename); -- res_attachments +CREATE INDEX res_id_idx ON res_attachments (res_id); CREATE INDEX res_id_master_idx ON res_attachments (res_id_master); +-- res_version_attachments +CREATE INDEX res_id_version_attachments_idx ON res_version_attachments (res_id); +CREATE INDEX res_id_master_version_attachments_idx ON res_version_attachments (res_id_master); +CREATE INDEX attachment_id_master_idx ON res_version_attachments (attachment_id_master); + -- mlb_coll_ext CREATE INDEX category_id_idx ON mlb_coll_ext (category_id); CREATE INDEX exp_contact_id_idx ON mlb_coll_ext (exp_contact_id); @@ -47,16 +53,22 @@ CREATE INDEX description_idx ON doctypes (description); -- entities CREATE INDEX entity_label_idx ON entities (entity_label); +CREATE INDEX entity_id_idx ON entities (entity_id); -- folders +CREATE INDEX folders_system_id_folders_idx ON folders (folders_system_id); +CREATE INDEX parent_id_folders_idx ON folders (parent_id); CREATE INDEX folder_name_idx ON folders (folder_name); CREATE INDEX subject_idx ON folders (subject); +-- foldertypes +CREATE INDEX foldertype_id_foldertypes_idx ON foldertypes (foldertype_id); + -- groupbasket_redirect CREATE INDEX groupbasket_redirect_group_id_idx ON groupbasket_redirect (group_id); CREATE INDEX groupbasket_redirect_basket_id_idx ON groupbasket_redirect (basket_id); -CREATE INDEX groupbasket_redirect_action_id_idx ON groupbasket_redirect (action_id); -CREATE INDEX groupbasket_redirect_entity_id_idx ON groupbasket_redirect (entity_id); +-- CREATE INDEX groupbasket_redirect_action_id_idx ON groupbasket_redirect (action_id); +-- CREATE INDEX groupbasket_redirect_entity_id_idx ON groupbasket_redirect (entity_id); -- history CREATE INDEX table_name_idx ON history (table_name); @@ -73,3 +85,15 @@ CREATE INDEX user_id_queries_idx ON saved_queries (user_id); -- users CREATE INDEX lastname_users_idx ON users (lastname); + +-- listinstance_history_details +CREATE INDEX listinstance_history_id_idx ON listinstance_history_details (listinstance_history_id); + +-- res_mark_as_read +CREATE INDEX user_id_res_mark_as_read_idx ON res_mark_as_read (user_id); + +-- listmodels +CREATE INDEX object_id_listmodels_idx ON listmodels (object_id); + +-- contact_addresses +CREATE INDEX contact_id_contact_addresses_idx ON contact_addresses (contact_id);