Bugzilla – Attachment 138418 Details for
Bug 26282
Allow staff to decide if a hold cancellation notice will be sent when cancelling a hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26282: Show reason only if notice exists
Bug-26282-Show-reason-only-if-notice-exists.patch (text/plain), 5.33 KB, created by
Victor Grousset/tuxayo
on 2022-07-31 16:53:08 UTC
(
hide
)
Description:
Bug 26282: Show reason only if notice exists
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2022-07-31 16:53:08 UTC
Size:
5.33 KB
patch
obsolete
>From 1f87586c1969be9e8658ea9700abb68cd3beb3c5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 25 Jun 2021 12:53:35 -0400 >Subject: [PATCH] Bug 26282: Show reason only if notice exists > >Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > .../intranet-tmpl/prog/en/includes/holds_table.inc | 8 ++++++++ > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 10 ++++++---- > reserve/request.pl | 7 +++++++ > 3 files changed, 21 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index be1d4fe101..f3fefcc517 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -82,6 +82,14 @@ > [% END %] > </select> > [% END %] >+ >+ [% IF cancel_notice_branches.size %] >+ [% SET bc = hold.patron.branchcode %] >+ [% SET all_bc = "" %] >+ [% UNLESS cancel_notice_branches.$bc || cancel_notice_branches.$all_bc %] >+ <span class="no-notice-warning text-warning">Cancellation will not recieve a notice.</span> >+ [% END %] >+ [% END %] > </td> > [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] > [%- UNLESS hold.found -%] >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 3a1af0d1f1..3e444d2e3c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1015,7 +1015,7 @@ > <input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button> > <fieldset id="cancellation-reason-fieldset" class="action"> > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >- [% IF hold_cancellation.count %] >+ [% IF hold_cancellation.count && cancel_notice_branches.size %] > <label for="cancellation-reason">Cancellation reason: </label> > <select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason"> > <option value="">No reason given</option> >@@ -1065,7 +1065,7 @@ > <div class="holds_by_library"> > <h4>[% Branches.GetName( b ) | html %]</h4> > >- [% INCLUDE holds_table.inc holds=holds_by_branch %] >+ [% INCLUDE holds_table.inc holds=holds_by_branch cancel_notice_branches=cancel_notice_branches %] > </div> > [% END # /FOREACh b %] > [% END # /IF ( branchcodes.empty ) %] >@@ -1204,7 +1204,7 @@ > > <fieldset class="action"> > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >- [% IF hold_cancellation.count %] >+ [% IF hold_cancellation.count && cancel_notice_branches.size %] > <label for="cancellation-reason">Cancellation reason: </label> > <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason"> > <option value="">No reason given</option> >@@ -1271,12 +1271,14 @@ > $.fn.select2.defaults.set("dropdownAutoWidth", true ); > > $(document).ready(function() { >- $('#cancellation-reason-fieldset').hide(); >+ $('#cancellation-reason-fieldset, .no-notice-warning').hide(); > $('.rank-request').on('change', function() { > if ( $(".rank-request option:selected[value='del']").length ) { > $('#cancellation-reason-fieldset').show(); >+ $('.no-notice-warning').show(); > } else { > $('#cancellation-reason-fieldset').hide(); >+ $('.no-notice-warning').hide(); > } > }); > >diff --git a/reserve/request.pl b/reserve/request.pl >index 6c45a8c2c7..1bf44b5fd4 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -722,7 +722,14 @@ if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { > $template->param( reserve_in_future => 1 ); > } > >+my $cancel_notify_templates = Koha::Notice::Templates->search({ module => 'reserves', code => 'HOLD_CANCELLATION' }); >+my $cancel_notice_branches; >+while ( my $notice = $cancel_notify_templates->next ) { >+ $cancel_notice_branches->{$notice->branchcode} = 1; >+} >+ > $template->param( >+ cancel_notice_branches => $cancel_notice_branches, > SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), > AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), > borrowernumber => $borrowernumber_hold, >-- >2.37.1
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 26282
:
109286
|
113960
|
113991
|
114007
|
114008
|
114009
|
114010
|
114011
|
114012
|
114013
|
114014
|
114015
|
114016
|
114028
|
114030
|
114031
|
114032
|
114033
|
114034
|
114035
|
114247
|
114248
|
114249
|
114250
|
114251
|
114252
|
114253
|
114254
|
114255
|
114259
|
115193
|
115194
|
115195
|
115196
|
115197
|
115198
|
115199
|
115200
|
115201
|
122448
|
122449
|
122450
|
122451
|
122452
|
122453
|
122454
|
122455
|
122456
|
122550
|
138407
|
138408
|
138409
|
138410
|
138411
|
138412
|
138413
|
138414
|
138415
|
138416
|
138417
|
138418
|
138419
|
138469
|
141210
|
171577
|
171578
|
171579
|
171580
|
171581
|
171582
|
171583
|
171584
|
171585
|
171586
|
171587
|
171588
|
171589
|
171590
|
171592
|
171593