[Rt-commit] rt branch 5.0/optional-jump-to-page created. rt-5.0.3-233-g4d8706a04b
BPS Git Server
git at git.bestpractical.com
Mon Jan 30 20:27:43 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/optional-jump-to-page has been created
at 4d8706a04b6ab61c9f727bb6adb57a74a51618f0 (commit)
- Log -----------------------------------------------------------------
commit 4d8706a04b6ab61c9f727bb6adb57a74a51618f0
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Mon Jan 30 15:03:59 2023 -0500
Disable jump to page form by default in CollectionList
Some pages put CollectionList inside an existing form
and HTML doesn't like nested forms. In these cases,
adding the jump to page form can cause the existing form
to stop working, like on Bulk Update.
Make the jump to page form optional and default it to off
since it is new and may not be appropriate for all locations
where CollectionList is used.
Enable for ticket search results, which is the primary use
case for adding it.
diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
index 46c8fcccc7..745c764288 100644
--- a/share/html/Elements/CollectionList
+++ b/share/html/Elements/CollectionList
@@ -205,7 +205,8 @@ if ( $Rows && $ShowNavigation && $TotalFound > $Rows ) {
CurrentPage => $Page,
Pages => $pages,
PageParam => $PageParam,
- URLParams => \%query_args
+ URLParams => \%query_args,
+ ShowJumpToPage => $ShowJumpToPage,
);
}
@@ -237,4 +238,5 @@ $InlineEdit => RT->Config->Get('InlineEdit', $session{CurrentUser})
$Query => 0
$HasResults => undef
$ObjectType => $Class eq 'RT::Transactions' ? 'RT::Ticket' : ''
+$ShowJumpToPage => 0
</%ARGS>
diff --git a/share/html/Elements/CollectionListPaging b/share/html/Elements/CollectionListPaging
index 15ed494b2b..1184a6dd9a 100644
--- a/share/html/Elements/CollectionListPaging
+++ b/share/html/Elements/CollectionListPaging
@@ -53,6 +53,9 @@ $CurrentPage => undef
$Pages => undef
$URLParams => undef
$PageParam => 'Page'
+# Disable if CollectionList is inside an existing form, like
+# Bulk Update, because HTML doesn't like nested forms
+$ShowJumpToPage => 0
</%ARGS>
<%INIT>
@@ -102,7 +105,7 @@ else{
$m->out(qq{</div>});
</%INIT>
-% if ( $Pages > 1 ) {
+% if ( $Pages > 1 && $ShowJumpToPage ) {
<div class="page-jump mx-auto">
<form>
% foreach my $key ( keys(%$URLParams) ) {
diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index 1d1639e60e..f39664fbf6 100644
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -79,6 +79,7 @@
BaseQuery => $BaseQuery || $Query,
@ExtraQueryParams ? ( map { $_ => $ARGS{$_} } grep { defined $ARGS{$_} } 'ExtraQueryParams', @ExtraQueryParams ) : (),
PassArguments => [qw(BaseQuery Query Format Rows Page Order OrderBy SavedSearchId SavedChartSearchId Class ObjectType ExtraQueryParams), @ExtraQueryParams],
+ ShowJumpToPage => 1,
&>
% }
% $m->callback( ARGSRef => \%ARGS, Count => $count, CallbackName => 'AfterResults' );
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list