Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Tri des employés par activité, nom Fix #483, #491
Browse files Browse the repository at this point in the history
  • Loading branch information
prytoegrian committed Oct 4, 2017
1 parent 059afa7 commit 10e8ab3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions fonctions_conges.php
Original file line number Diff line number Diff line change
Expand Up @@ -1597,18 +1597,19 @@ function recup_infos_du_user($login, $list_groups_double_valid)
return FALSE;
}


function sortParActif($a, $b) {
if( $a['is_active'] == 'N' && $b['is_active'] == 'N') {
return $b['prenom'] < $a['prenom'];
}
if( $a['is_active'] == 'N'){
return 1;
}
if( $b['is_active'] == 'N'){
return -1;
/**
* Tri les tableaux, d'abord par activité, puis par ordre lexicographique
*
* @return int {-1, 0, 1}
*/
function sortParActif(array $a, array $b) {
if ($a['is_active'] == 'Y' && $b['is_active'] == 'N') {
return -1; // $a est avant $b
} elseif ($a['is_active'] == 'N' && $b['is_active'] == 'Y') {
return 1; // $a est derrière $b
}
return 0;

return strnatcmp($a['nom'], $b['nom']);
}

// renvoit un tableau de tableau contenant les informations de tous les users
Expand Down

0 comments on commit 10e8ab3

Please sign in to comment.