diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 9af1375..baec29a 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -4,7 +4,7 @@ * Mises à jour suivant les versions de ZwiiCampus */ - +// Version 1.7.00 if ( $this->getData(['core', 'dataVersion']) < 1700 ) { @@ -22,6 +22,7 @@ if ( $this->setData(['core', 'dataVersion', 1700]); } +// Version 1.8.00 if ( $this->getData(['core', 'dataVersion']) < 1800 ) { @@ -46,6 +47,7 @@ if ( $this->setData(['core', 'dataVersion', 1800]); } +// Version 1.20.02 if ( $this->getData(['core', 'dataVersion']) < 12002 ) { @@ -56,9 +58,12 @@ if ( // Tableau à insérer $a = [ 'theme' => - ['menu' => [ - 'hidePages' => false - ]]]; + [ + 'menu' => [ + 'hidePages' => false + ] + ] + ]; // Parcourir la structure pour écrire dans les fichiers JSON foreach ($this->getData(['course']) as $courseId => $courseValues) { $d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true); @@ -74,3 +79,57 @@ if ( } $this->setData(['core', 'dataVersion', 12002]); } + +// Version 1.21.00 + +if ( + $this->getData(['core', 'dataVersion']) < 12100 +) { + /** + * Renomme la clé dans la base des utilisateurs + */ + if ( + is_array($this->getData(['user'])) + && empty($this->getData(['user'])) === false + ) { + foreach ($this->getData(['user']) as $userId => $userValue) { + $d = $this->getData(['user', $userId]); + if (isset($d['group']) && $d['group'] !== '') { + $position = array_search('group', array_keys($d)) + 1; + $l = array_merge( + array_slice($d, 0, $position), + ['role' => $d['group']], + array_slice($d, $position) + ); + unset($l['group']); + $this->setData(['user', $userId, $l], false); + } + } + } + $this->saveDb('user'); + + + /** + * Convertit les pages et les modules + */ + $courses = array_merge($this->getData(['course']), ['home' => array()]); + + foreach ($courses as $courseId => $courseValue) { + // Les pages + $filePath = self::DATA_DIR . $courseId . '/page.json'; + $jsonContent = file_get_contents($filePath); + $updatedJsonContent = str_replace('"group":', '"role":', $jsonContent); + if ($updatedJsonContent !== $jsonContent) { + file_put_contents($filePath, $updatedJsonContent); + } + + // Les modules + $filePath = self::DATA_DIR . $courseId . '/module.json'; + $jsonContent = file_get_contents($filePath); + $updatedJsonContent = str_replace('"group":', '"role":', $jsonContent); + if ($updatedJsonContent !== $jsonContent) { + file_put_contents($filePath, $updatedJsonContent); + } + } + $this->setData(['core', 'dataVersion', 12100]); +} diff --git a/core/module/course/course.php b/core/module/course/course.php index 353df64..72a7667 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -652,7 +652,7 @@ class course extends common case "2": foreach ($groupValue as $profilId => $profilValue) { if ($profilId) { - self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); + self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); $profils[$groupId . $profilId] = 0; } } @@ -823,7 +823,7 @@ class course extends common case "2": foreach ($groupValue as $profilId => $profilValue) { if ($profilId) { - self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); + self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); $profils[$groupId . $profilId] = 0; } } @@ -991,7 +991,7 @@ class course extends common case "2": foreach ($groupValue as $profilId => $profilValue) { if ($profilId) { - self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); + self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); $profils[$groupId . $profilId] = 0; } } diff --git a/core/module/install/ressource/i18n/en_EN.json b/core/module/install/ressource/i18n/en_EN.json index 4abccc8..50bb93f 100644 --- a/core/module/install/ressource/i18n/en_EN.json +++ b/core/module/install/ressource/i18n/en_EN.json @@ -261,9 +261,9 @@ "Grande (220%)": "Grande (220%)", "Grande (300px)": "Grande (300px)", "Gras": "Bold", - "Groupe": "Group", - "Groupe associé": "Associated Group", - "Groupe requis pour accéder à la page :": "Group required to access the page:", + "Rôle": "role", + "Rôle associé": "Associated role", + "Rôle requis pour accéder à la page :": "role required to access the page:", "Groupes": "Groups", "Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt", "Générer une capture Open Graph": "Generate an Open Graph capture", diff --git a/core/module/install/ressource/i18n/es.json b/core/module/install/ressource/i18n/es.json index 10d3bcb..df2a582 100644 --- a/core/module/install/ressource/i18n/es.json +++ b/core/module/install/ressource/i18n/es.json @@ -261,9 +261,9 @@ "Grande (220%)": "Grande (220%)", "Grande (300px)": "Grande (300px)", "Gras": "Negrita", - "Groupe": "Grupo", - "Groupe associé": "Grupo asociado", - "Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:", + "Rôle": "Grupo", + "Rôle associé": "Grupo asociado", + "Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:", "Groupes": "Grupos", "Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt", "Générer une capture Open Graph": "Generar una captura de Open Graph", diff --git a/core/module/install/ressource/i18n/fr_FR.json b/core/module/install/ressource/i18n/fr_FR.json index cd66183..94617a9 100644 --- a/core/module/install/ressource/i18n/fr_FR.json +++ b/core/module/install/ressource/i18n/fr_FR.json @@ -261,9 +261,9 @@ "Grande (220%)": "", "Grande (300px)": "", "Gras": "", - "Groupe": "", - "Groupe associé": "", - "Groupe requis pour accéder à la page :": "", + "Rôle": "", + "Rôle associé": "", + "Rôle requis pour accéder à la page :": "", "Groupes": "", "Générer sitemap.xml et robots.txt": "", "Générer une capture Open Graph": "", diff --git a/core/module/page/view/edit/edit.php b/core/module/page/view/edit/edit.php index 28fcda7..088d077 100644 --- a/core/module/page/view/edit/edit.php +++ b/core/module/page/view/edit/edit.php @@ -359,8 +359,8 @@
'Groupe minimal pour accéder à la page', - 'selected' => $this->getData(['page', $this->getUrl(2), 'group']), + 'label' => 'Rôle minimal pour accéder à la page', + 'selected' => $this->getData(['page', $this->getUrl(2), 'role']), 'help' => 'Les groupes de niveau supérieur accèdent à la page.' ]); ?>
diff --git a/core/module/user/user.php b/core/module/user/user.php index 027e172..3e159f1 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -303,7 +303,7 @@ class user extends common case "2": foreach ($groupValue as $profilId => $profilValue) { if ($profilId) { - self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); + self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); $profils[$groupId . $profilId] = 0; } } @@ -630,7 +630,7 @@ class user extends common case "2": foreach ($groupValue as $profilId => $profilValue) { if ($profilId) { - self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); + self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); $profils[$groupId . $profilId] = 0; } } @@ -1869,7 +1869,7 @@ class user extends common case "2": foreach ($groupValue as $profilId => $profilValue) { if ($profilId) { - self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); + self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); $profils[$groupId . $profilId] = 0; } } diff --git a/core/module/user/view/add/add.php b/core/module/user/view/add/add.php index 4baf88a..4a1e392 100644 --- a/core/module/user/view/add/add.php +++ b/core/module/user/view/add/add.php @@ -105,7 +105,7 @@
'Groupe', + 'label' => 'Rôle', 'selected' => self::GROUP_MEMBER ]); ?>
diff --git a/core/module/user/view/edit/edit.php b/core/module/user/view/edit/edit.php index 2fafb5f..eedc467 100644 --- a/core/module/user/view/edit/edit.php +++ b/core/module/user/view/edit/edit.php @@ -128,9 +128,9 @@ getUser('group') === self::GROUP_ADMIN): ?> ($this->getUrl(2) === $this->getUser('id')), - 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''), - 'label' => 'Groupe', - 'selected' => $this->getData(['user', $this->getUrl(2), 'group']), + 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre rôle.' : ''), + 'label' => 'Rôle', + 'selected' => $this->getData(['user', $this->getUrl(2), 'role']), ]); ?>
- + Compte créé | Compte créé et notifié | Erreur dans le fichier ou le compte existe. diff --git a/core/module/user/view/index/index.php b/core/module/user/view/index/index.php index dc4dbdf..e188361 100644 --- a/core/module/user/view/index/index.php +++ b/core/module/user/view/index/index.php @@ -68,4 +68,4 @@
- 'dataTables'], ['name','group','profile','tag','data-timestamp','edit','delete']); ?> \ No newline at end of file + 'dataTables'], ['name','role','profile','tag','data-timestamp','edit','delete']); ?> diff --git a/core/module/user/view/profilAdd/profilAdd.php b/core/module/user/view/profilAdd/profilAdd.php index e061dd9..e48912d 100644 --- a/core/module/user/view/profilAdd/profilAdd.php +++ b/core/module/user/view/profilAdd/profilAdd.php @@ -28,7 +28,7 @@
'Groupe associé', + 'label' => 'Rôle associé', 'selected' => $this->getUrl(2) ]); ?>
diff --git a/core/module/user/view/profilEdit/profilEdit.php b/core/module/user/view/profilEdit/profilEdit.php index 3a71b91..53a23c5 100644 --- a/core/module/user/view/profilEdit/profilEdit.php +++ b/core/module/user/view/profilEdit/profilEdit.php @@ -40,7 +40,7 @@
'Groupe associé', + 'label' => 'Rôle associé', 'value' => helper::translate(self::$groups[$this->getUrl(2)]), 'disabled' => true ]); ?> diff --git a/module/blog/blog.php b/module/blog/blog.php index f45ace4..b29b4b1 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -111,8 +111,8 @@ class blog extends common // Permissions d'un article public static $articleConsent = [ - self::EDIT_ALL => 'Tous les groupes', - self::EDIT_GROUP => 'Groupe du propriétaire', + self::EDIT_ALL => 'Tous les rôles', + self::EDIT_GROUP => 'Rôle du propriétaire', self::EDIT_OWNER => 'Propriétaire' ]; diff --git a/module/blog/i18n/de.json b/module/blog/i18n/de.json index 353fb97..e0dddfa 100644 --- a/module/blog/i18n/de.json +++ b/module/blog/i18n/de.json @@ -27,7 +27,7 @@ "Commentaires supprimés": "Gelöschte Kommentare", "Fermer les commentaires": "Schalten Sie die Kommentare aus", "Gestion des commentaires": "Kommentarmanagement", - "Groupe du propriétaire": "Besitzergruppe", + "Rôle du propriétaire": "Besitzergruppe", "Image de couverture": "Berichterstattung", "Informations générales": "Allgemeine Informationen", "Lien du flux RSS": "Lien du flux RSS", diff --git a/module/suscribe/view/edit/edit.php b/module/suscribe/view/edit/edit.php index 2833eec..b60e645 100755 --- a/module/suscribe/view/edit/edit.php +++ b/module/suscribe/view/edit/edit.php @@ -28,8 +28,8 @@ getUser('group') === self::GROUP_ADMIN): ?> ($this->getUrl(2) === $this->getUser('id')), - 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''), - 'label' => 'Groupe', + 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre role.' : ''), + 'label' => 'Rôle', 'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status']) ]); ?>