Bugzilla – Attachment 105105 Details for
Bug 25534
Add ability to specifying and store a reason when cancelling a hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25534: Use the cancelation reasion for the 'X' hold cancelation links
Bug-25534-Use-the-cancelation-reasion-for-the-X-ho.patch (text/plain), 2.81 KB, created by
Kyle M Hall (khall)
on 2020-05-19 17:25:13 UTC
(
hide
)
Description:
Bug 25534: Use the cancelation reasion for the 'X' hold cancelation links
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-05-19 17:25:13 UTC
Size:
2.81 KB
patch
obsolete
>From 30da39d4f798930c854ddf7425d9f35bad061097 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 19 May 2020 13:25:00 -0400 >Subject: [PATCH] Bug 25534: Use the cancelation reasion for the 'X' hold > cancelation links > >--- > .../prog/en/modules/reserve/request.tt | 15 ++++++++++++++- > reserve/request.pl | 3 ++- > 2 files changed, 16 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 2da776f128..e48b476c8a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -951,6 +951,7 @@ > var biblionumber = "[% biblionumber | $raw %]"; > var borrowernumber = "[% patron.borrowernumber | $raw %]"; > var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); >+ var REASON_LABEL = _("Reason: "); > var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]"; > var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %] > [% itemloo.itemnumber | html %]: { >@@ -1237,7 +1238,19 @@ > > // Confirm cancelation of hold > $(".cancel-hold").on("click",function(e) { >- return confirmDelete(MSG_CONFIRM_DELETE_HOLD); >+ e.preventDefault; >+ let msg = MSG_CONFIRM_DELETE_HOLD ; >+ if ( $("#cancellation-reason").val() ) { >+ const reason = $("#cancellation-reason option:selected").text(); >+ msg += "\n\n" + REASON_LABEL + reason; >+ } >+ const confirm = confirmDelete(msg); >+ if ( confirm ) { >+ let href = $(this).attr('href'); >+ href += "&cancellation-reason=" + $("#cancellation-reason").val(); >+ window.location = href; >+ } >+ return false; > }); > > [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %] >diff --git a/reserve/request.pl b/reserve/request.pl >index 26e40dd685..be6b7d52ac 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -106,8 +106,9 @@ if ( $action eq 'move' ) { > } > } elsif ( $action eq 'cancel' ) { > my $reserve_id = $input->param('reserve_id'); >+ my $cancellation_reason = $input->param("cancellation-reason"); > my $hold = Koha::Holds->find( $reserve_id ); >- $hold->cancel if $hold; >+ $hold->cancel({ cancellation_reason => $cancellation_reason }) if $hold; > } elsif ( $action eq 'setLowestPriority' ) { > my $reserve_id = $input->param('reserve_id'); > ToggleLowestPriority( $reserve_id ); >-- >2.24.2 (Apple Git-127)
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 25534
:
105034
|
105035
|
105036
|
105077
|
105078
|
105079
|
105105
|
105106
|
105108
|
105109
|
105110
|
105111
|
105112
|
105113
|
105114
|
105115
|
105116
|
105117
|
105118
|
105119
|
105120
|
105121
|
105122
|
105147
|
105148
|
105149
|
105150
|
105151
|
108476
|
108477
|
108478
|
108479
|
108480
|
108481
|
108746
|
108747
|
108748
|
108749
|
108750
|
108751
|
108752
|
108753
|
108754
|
108755
|
108756
|
108757
|
108805
|
108806
|
108891
|
108892
|
108893
|
108894
|
108895
|
108896
|
108897
|
108898
|
108899
|
108900
|
108901
|
108902
|
108903
|
108904
|
108977
|
108985
|
108986
|
108990
|
114026
|
114027
|
114788