From 8f1d034a5fab4bb5545b478e499a573b77076150 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 23 Dec 2019 14:06:06 +0100
Subject: [PATCH] Bug 24171: Check auto_renew if confirmation is needed

Test plan:
Add some fines
Check auto_renew and check an item out, using a title keyword
Pick one item
You get the confirmation box
=> Notice that the auto_renew checkbox is checked

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index afccab3c08..daca2c41c2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -565,9 +565,17 @@
                                                     [% UNLESS ( noissues ) %]
                                                         <div id="set-automatic-renewal" class="circ-setting">
                                                             [% IF NEEDSCONFIRMATION %]
-                                                                <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
+                                                                [% IF auto_renew %]
+                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
+                                                                [% ELSE %]
+                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
+                                                                [% END %]
                                                             [% ELSE %]
-                                                                <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
+                                                                [% IF auto_renew %]
+                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
+                                                                [% ELSE %]
+                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
+                                                                [% END %]
                                                             [% END %]
 
                                                             <label for="auto_renew">Automatic renewal</label>
-- 
2.11.0