Bugzilla – Attachment 171585 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.52 KB, created by
Kyle M Hall (khall)
on 2024-09-16 18:09:53 UTC
(
hide
)
Description:
Bug 26282: Show reason only if notice exists
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-09-16 18:09:53 UTC
Size:
5.52 KB
patch
obsolete
>From 5b92b6ecde498bdd321ea0940bd8bd3bb363d572 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 | 10 ++++++++++ > 3 files changed, 24 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 26edf3bf79c..1f40b662a32 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -93,6 +93,14 @@ > <input type="hidden" name="rank-request" class="rank-request" value="[% hold.priority | html %]" data-hold-id="[% hold.reserve_id | html %]"> > [% hold.priority | html %] > [% 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 af7bc83928a..88e9496f7ad 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1256,7 +1256,7 @@ > </div> > <fieldset id="cancellation-reason-fieldset" class="action" style="display:none"> > [% 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> >@@ -1307,7 +1307,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 ) %] >@@ -1453,7 +1453,7 @@ > <div id="cancel_hold_alert" class="alert alert-danger" style="display:none;"></div> > <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="modal-cancellation-reason"> > <option value="">No reason given</option> >@@ -1537,12 +1537,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 3a3be57e63d..fda2dff115d 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -726,6 +726,16 @@ $template->param(borrowernumber => $borrowernumber_hold); > > $template->param( failed_holds => \@failed_holds ); > >+# Show hold cancelation reason only if notice exists >+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, >+); >+ > # printout the page > output_html_with_http_headers $input, $cookie, $template->output; > >-- >2.39.3 (Apple Git-146)
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