[Rt-commit] [rtir] 01/01: More uncopied updates from core

Kevin Falcone falcone at bestpractical.com
Wed Aug 13 13:01:11 EDT 2014


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

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

commit 3884f119a666ee951f5fe847a7a4c473aeafd9c1
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Aug 13 12:44:47 2014 -0400

    More uncopied updates from core
    
    RTIR/Search/Results.html is a suspiciously sparse copy of core.
    While I hope that soon it will cease to exist, for now, honor your
    search preferences to match Core and also handle the RowsPerPage vs Rows
    split.
    
    Resolves issues #30037
---
 html/RTIR/Search/Results.html | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/html/RTIR/Search/Results.html b/html/RTIR/Search/Results.html
index cacd228..ced3290 100644
--- a/html/RTIR/Search/Results.html
+++ b/html/RTIR/Search/Results.html
@@ -94,6 +94,24 @@ my $BaseURL = "RTIR/Search/Results.html";
 $BaseURL .= '?'. $m->comp( '/Elements/QueryString', Queue => $Queue )
     if $Queue;
 
+# Read from user preferences
+my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
+
+$Format      ||= $prefs->{'Format'} || RT->Config->Get('DefaultSearchResultFormat');
+$Order       ||= $prefs->{'Order'} || RT->Config->Get('DefaultSearchResultOrder');
+$OrderBy     ||= $prefs->{'OrderBy'} || RT->Config->Get('DefaultSearchResultOrderBy');
+
+
+if ( !defined($Rows) ) {
+    if (defined $ARGS{'RowsPerPage'} ) {
+        $Rows = $ARGS{'RowsPerPage'};
+    } elsif ( defined $prefs->{'RowsPerPage'} ) {
+        $Rows = $prefs->{'RowsPerPage'};
+    } else {
+        $Rows = 50;
+    }
+}
+
 </%INIT>
 <%ARGS>
 $Queue     => ''
@@ -101,10 +119,10 @@ $Queue     => ''
 $BaseQuery => ''
 $Query     => undef
 $Format    => undef
-$Rows      => 50
+$Rows      => undef
 $Page      => 1
-$OrderBy   => RT->Config->Get('DefaultSearchResultOrderBy')
-$Order     => RT->Config->Get('DefaultSearchResultOrder')
+$OrderBy   => undef
+$Order     => undef
 $SavedSearchId => undef
 $SavedChartSearchId => undef
 </%ARGS>

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


More information about the rt-commit mailing list