Bug 16112: Add the ability to define due date for batch renew
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / renew.tt
index 608ed5c..d9d335e 100644 (file)
                             [% END %]
 
                                 <form method="get" action="/cgi-bin/koha/circ/renew.pl">
+                                    <input type="hidden" name="hard_due_date" value="[% hard_due_date | html %]" />
                                     <button type="submit" class="deny"><i class="fa fa-times"></i> Continue without renewing</button>
                                 </form>
                     </div>
                     <fieldset>
                         <legend>Renew</legend>
 
+                        [% IF Koha.Preference('SpecifyDueDate') %]
+                            <label for="hard_due_date">Hard due date [% INCLUDE 'date-format.inc' %]:</label>
+                            <input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" />
+                            <br/>
+                        [% END %]
+
                         <label for="barcode">Enter item barcode: </label>
 
                         <input name="barcode" id="barcode" size="14" class="focus" type="text" />
             }).on('change', function(e) {
                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val('');}
             });
+
+            [% IF Koha.Preference('SpecifyDueDate') %]
+                $("#hard_due_date").datetimepicker({
+                    onClose: function(dateText, inst) {
+                        validate_date(dateText, inst);
+                    },
+                    hour: 23,
+                    minute: 59
+                }).on("change", function(e, value) {
+                    if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
+                });
+            [% END %]
+
         });
     </script>
 [% END %]