Bug 24257: Fix close of modal on 'Yes, print slip'
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 18 Dec 2019 09:37:00 +0000 (10:37 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 9 Jan 2020 16:32:50 +0000 (16:32 +0000)
When a item-transfer-modal is prompted by returns.tt and the option
"Yes, print slip" is selected the transfer is not initiated and the
modal does not disappear.

The print_slip hidden input must be in the same form as the
submit/button .print, otherwise the browser logs
  this.form.print_slip is undefined

Test plan:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't
belong to.
3. When the popup modal appears select 'Yes, print slip'.
=> Observe that the transfer does initiate and the modal closes

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

index 05c2eae..2981888 100644 (file)
                                     <div class="modal-dialog">
                                         <div class="modal-content">
                                             <form method="post" action="returns.pl" name="mainform" id="mainform">
+
+                                                <input type="hidden" name="print_slip" value="0" />
+
                                                 <div class="modal-header">
                                                     <h3>
                                                         Please return this item to [% Branches.GetName( returnbranch ) | html %]
                                     <div class="modal-dialog">
                                         <div class="modal-content">
                                             <form method="post" action="returns.pl" class="confirm">
+
+                                                <input type="hidden" name="print_slip" value="0" />
+
                                                 <div class="modal-header">
                                                     <h3>
                                                         Hold found:
                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
                                                     [% END %]
 
-                                                    <input type="hidden" name="print_slip" value="0" />
-
-
                                                     [% FOREACH inputloo IN inputloop %]
                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />