[Rt-commit] rt branch, 4.4/config-option-search-results-navigation-links, repushed

Craig Kaiser craig at bestpractical.com
Tue Jun 23 11:17:14 EDT 2020


The branch 4.4/config-option-search-results-navigation-links was deleted and repushed:
       was 97934b57281ecb73b5aa524dd1ae5718cb69dee7
       now 3885a01c0a3b7a856fd470064373cc7d589061c8

1: 97934b5728 ! 1: 998c738407 Add config option to disable search results navigation links
    @@ -2,8 +2,9 @@
     
         Add config option to disable search results navigation links
         
    -    Generating these links requires re-running the current tickets search
    -    which results in the loading of ticket display page taking slightly longer.
    +    Generating these links requires running the RT::Tickets->_BuildItemMap
    +    method for the current tickets search. which results in the loading of
    +    the ticket display page taking slightly longer.
     
     diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
     --- a/etc/RT_Config.pm.in
    @@ -31,8 +32,26 @@
     --- a/share/html/Elements/Tabs
     +++ b/share/html/Elements/Tabs
     @@
    -                         $session{"tickets"}->PrepForSerialization();
    -                     }
    +                     path  => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id,
    +                 ) if $session{CurrentUser}->HasRight( Right => 'ShowArticlesMenu', Object => RT->System );
    + 
    +-                if ( defined $session{"tickets"} ) {
    +-                    # we have to update session data if we get new ItemMap
    +-                    my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
    ++                if ( RT::Config->Get( 'SearchResultsNavigationLinks' ) ) {
    ++                    if ( defined $session{"tickets"} ) {
    ++                        # we have to update session data if we get new ItemMap
    ++                        my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
    + 
    +-                    my $item_map = $session{"tickets"}->ItemMap;
    ++                        my $item_map = $session{"tickets"}->ItemMap;
    + 
    +-                    if ($updatesession) {
    +-                        $session{"tickets"}->PrepForSerialization();
    +-                    }
    ++                        if ($updatesession) {
    ++                            $session{"tickets"}->PrepForSerialization();
    ++                        }
      
     -                    my $search = Menu()->child('search')->child('tickets');
     -                    # Don't display prev links if we're on the first ticket
    @@ -49,7 +68,6 @@
     -                        if ( $item_map->{last} ) {
     -                            $search->child( last =>
     -                                title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
    -+                    if ( RT::Config->Get( 'SearchResultsNavigationLinks' ) ) {
     +                        my $search = Menu()->child('search')->child('tickets');
     +                        # Don't display prev links if we're on the first ticket
     +                        if ( $item_map->{$id}->{prev} ) {
    @@ -69,3 +87,17 @@
                              }
                          }
                      }
    +
    +diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
    +--- a/share/html/Ticket/Display.html
    ++++ b/share/html/Ticket/Display.html
    +@@
    + my $attachment_content = $TicketObj->TextAttachments;
    + 
    + my %link_rel;
    +-if (defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'})) {
    ++if (RT::Config->Get( 'SearchResultsNavigationLinks' ) && defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'})) {
    +     my $item_map = $session{'tickets'}->ItemMap;
    +     $link_rel{first} = "/Ticket/Display.html?id=" . $item_map->{first}                if $item_map->{$TicketObj->Id}{prev};
    +     $link_rel{prev}  = "/Ticket/Display.html?id=" . $item_map->{$TicketObj->Id}{prev} if $item_map->{$TicketObj->Id}{prev};
    +
-:  ------- > 2: 3885a01c0a Add tests for 'SearchResultsNavigationLinks' config option



More information about the rt-commit mailing list