[Rt-commit] rt branch, 4.4/sort-saved-searches, created. rt-4.4.1-110-g0f7b51c

Jim Brandt jbrandt at bestpractical.com
Wed Aug 31 14:43:30 EDT 2016


The branch, 4.4/sort-saved-searches has been created
        at  0f7b51c69478be090303f7fa35fd5d16d5a5e2f0 (commit)

- Log -----------------------------------------------------------------
commit 0f7b51c69478be090303f7fa35fd5d16d5a5e2f0
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Aug 31 14:39:39 2016 -0400

    Default saved search to alphabetical order
    
    Default to alphabetical order rather than ordering by id.
    Although ordering by id generally gave an order by when created,
    that is less useful to users with long lists of saved searches.
    Alphabetical by saved search description is more useful and
    obvious.
    
    Also provide a callback to make it easier to set a different
    sort order.

diff --git a/share/html/Search/Elements/SelectSearchesForObjects b/share/html/Search/Elements/SelectSearchesForObjects
index aca1998..6844461 100644
--- a/share/html/Search/Elements/SelectSearchesForObjects
+++ b/share/html/Search/Elements/SelectSearchesForObjects
@@ -55,6 +55,8 @@ $SearchType => 'Ticket',
 % foreach my $object (@Objects) {
 % my @searches = $object->Attributes->Named('SavedSearch');
 % if ( @searches ) {
+% @searches = sort { lcfirst($a->Description) cmp lcfirst($b->Description) } @searches;
+% $m->callback( CallbackName => 'ManageSavedSearches', ARGSRef => \%ARGS, SearchesRef => \@searches );
 <optgroup label="<& SearchPrivacy, Object => $object &>">
 % foreach my $search (@searches) { 
 %     # Skip it if it is not of search type we want.

-----------------------------------------------------------------------


More information about the rt-commit mailing list