From 1e6974bcb3643c2a31a84d0f8a216463c278b225 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Aug 2020 16:55:56 +0200 Subject: [PATCH] Bug 16748: Add the ability to define due date in batch checkout This patch allows the librarian to pick the due date when batch checkout Test plan: Batch checkout using a hard due date => Notice that the due date is taken into account Batch checkout the same barcodes with a different due date, to trigger the confirmation step => Notice that the due date is taken into account for the renewals --- .../circ/circulation_batch_checkouts.tt | 24 ++++++++++++++++++- .../prog/en/modules/circ/renew.tt | 18 ++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt index 4df661a155..8483d5763b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt @@ -1,6 +1,7 @@ [% USE raw %] [% USE Asset %] [% USE Branches %] +[% USE Koha %] [% USE KohaDates %] [% USE Price %] [% USE AuthorisedValues %] @@ -77,6 +78,13 @@ + [% IF Koha.Preference('SpecifyDueDate') %] +
+ Due date: + + +
+ [% END %]
@@ -259,7 +267,7 @@ [% END %] [% IF checkout_info.issue.date_due %] -
  • Due on [% checkout_info.issue.date_due | $KohaDates %]
  • +
  • Due on [% checkout_info.issue.date_due | $KohaDates as_due_date => 1 %]
  • [% END %] @@ -274,6 +282,7 @@ +
    @@ -315,7 +324,20 @@ ], "bPaginate": false })); + + [% IF Koha.Preference('SpecifyDueDate') %] + $("#duedatespec").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 %] }); + [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt index 608ed5c84d..b45c0394db 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt @@ -168,6 +168,11 @@
    Renew + [% IF Koha.Preference('SpecifyDueDate') %] + + + [% END %] + @@ -215,6 +220,19 @@ }).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 %] + }); [% END %] -- 2.20.1