Merge branch 'role'
This commit is contained in:
commit
d3e5547461
@ -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' => [
|
||||
[
|
||||
'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]);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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": "",
|
||||
|
@ -359,8 +359,8 @@
|
||||
<div class="row">
|
||||
<div class='col6'>
|
||||
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
||||
'label' => '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.'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('userAddGroup', self::$groupNews, [
|
||||
'label' => 'Groupe',
|
||||
'label' => 'Rôle',
|
||||
'selected' => self::GROUP_MEMBER
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -128,9 +128,9 @@
|
||||
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||
<?php echo template::select('userEditGroup', self::$groupEdits, [
|
||||
'disabled' => ($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']),
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::hidden('userEditGroup', [
|
||||
|
@ -61,7 +61,7 @@
|
||||
<?php if (user::$users): ?>
|
||||
<div class="row">
|
||||
<div class="col12 textAlignCenter">
|
||||
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Groupe', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
|
||||
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Rôle', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
|
||||
<?php echo template::ico('check'); ?> Compte créé |
|
||||
<?php echo template::ico('mail'); ?> Compte créé et notifié |
|
||||
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.
|
||||
|
@ -68,4 +68,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php echo template::table([3, 2, 2, 2, 2, 1, 1], user::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','group','profile','tag','data-timestamp','edit','delete']); ?>
|
||||
<?php echo template::table([3, 2, 2, 1, 3, 1, 1], user::$users, ['Nom', 'Rôle', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','role','profile','tag','data-timestamp','edit','delete']); ?>
|
||||
|
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::select('profilAddGroup', user::$groupProfils, [
|
||||
'label' => 'Groupe associé',
|
||||
'label' => 'Rôle associé',
|
||||
'selected' => $this->getUrl(2)
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::text('profilEditDisplayGroup', [
|
||||
'label' => 'Groupe associé',
|
||||
'label' => 'Rôle associé',
|
||||
'value' => helper::translate(self::$groups[$this->getUrl(2)]),
|
||||
'disabled' => true
|
||||
]); ?>
|
||||
|
@ -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'
|
||||
];
|
||||
|
||||
|
@ -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",
|
||||
|
@ -28,8 +28,8 @@
|
||||
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||
<?php echo template::select('registrationUserEditGroup', suscribe::$groups, [
|
||||
'disabled' => ($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'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user