From 5262843e63ae734c2df3ae54491cb816afe20cc0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 5 Sep 2021 14:49:52 -0400 Subject: [PATCH] Add redirect URL parameter to contact batch - This allows redirection to the correct contact tab after a batch action --- src/Module/Contact.php | 2 +- view/templates/contacts-template.tpl | 1 + view/theme/frio/templates/contacts-template.tpl | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 4233be462..bfed6495a 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -88,7 +88,7 @@ class Contact extends BaseModule info(DI::l10n()->tt('%d contact edited.', '%d contacts edited.', $count_actions)); } - DI::baseUrl()->redirect('contact'); + DI::baseUrl()->redirect($_POST['redirect_url'] ?? 'contact'); } public static function post(array $parameters = []) diff --git a/view/templates/contacts-template.tpl b/view/templates/contacts-template.tpl index 1631640a0..9253b862a 100644 --- a/view/templates/contacts-template.tpl +++ b/view/templates/contacts-template.tpl @@ -15,6 +15,7 @@ {{$tabs nofilter}}
+ {{foreach $contacts as $contact}} {{include file="contact_template.tpl"}} {{/foreach}} diff --git a/view/theme/frio/templates/contacts-template.tpl b/view/theme/frio/templates/contacts-template.tpl index ad8a26792..c6a9865a0 100644 --- a/view/theme/frio/templates/contacts-template.tpl +++ b/view/theme/frio/templates/contacts-template.tpl @@ -29,6 +29,7 @@ {{* 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*}}