]> git.mxchange.org Git - friendica.git/commitdiff
Add redirect URL parameter to contact batch
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 5 Sep 2021 18:49:52 +0000 (14:49 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 5 Sep 2021 18:54:51 +0000 (14:54 -0400)
- This allows redirection to the correct contact tab after a batch action

src/Module/Contact.php
view/templates/contacts-template.tpl
view/theme/frio/templates/contacts-template.tpl

index 4233be46251cd874932c807191a4a6e808e69faf..bfed6495ae1fdb571cfb8ab4752fd5aeec2d8bca 100644 (file)
@@ -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 = [])
index 1631640a0a5ed0a93af54d9659d6efacd0328423..9253b862aab9809411ecf2257bb109411d318d69 100644 (file)
@@ -15,6 +15,7 @@
 {{$tabs nofilter}}
 
 <form action="{{$baseurl}}/contact/batch/" method="POST">
+       <input type="hidden" name="redirect_url" value="{{$cmd}}"/>
 {{foreach $contacts as $contact}}
        {{include file="contact_template.tpl"}}
 {{/foreach}}
index ad8a267927ec516f6b5b766a1ab0de670837fb69..c6a9865a016f2ca5986112c3abdc664bb3042020 100644 (file)
@@ -29,6 +29,7 @@
 
        {{* we need the form container to make batch actions work *}}
        <form name="batch_actions_submit" action="{{$baseurl}}/contact/batch/" method="POST">
+               <input type="hidden" name="redirect_url" value="{{$cmd}}"/>
 
                {{* we put here a hidden input element. This is needed to transmit the batch actions with javascript*}}
                <input type="hidden" class="batch-action no-input fakelist" name="batch_submit" value="{{$l}}">