count valid roles

This commit is contained in:
Fred Tempez 2023-11-30 14:26:11 +01:00
parent ad578028d7
commit 97eafcc5d0
2 changed files with 9 additions and 3 deletions

View File

@ -624,7 +624,9 @@ class course extends common
foreach ($users as $userId => $userValue) { foreach ($users as $userId => $userValue) {
// Compte les rôles // Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++; $profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres // Filtres
if ( if (
@ -769,7 +771,9 @@ class course extends common
foreach ($users as $userId => $userValue) { foreach ($users as $userId => $userValue) {
// Compte les rôles // Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++; $profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres // Filtres
if ( if (

View File

@ -483,7 +483,9 @@ class user extends common
if ($this->getData(['user', $userId, 'group'])) { if ($this->getData(['user', $userId, 'group'])) {
// Compte les rôles // Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++; $profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres // Filtres
if ($this->isPost()) { if ($this->isPost()) {