Bug 24171: Preserve auto_renew when triggering itemBarcodeFallbackSearch
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 17 Dec 2019 11:10:28 +0000 (12:10 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 4 Feb 2020 10:16:32 +0000 (10:16 +0000)
The auto_renew parameter is not sent to the template when the popup
triggered by itemBarcodeFallbackSearch is displayed.

Test plan:
- Turn on itemBarcodeFallbackSearch
- Open a patron account
- Check the checkboxes for automatic-renewal
- Search for a title keyword in the checkout input box
- Verify that auto-renewal flag is set

Note for QA: The auto_renew flag will be set in any cases. Should we
expect regression?

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 90e525c..3655ec1 100755 (executable)
@@ -204,6 +204,8 @@ else {
     $session->clear('auto_renew');
 }
 
+$template->param( auto_renew => $session->param('auto_renew') );
+
 my ($datedue,$invalidduedate);
 
 my $duedatespec_allow = C4::Context->preference('SpecifyDueDate');
@@ -427,7 +429,6 @@ if (@$barcodes) {
                 $template_params->{getTitleMessageIteminfo} = $biblio->title;
                 $template_params->{getBarcodeMessageIteminfo} = $item->barcode;
                 $template_params->{NEEDSCONFIRMATION} = 1;
-                $template_params->{auto_renew} = $session->param('auto_renew');
                 $confirm_required = 1;
             }
         }
index b028549..7c7eaef 100644 (file)
                                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
                                                                     <input type="hidden" name="barcode" value="[% book.barcode | html %]" />
                                                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
+                                                                    <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
                                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
                                                                 </form>
                                                             </td>