Skip to content

Commit

Permalink
Sort item sets by title in item set selector
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Jul 29, 2024
1 parent 944984c commit 8146fc2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/src/View/Helper/ItemSetSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function __invoke($includeClosedSets = false)
$itemSetOwners[$email]['owner'] = $owner;
$itemSetOwners[$email]['item_sets'][] = $itemSet;
}
// Sort the item sets by title.
foreach ($itemSetOwners as $email => $itemSetOwner) {
usort($itemSetOwners[$email]['item_sets'], function ($a, $b) {
return strcmp($a->displayTitle(), $b->displayTitle());
});
}

return $this->getView()->partial(
'common/item-set-selector',
Expand Down

0 comments on commit 8146fc2

Please sign in to comment.