[Rt-commit] rt branch, 4.6/sort-saved-searches, created. rt-4.4.4-44-gaaa44a082

Craig Kaiser craig at bestpractical.com
Fri May 24 15:52:55 EDT 2019


The branch, 4.6/sort-saved-searches has been created
        at  aaa44a08245d6f97f6f62e3eff5e667bd61a64fd (commit)

- Log -----------------------------------------------------------------
commit 95d42cefb618568018466021303e173970a58c8b
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu May 2 18:33:25 2019 -0500

    Move SignatureAboveQuote to Message box properties
    
    This commit moves the SignatureAboveQuote entries in RT_Config.pm
    to the Message box properties section.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 01246e5b4..1ce94ba0f 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2137,6 +2137,16 @@ C<$MessageBoxIncludeSignature>.
 
 Set($MessageBoxIncludeSignatureOnComment, 1);
 
+=item C<$SignatureAboveQuote>
+
+By default RT places the signature at the bottom of the quoted text in
+the message box for ticket replies.  Set this to 1 to place the signature
+above the quoted text.
+
+=cut
+
+Set($SignatureAboveQuote, 0);
+
 =back
 
 =head2 Attach Files
@@ -2898,16 +2908,6 @@ minutes.  Note that this only effects entry, not display.
 
 Set($DefaultTimeUnitsToHours, 0);
 
-=item C<$SignatureAboveQuote>
-
-By default RT places the signature at the bottom of the quoted text in
-the message box for ticket replies.  Set this to 1 to place the signature
-above the quoted text.
-
-=cut
-
-Set($SignatureAboveQuote, 0);
-
 =item C<$TimeInICal>
 
 By default, events in the iCal feed on the ticket search page

commit aaa44a08245d6f97f6f62e3eff5e667bd61a64fd
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri May 24 15:45:38 2019 -0400

    Allow saved searches to be sorted
    
    Saved searches are saved in the database as attributes meaning that the
    order by cols method usually available is not.

diff --git a/lib/RT/SavedSearches.pm b/lib/RT/SavedSearches.pm
index 224b20a24..d44b8594b 100644
--- a/lib/RT/SavedSearches.pm
+++ b/lib/RT/SavedSearches.pm
@@ -109,6 +109,23 @@ sub LimitToPrivacy {
     }
 }
 
+
+=head2 SortSavedSearches
+
+Sort the list of saved searches. The default is to sort alphabetically.
+
+=cut
+
+sub SortSavedSearches {
+    my $self = shift;
+
+    # Work directly with the internal data structure since saved searches
+    # aren't fully backed by a DB table and can't support typical OrderBy, etc.
+    my @sorted = sort { lcfirst($a->Name) cmp lcfirst($b->Name) } @{$self->{'objects'}};
+    @{$self->{'objects'}} = @sorted;
+    return;
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/share/html/Elements/SavedSearches b/share/html/Elements/SavedSearches
index 1ef131c10..9a519873e 100644
--- a/share/html/Elements/SavedSearches
+++ b/share/html/Elements/SavedSearches
@@ -49,6 +49,7 @@
 % foreach my $Object (@Objects) {
 %   my $SavedSearches = RT::SavedSearches->new($session{CurrentUser});
 %   $SavedSearches->LimitToPrivacy(join('-',ref($Object),$Object->Id),'Ticket');
+%   $SavedSearches->SortSavedSearches();
 %   my $title;
 %   if (ref $Object eq 'RT::User' && $Object->Id == $session{CurrentUser}->Id) {
 %       $title = loc("My saved searches");

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


More information about the rt-commit mailing list