Bugzilla – Attachment 158473 Details for
Bug 29007
Prompt for reason when cancelling waiting hold via popup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29007: Add cancellation reason input on check in
Bug-29007-Add-cancellation-reason-input-on-check-i.patch (text/plain), 5.05 KB, created by
David Nind
on 2023-11-05 18:11:38 UTC
(
hide
)
Description:
Bug 29007: Add cancellation reason input on check in
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-11-05 18:11:38 UTC
Size:
5.05 KB
patch
obsolete
>From aa9111c2319b6a88ae7aed1a5ad705a54aa94b86 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Fri, 3 Nov 2023 15:30:04 +0100 >Subject: [PATCH] Bug 29007: Add cancellation reason input on check in > >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 <david@davidnind.com> >--- > 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 5154b71b0b..e01546258f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -685,6 +685,7 @@ > > <div class="modal-footer"> > <input type="hidden" name="cancel_reserve" value="0" /> >+ <input type="hidden" name="cancel_reason" value="" /> > <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" /> > > <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y"> >@@ -699,9 +700,21 @@ > <i class="fa fa-times"></i> Ignore (I) > </button> > >- <button type="button" class="btn btn-default deny cancel-hold" accesskey="X"> >- <i class="fa fa-trash-can"></i> Cancel hold (X) >- </button> >+ <fieldset class="action"> >+ [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >+ [% IF hold_cancellation.count %] >+ <select name="cancellation-reason" id="cancellation-reason"> >+ <option value="NULL">No reason given</option> >+ [% FOREACH reason IN hold_cancellation %] >+ <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> >+ [% END %] >+ </select> >+ [% END %] >+ <button type="button" class="btn btn-default deny cancel-hold" accesskey="X"> >+ <i class="fa fa-trash-can"></i> Cancel hold (X) >+ </button> >+ </fieldset> >+ > </div> <!-- /.modal-footer --> > </form> <!-- /.confirm --> > </div> <!-- /.modal-content --> >@@ -1547,7 +1560,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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29007
:
158337
|
158473
|
158794