Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort item sets by title in item set selector #2217

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Sort item sets by title in item set selector
  • Loading branch information
jimsafley committed Jul 29, 2024
commit 8146fc290ee101b95dc5a51adfd1b0a071a57e19
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
Loading