[Rt-commit] [rtir] 01/01: Stop hardcoding id/ASC for every search

Kevin Falcone falcone at bestpractical.com
Wed Apr 30 17:22:50 EDT 2014


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 3.2/search-ordering
in repository rtir.

commit 8413b09a1a5227a9086de04faa0eabd69bd80ed6
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Apr 30 16:23:40 2014 -0400

    Stop hardcoding id/ASC for every search
    
    Worst part is that this hardcoding overrides user prefs.
    At least now you can use the new global pref from
    4.2/configurable-search-order to override.
    
    This does not get us access to user search preferences unfortunately,
    because we have to define high up the stack since so much RTIR code
    defines defaults and hands off to CollectionList.
    
    It likely wants a default element like ProcessQuery that can be called
    from all the various ticket lists that don't just use
    Search/Results.html.
    
    Some of this will get cleaner when we no longer have an outdated fork of
    the core RT search code in RTIR.
---
 html/RTIR/Incident/BulkAbandon.html    | 4 ++--
 html/RTIR/Incident/Reply/index.html    | 4 ++--
 html/RTIR/Link/FromIncident/index.html | 4 ++--
 html/RTIR/Link/ToIncident/index.html   | 4 ++--
 html/RTIR/Merge/index.html             | 4 ++--
 html/RTIR/Report/BulkReject.html       | 4 ++--
 html/RTIR/Search/Elements/ProcessQuery | 6 +++++-
 html/RTIR/Search/Elements/ShowResults  | 4 ++--
 html/RTIR/Search/Reporting.html        | 4 ++--
 html/RTIR/Search/Results.html          | 4 ++--
 html/RTIR/Search/index.html            | 4 ++--
 11 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index a63724b..960b0f3 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -186,8 +186,8 @@ $Query           => ''
 $Format          => RT->Config->Get('RTIRSearchResultFormats')->{'AbandonIncidents'}
 $Rows            => 50
 $Page            => 1
-$OrderBy         => 'id'
-$Order           => 'ASC'
+$OrderBy         => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order           => RT->Config->Get('DefaultSearchResultOrder')
 
 @SelectedTickets => ()
 @ReplyToAll      => ()
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index 533871b..f8ae065 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -260,8 +260,8 @@ $Query           => ''
 $Format          => RT->Config->Get('RTIRSearchResultFormats')->{'BulkReply'}
 $Rows            => 0
 $Page            => 1
-$OrderBy         => 'id'
-$Order           => 'ASC'
+$OrderBy         => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order           => RT->Config->Get('DefaultSearchResultOrder')
 
 @SelectedReports        => ()
 @SelectedInvestigations => ()
diff --git a/html/RTIR/Link/FromIncident/index.html b/html/RTIR/Link/FromIncident/index.html
index 91ab643..c5905ea 100644
--- a/html/RTIR/Link/FromIncident/index.html
+++ b/html/RTIR/Link/FromIncident/index.html
@@ -83,8 +83,8 @@ $Query       => RT::IR->ActiveQuery( Queue => $Queue )
 $Format      => RT->Config->Get('RTIRSearchResultFormats')->{'LinkChildren'}
 $Rows        => 50
 $Page        => 1
-$OrderBy     => 'id'
-$Order       => 'ASC'
+$OrderBy     => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order       => RT->Config->Get('DefaultSearchResultOrder')
 </%ARGS>
 
 <%INIT>
diff --git a/html/RTIR/Link/ToIncident/index.html b/html/RTIR/Link/ToIncident/index.html
index 6c269c0..9c32953 100644
--- a/html/RTIR/Link/ToIncident/index.html
+++ b/html/RTIR/Link/ToIncident/index.html
@@ -107,6 +107,6 @@ $Query   => undef
 $Format  => RT->Config->Get('RTIRSearchResultFormats')->{'LinkIncident'}
 $Rows    => 50
 $Page    => 1
-$OrderBy => 'id'
-$Order   => 'ASC'
+$OrderBy => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order   => RT->Config->Get('DefaultSearchResultOrder')
 </%ARGS>
diff --git a/html/RTIR/Merge/index.html b/html/RTIR/Merge/index.html
index e7fa5e4..5ea1a48 100644
--- a/html/RTIR/Merge/index.html
+++ b/html/RTIR/Merge/index.html
@@ -177,8 +177,8 @@ $Query          => undef
 $Format         => RT->Config->Get('RTIRSearchResultFormats')->{'Merge'} 
 $Rows           => 50
 $Page           => 1
-$OrderBy        => 'id'
-$Order          => 'ASC'
+$OrderBy        => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order          => RT->Config->Get('DefaultSearchResultOrder')
 
 $SelectedTicket => undef
 </%ARGS>
diff --git a/html/RTIR/Report/BulkReject.html b/html/RTIR/Report/BulkReject.html
index 30e9dfa..9e6b6fb 100644
--- a/html/RTIR/Report/BulkReject.html
+++ b/html/RTIR/Report/BulkReject.html
@@ -174,8 +174,8 @@ $Query               => ''
 $Format              => RT->Config->Get('RTIRSearchResultFormats')->{'RejectReports'}
 $Rows                => 50
 $Page                => 1
-$OrderBy             => 'id'
-$Order               => 'ASC'
+$OrderBy             => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order               => RT->Config->Get('DefaultSearchResultOrder')
 
 @SelectedTickets     => ()
 $BulkRejectAndReturn => 0
diff --git a/html/RTIR/Search/Elements/ProcessQuery b/html/RTIR/Search/Elements/ProcessQuery
index d07f6c6..0b98371 100644
--- a/html/RTIR/Search/Elements/ProcessQuery
+++ b/html/RTIR/Search/Elements/ProcessQuery
@@ -73,7 +73,11 @@ if ( $NewQuery ) {
 
     my $current = $session{'CurrentSearchHash'};
     my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
-    my $default = { Query => '', Format => '', OrderBy => 'id', Order => 'ASC', RowsPerPage => 50 };
+    my $default = { Query => '',
+                    Format => '',
+                    OrderBy => RT->Config->Get('DefaultSearchResultOrderBy'),
+                    Order => RT->Config->Get('DefaultSearchResultOrder'),
+                    RowsPerPage => 50 };
 
     for( qw(Query Format OrderBy Order RowsPerPage) ) {
         $query{$_} = $current->{$_} unless defined $query{$_};
diff --git a/html/RTIR/Search/Elements/ShowResults b/html/RTIR/Search/Elements/ShowResults
index 565f472..8eedcd0 100644
--- a/html/RTIR/Search/Elements/ShowResults
+++ b/html/RTIR/Search/Elements/ShowResults
@@ -103,8 +103,8 @@ $Query           => ''
 $Format          => ''
 $Rows            => undef
 $Page            => 1
-$OrderBy         => 'id'
-$Order           => 'ASC'
+$OrderBy         => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order           => RT->Config->Get('DefaultSearchResultOrder')
 
 $BaseURL         => "RTIR/Search/Results.html?"
 
diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 0af683b..1b9dcf8 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -94,6 +94,6 @@ $Query     => RT::IR->ActiveQuery( Queue => $Queue )
 $Format    => undef
 $Rows      => 50
 $Page      => 1
-$OrderBy   => 'id'
-$Order     => 'ASC'
+$OrderBy   => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order     => RT->Config->Get('DefaultSearchResultOrder')
 </%ARGS>
diff --git a/html/RTIR/Search/Results.html b/html/RTIR/Search/Results.html
index e03117c..cacd228 100644
--- a/html/RTIR/Search/Results.html
+++ b/html/RTIR/Search/Results.html
@@ -103,8 +103,8 @@ $Query     => undef
 $Format    => undef
 $Rows      => 50
 $Page      => 1
-$OrderBy   => 'id'
-$Order     => 'ASC'
+$OrderBy   => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order     => RT->Config->Get('DefaultSearchResultOrder')
 $SavedSearchId => undef
 $SavedChartSearchId => undef
 </%ARGS>
diff --git a/html/RTIR/Search/index.html b/html/RTIR/Search/index.html
index f832e6d..ce8c497 100644
--- a/html/RTIR/Search/index.html
+++ b/html/RTIR/Search/index.html
@@ -78,6 +78,6 @@ $Query      => ''
 $Format     => undef
 $Rows       => 50
 $Page       => 1
-$OrderBy    => 'id'
-$Order      => 'ASC'
+$OrderBy    => RT->Config->Get('DefaultSearchResultOrderBy')
+$Order      => RT->Config->Get('DefaultSearchResultOrder')
 </%ARGS>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list