Bugzilla – Attachment 122456 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.12 KB, created by
Kyle M Hall (khall)
on 2021-06-25 17:02:55 UTC
(
hide
)
Description:
Bug 26282: Show reason only if notice exists
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-06-25 17:02:55 UTC
Size:
5.12 KB
patch
obsolete
>From a8f42e950c61ea8bb53943e27e9ee6e67cd45146 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 > >--- > .../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 59f33cd2a0..c3bcb07181 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -75,6 +75,14 @@ > > <option value="del">del</option> > </select> >+ >+ [% 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 ) %] >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 34642b9fa7..2f999fb056 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -879,7 +879,7 @@ > <input type="submit" name="submit" value="Update hold(s)" /> > <fieldset id="cancellation-reason-fieldset" class="action"> > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >- [% IF hold_cancellation %] >+ [% IF hold_cancellation && 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> >@@ -921,7 +921,7 @@ > [% END %] > <fieldset> > <legend>[% Branches.GetName( b ) | html %]</legend> >- [% INCLUDE holds_table.inc holds=holds_by_branch %] >+ [% INCLUDE holds_table.inc holds=holds_by_branch cancel_notice_branches=cancel_notice_branches %] > </fieldset> > [% END # /FOREACh b %] > [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %] >@@ -1032,7 +1032,7 @@ > > <fieldset class="action"> > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] >- [% IF hold_cancellation %] >+ [% IF hold_cancellation && 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> >@@ -1092,12 +1092,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 17f52b66ea..e62b146f8e 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -769,7 +769,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'), > ); >-- >2.30.1 (Apple Git-130)
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