Bugzilla – Attachment 114028 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: Disable the checkbox if no reason selected
Bug-26282-Disable-the-checkbox-if-no-reason-select.patch (text/plain), 5.73 KB, created by
Jonathan Druart
on 2020-11-27 08:35:18 UTC
(
hide
)
Description:
Bug 26282: Disable the checkbox if no reason selected
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-11-27 08:35:18 UTC
Size:
5.73 KB
patch
obsolete
>From 75612e84b0450937370364a7cc5ee189be5d4c78 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 27 Nov 2020 09:31:26 +0100 >Subject: [PATCH] Bug 26282: Disable the checkbox if no reason selected > >On this bug report we want to explicitly tell the librarian than a >notice will be generate if a cancellation reason is selected. >If the new checkbox we have a situation if the checkbox is selected and >no reason selected => no notice will be generated > >This patch is not the optimal solution but answers the original need, >without string changes (today is release day...) and without too many >modifications in the code. > >Additional follow-up bug report must be opened to deal properly with >this specific use case. >--- > .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 7 ++++++- > .../intranet-tmpl/prog/en/modules/circ/pendingreserves.tt | 5 +++++ > .../intranet-tmpl/prog/en/modules/members/moremember.tt | 8 +++++++- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 7 ++++++- > 4 files changed, 24 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index c4afd39bea..92449cb58b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -970,7 +970,7 @@ > > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] > [% IF hold_cancellation %] >- <select name="cancellation-reason"> >+ <select id="cancellation-reason" name="cancellation-reason"> > <option value="">No reason given</option> > [% FOREACH reason IN hold_cancellation %] > <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> >@@ -1187,6 +1187,11 @@ > } > }); > [% END %] >+ $("#cancellation-reason").on("change", function(e){ >+ $("#cancellation-notify-patron").prop("disabled", $(this).val() == ""); >+ }); >+ $("#cancellation-reason").change(); >+ > }); > </script> > [% INCLUDE 'str/members-menu.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >index c9a04b6dff..9a64bfed70 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -323,6 +323,11 @@ > holdst.fnFilter( $(this).val(), 10 ); > }); > }); >+ >+ $("#cancellation-reason").on("change", function(e){ >+ $("#cancellation-notify-patron").prop("disabled", $(this).val() == ""); >+ }); >+ $("#cancellation-reason").change(); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index b5d042a073..d37f15bc70 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -847,7 +847,7 @@ > [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] > [% IF hold_cancellation %] > <label for="cancellation-reason">Cancellation reason:</label> >- <select name="cancellation-reason"> >+ <select id="cancellation-reason" name="cancellation-reason"> > <option value="">No reason given</option> > [% FOREACH reason IN hold_cancellation %] > <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> >@@ -998,6 +998,12 @@ > $("#picture-upload, #show-picture-upload").toggle(); > }); > >+ >+ $("#cancellation-reason").on("change", function(e){ >+ $("#cancellation-notify-patron").prop("disabled", $(this).val() == ""); >+ }); >+ $("#cancellation-reason").change(); >+ > }); > function uncheck_sibling(me){ > nodename=me.getAttribute("name"); >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 4d12fcc433..f05acbe96b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1310,7 +1310,7 @@ > if ( reason ) { > link += "&cancellation-reason=" + reason > } >- if ( notify ) { >+ if ( notify && reason != "" ) { > link += "&cancellation-notify-patron=1"; > } > window.location.href = link; >@@ -1357,6 +1357,11 @@ > stickTo: "#existing_holds", > stickyClass: "floating" > }); >+ >+ $("#modal-cancellation-reason").on("change", function(e){ >+ $("#modal-cancellation-notify-patron").prop("disabled", $(this).val() == ""); >+ }); >+ $("#modal-cancellation-reason").change(); > }); > </script> > [% END %] >-- >2.20.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