From 342c9088d33b0833973cba0d2d207930a8bfe6f8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 6 Aug 2024 21:35:59 +0000 Subject: [PATCH] Improved redirect for contact actions --- src/Module/Contact.php | 9 ++++++++- view/templates/contacts-template.tpl | 3 ++- view/theme/frio/templates/contacts-template.tpl | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 1455bd5e4f..aabe0badc0 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -58,7 +58,13 @@ class Contact extends BaseModule return; } - $redirectUrl = $_POST['redirect_url'] ?? 'contact'; + $redirectUrl = $_POST['command'] ?? ''; + if (substr($redirectUrl, 0, 7) != 'contact') { + $redirectUrl = 'contact'; + } + if (!empty($_POST['parameter'])) { + $redirectUrl .= '?' . $_POST['parameter']; + } self::checkFormSecurityTokenRedirectOnError($redirectUrl, 'contact_batch_actions'); @@ -459,6 +465,7 @@ class Contact extends BaseModule '$finding' => $searching ? DI::l10n()->t('Results for: %s', $search) : '', '$submit' => DI::l10n()->t('Find'), '$cmd' => DI::args()->getCommand(), + '$parameter' => http_build_query($request), '$contacts' => $contacts, '$form_security_token' => BaseModule::getFormSecurityToken('contact_batch_actions'), 'multiselect' => 1, diff --git a/view/templates/contacts-template.tpl b/view/templates/contacts-template.tpl index 680c84f567..166ff31f77 100644 --- a/view/templates/contacts-template.tpl +++ b/view/templates/contacts-template.tpl @@ -15,7 +15,8 @@ {{$tabs nofilter}}
- + + {{foreach $contacts as $contact}} {{include file="contact/entry.tpl"}} diff --git a/view/theme/frio/templates/contacts-template.tpl b/view/theme/frio/templates/contacts-template.tpl index da9bed90c7..f560e12d45 100644 --- a/view/theme/frio/templates/contacts-template.tpl +++ b/view/theme/frio/templates/contacts-template.tpl @@ -25,7 +25,8 @@ {{* we need the form container to make batch actions work *}} - + + {{* we put here a hidden input element. This is needed to transmit the batch actions with javascript*}}