Skip to content

Commit

Permalink
Sort resource selects by label
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Jul 31, 2024
1 parent 8146fc2 commit 8b8684c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/src/Form/Element/AbstractGroupByOwnerSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ public function getValueOptions(): array
$resourceOwners[$index]['resources'][] = $resource;
}
ksort($resourceOwners);
// Sort the resources by label.
foreach ($resourceOwners as $email => $resourceOwner) {
usort($resourceOwners[$email]['resources'], function ($a, $b) {
return strcmp($this->getValueLabel($a), $this->getValueLabel($b));
});
}

$valueOptions = [];
foreach ($resourceOwners as $resourceOwner) {
Expand Down

0 comments on commit 8b8684c

Please sign in to comment.