From 076ab8001f77ca61417dae743261af5079de9bd4 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Tue, 18 Apr 2017 17:53:08 +0200 Subject: [PATCH] Timeline 'More Events' button stays with current day Prior to this, the 'More Events' button would also set 'days' parameter to its previous value - 7 like the 'Next' button does. Regression introduced by e2d1de8a9f2fc5a7190efa252b2aa6df7e5c6310. Fixes #22743 --- core/timeline_inc.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/core/timeline_inc.php b/core/timeline_inc.php index 952711677d..4de924c8d0 100644 --- a/core/timeline_inc.php +++ b/core/timeline_inc.php @@ -47,10 +47,6 @@ $t_block_icon = $t_collapse_block ? 'fa-chevron-down' : 'fa-chevron-up'; $t_url_page = string_sanitize_url( basename( $_SERVER['SCRIPT_NAME'] ) ); -$t_url_params = $_GET; -if( isset( $t_url_params['all'] ) ) { - unset( $t_url_params['all'] ); -} ?>
@@ -78,14 +74,14 @@ echo '  '; echo '
'; - $t_url_params['days'] = $f_days + 7; + $t_url_params = array( 'days' => $f_days + 7 ); $t_href = $t_url_page . '?' . http_build_query( $t_url_params ); echo ' ' . lang_get( 'prev' ) . ''; - $t_next_days = ( $f_days - 7 ) > 0 ? $f_days - 7 : 0; + $t_next_days = max( $f_days - 7, 0 ); if( $t_next_days != $f_days ) { - $t_url_params['days'] = $t_next_days; + $t_url_params = array( 'days' => $t_next_days ); $t_href = $t_url_page . '?' . http_build_query( $t_url_params ); echo ' ' . lang_get( 'next' ) . ''; } @@ -105,7 +101,10 @@ timeline_print_events( $t_events ); echo '
'; echo '
'; - $t_url_params['all'] = 1; + $t_url_params = array( + 'days' => $f_days, + 'all' => 1, + ); $t_href = $t_url_page . '?' . http_build_query( $t_url_params ); echo '' . lang_get( 'timeline_more' ) . ''; echo '
';