From 2f074e9b1e908b9a2bc82a0ed6504e5b20477e84 Mon Sep 17 00:00:00 2001 From: Thibaud Guillot Date: Fri, 3 Nov 2023 15:30:04 +0100 Subject: [PATCH] Bug 29007: Add cancellation reason input on check in Content-Type: text/plain; charset=utf-8 Test plan: 1) Check an item in with already a confirmed hold 2) Cancel the hold, it was cancelled without possibility to choosing a reason 3) Apply this patch and do it again, you must see an input to choose your cancellation reason (list from VA) Signed-off-by: David Nind Signed-off-by: Marcel de Rooy --- circ/returns.pl | 4 +++- .../prog/en/modules/circ/returns.tt | 21 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 564e60c966..dddc6e676e 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -147,6 +147,8 @@ if ( $query->param('reserve_id') ) { my $reserve_id = $query->param('reserve_id'); my $diffBranchReturned = $query->param('diffBranch'); my $cancel_reserve = $query->param('cancel_reserve'); + my $cancel_reason = $query->param('cancel_reason'); + # fix up item type for display my $item = Koha::Items->find( $itemnumber ); my $biblio = $item->biblio; @@ -154,7 +156,7 @@ if ( $query->param('reserve_id') ) { if ( $cancel_reserve ) { my $hold = Koha::Holds->find( $reserve_id ); if ( $hold ) { - $hold->cancel( { charge_cancel_fee => !$forgivemanualholdsexpire } ); + $hold->cancel( { charge_cancel_fee => !$forgivemanualholdsexpire, cancellation_reason => $cancel_reason} ); } # FIXME else? } else { my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index dfa34b1c70..2abde7f9c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -686,6 +686,7 @@ @@ -1549,7 +1562,9 @@ this.form.submit(); }); $('.cancel-hold').on("click",function(e){ + let cancel_reason = document.getElementById('cancellation-reason').value; this.form.cancel_reserve.value = 1; + this.form.cancel_reason.value = cancel_reason; this.form.submit(); }); -- 2.30.2