Mise à jour depuis 11.5

This commit is contained in:
Fred Tempez 2022-11-21 10:05:55 +01:00
parent 47ea5538d5
commit e56d16b58f
2 changed files with 20 additions and 13 deletions

View File

@ -324,6 +324,25 @@ class common
]);;
}
/**
* Mise à jour à partir de la version 11.5.12
* */
if ($this->getData(['core', 'dataVersion']) < 12000) {
// Correspondance pour les dossiers de langue à convertir
$languages = [
'fr' => 'fr_FR',
'en' => 'en_EN',
'pt' => 'pt_PT'
];
// COnvertit les dossiers vers la nouvelle structure
foreach ($languages as $key => $value) {
if (is_dir(self::DATA_DIR . $key)) {
$this->copyDir(self::DATA_DIR . $key, self::DATA_DIR . $value);
$this->removeDir(self::DATA_DIR . $key);
}
}
}
// Installation fraîche, initialisation des modules manquants
foreach ($this->dataFiles as $stageId => $item) {

View File

@ -859,19 +859,6 @@ if ($this->getData(['core', 'dataVersion']) < 11506) {
// Version 11.6.00
if ($this->getData(['core', 'dataVersion']) < 12000) {
// Correspondance pour les dossiers de langue à convertir
$languages = [
'fr' => 'fr_FR',
'en' => 'en_EN',
'pt' => 'pt_PT'
];
// COnvertit les dossiers vers la nouvelle structure
foreach ($languages as $key => $value) {
if (is_dir(self::DATA_DIR . $key)) {
$this->copyDir(self::DATA_DIR . $key, self::DATA_DIR . $value);
$this->removeDir(self::DATA_DIR . $key);
}
}
// Supprime un cookie non nécessaire
helper::deleteCookie('ZWII_USER_LONGTIME');
@ -920,6 +907,7 @@ if ($this->getData(['core', 'dataVersion']) < 12000) {
}
// Langue de l'interface
$this->deleteData(['config', 'i18n']);
// Pas à l'installation
if ($this->getUser('id')) {
$this->setData(['user', $this->getUser('id'), 'language', 'fr_FR']);