Trie par nom

This commit is contained in:
Fred Tempez 2023-10-09 19:27:11 +02:00
parent b97d796715
commit d94bd3d57b

View File

@ -453,15 +453,17 @@ class user extends common
} }
} }
} }
// Liste alphabétique // Liste alphabétique
self::$alphabet = range('A', 'Z'); self::$alphabet = range('A', 'Z');
$alphabet = range('A', 'Z'); $alphabet = range('A', 'Z');
self::$alphabet = array_combine($alphabet, self::$alphabet); self::$alphabet = array_combine($alphabet, self::$alphabet);
self::$alphabet = array_merge(['all' => 'Toute'], self::$alphabet); self::$alphabet = array_merge(['all' => 'Toute'], self::$alphabet);
$userIdsFirstnames = helper::arrayColumn($this->getData(['user']), 'firstname'); // Liste des membres
ksort($userIdsFirstnames); $userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
foreach ($userIdsFirstnames as $userId => $userFirstname) { ksort($userIdsLastNames);
foreach ($userIdsLastNames as $userId => $userLastNames) {
if ($this->getData(['user', $userId, 'group'])) { if ($this->getData(['user', $userId, 'group'])) {
// Filtres // Filtres
if ($this->isPost()) { if ($this->isPost()) {
@ -488,14 +490,15 @@ class user extends common
) )
continue; continue;
} }
// Formatage de la liste // Formatage de la liste
$group = helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]);
$profil = $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']);
self::$users[] = [ self::$users[] = [
$userId, $userId,
$userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']), $this->getData(['user', $userId, 'firstname']) . ' ' . $userLastNames,
$group, helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]),
empty($profil) ? $group : $profil, empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
template::button('userEdit' . $userId, [ template::button('userEdit' . $userId, [
'href' => helper::baseUrl() . 'user/edit/' . $userId, 'href' => helper::baseUrl() . 'user/edit/' . $userId,
'value' => template::ico('pencil'), 'value' => template::ico('pencil'),