From efeef8df7cb4e7285b0499a5e4bb06f88a860ffb Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 26 Jul 2022 16:49:39 +1200 Subject: [PATCH] Bug 15348: (follow-up) Fix modal to edit delivery date MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This allows you to empty the delivery date and ensures the current date shows Signed-off-by: Christian Stelzenmüller Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- acqui/moddeliverydate.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acqui/moddeliverydate.pl b/acqui/moddeliverydate.pl index 50de045d81..975fccdb95 100755 --- a/acqui/moddeliverydate.pl +++ b/acqui/moddeliverydate.pl @@ -55,7 +55,7 @@ my $bookseller = Koha::Acquisition::Booksellers->find( $basket->{booksellerid} ) if($op and $op eq 'save') { my $estimated_delivery_date = $input->param('estimated_delivery_date'); - $order->{'estimated_delivery_date'} = dt_from_string( $estimated_delivery_date ); + $order->{'estimated_delivery_date'} = $estimated_delivery_date ? dt_from_string( $estimated_delivery_date ) : undef; ModOrder($order); print $input->redirect($referrer); exit; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index c068e87460..02c785c73a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -599,7 +599,7 @@ [% books_loo.estimated_delivery_date | $KohaDates %] [% IF CAN_user_acquisition_order_manage %] - + Edit @@ -1056,10 +1056,10 @@ e.preventDefault(); var ordernumber = $(this).data("ordernumber"); var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; - var date_text = $( "#delivery_date_" + ordernumber ).html(); + var date_text = $( "#delivery_date_" + ordernumber ).data("delivery_date"); $("#dateEditor .modal-title").text(modalTitle); $("#date_ordernumber").val(ordernumber); - $("#estimated_delivery_date").html( date_text ); + $("#estimated_delivery_date").val(date_text); $("#dateEditor").modal("show"); }); -- 2.39.5