Bugzilla – Attachment 171577 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: Allow staff to decide if a hold cancellation notice will be sent when cancelling a hold
Bug-26282-Allow-staff-to-decide-if-a-hold-cancella.patch (text/plain), 9.09 KB, created by
Kyle M Hall (khall)
on 2024-09-16 18:09:24 UTC
(
hide
)
Description:
Bug 26282: Allow staff to decide if a hold cancellation notice will be sent when cancelling a hold
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-09-16 18:09:24 UTC
Size:
9.09 KB
patch
obsolete
>From a8a5451d950ee5d3fbf7f87e4de054dc5243b1b6 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 28 Aug 2020 10:01:04 -0400 >Subject: [PATCH] Bug 26282: Allow staff to decide if a hold cancellation > notice will be sent when cancelling a hold > >Bug 25534 adds the option to send hold cancellation notices when a >reason was given. It would be nice if you could give a reason but still >decide not to send to the patron. > >Say the patron called and will not be able to pick up numerous holds for >some time. You cancel them all with "patron requested cancellation" but >don't want to send multiple notices. > >I could imagine a checkbox next to the reason to activate/deactivate >sending the notice. > >Test Plan: >1) Apply this patch >2) Visit each area in Koha where a hold can be canceled with a reason >3) Note the new 'Notify patron' checkbox >4) Test canceling a hold with and without this checkbox checked >5) Verify leaving it unchecked does not trigger a notice to be sent to the patron > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > C4/Reserves.pm | 3 ++- > Koha/Hold.pm | 2 +- > circ/pendingreserves.pl | 3 ++- > .../prog/en/modules/circ/pendingreserves.tt | 3 +++ > .../prog/en/modules/reserve/request.tt | 16 +++++++++++----- > reserve/modrequest.pl | 3 +++ > reserve/request.pl | 3 ++- > 7 files changed, 24 insertions(+), 9 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 729d5d0eae7..e0793084ecc 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1032,6 +1032,7 @@ sub ModReserve { > my $biblionumber = $params->{'biblionumber'}; > my $cancellation_reason = $params->{'cancellation_reason'}; > my $date = $params->{expirationdate}; >+ my $notify_patron = $params->{'notify_patron'}; > > return if defined $rank && $rank eq "n"; > >@@ -1053,7 +1054,7 @@ sub ModReserve { > my $original = C4::Context->preference('HoldsLog') ? $hold->unblessed : undef; > > if ( $rank eq "del" ) { >- $hold->cancel({ cancellation_reason => $cancellation_reason }); >+ $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $notify_patron }); > } > elsif ($hold->found && $hold->priority eq '0' && $date) { > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 1faec873ec2..f2898c8fd18 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -738,7 +738,7 @@ sub cancel { > }, undef, $self->id > ); > >- if ( $params->{cancellation_reason} ) { >+ if ( $params->{cancellation_reason} && $params->{notify_patron} ) { > my $letter = C4::Letters::GetPreparedLetter( > module => 'reserves', > letter_code => 'HOLD_CANCELLATION', >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 366d0009af7..c306bf6b8cc 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -55,7 +55,8 @@ if ( $op eq 'cud-cancel_reserve' and $reserve_id ) { > my $hold = Koha::Holds->find( $reserve_id ); > if ( $hold ) { > my $cancellation_reason = $input->param('cancellation-reason'); >- $hold->cancel({ cancellation_reason => $cancellation_reason }); >+ my $cancellation_notify_patron = $input->param('cancellation-notify-patron'); >+ $hold->cancel({ cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron }); > push @messages, { type => 'message', code => 'hold_cancelled' }; > } > } elsif ( $op =~ m|^mark_as_lost| ) { >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 701aab6dca5..3f4d741fabb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -220,6 +220,9 @@ > <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> > [% END %] > </select> >+ >+ <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/> >+ <label for="cancellation-notify-patron">Notify patron</label> > </div> > [% END %] > >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 39ed6cd9909..af7bc83928a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1264,6 +1264,9 @@ > <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> > [% END %] > </select> >+ >+ <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked/> >+ <label for="cancellation-notify-patron">Notify patron</label> > [% END %] > </fieldset> > </div> >@@ -1458,6 +1461,9 @@ > <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> > [% END %] > </select> >+ >+ <input type="checkbox" name="cancellation-notify-patron" id="cancellation-notify-patron" value="1" checked> >+ <label for="cancellation-notify-patron">Notify patron</label> > [% END %] > </fieldset> > </div> >@@ -1852,11 +1858,11 @@ > e.preventDefault; > cancel_link = $(this); > $("#cancel_modal_form #inputs").empty(); >- let reserve_id = cancel_link.data('id'); >- let biblionumber = cancel_link.data('biblionumber'); >- $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">'); >- $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">'); >- $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">'); >+ let reserve_id = cancel_link.data('id'); >+ let biblionumber = cancel_link.data('biblionumber'); >+ $("#cancel_modal_form #inputs").append('<input type="hidden" name="reserve_id" value="' + reserve_id + '">'); >+ $("#cancel_modal_form #inputs").append('<input type="hidden" name="biblionumber" value="' + biblionumber + '">'); >+ $("#cancel_modal_form #inputs").append('<input type="hidden" name="op" value="cud-cancel">'); > $('#cancelModal').modal('show'); > return false; > }); >diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl >index fbf960a5541..648fae89a46 100755 >--- a/reserve/modrequest.pl >+++ b/reserve/modrequest.pl >@@ -56,6 +56,8 @@ if( $op eq 'cud-cancelall' || $op eq 'cud-modifyall' ) { > undef $itemnumber[$i] if !$itemnumber[$i]; > my $suspend_until = $query->param( "suspend_until_" . $reserve_id[$i] ); > my $cancellation_reason = $query->param("cancellation-reason"); >+ my $cancellation_notify_patron = $query->param("cancellation-notify-patron"); >+ > my $params = { > rank => $rank[$i], > reserve_id => $reserve_id[$i], >@@ -64,6 +66,7 @@ if( $op eq 'cud-cancelall' || $op eq 'cud-modifyall' ) { > itemnumber => $itemnumber[$i], > defined $suspend_until ? ( suspend_until => $suspend_until ) : (), > cancellation_reason => $cancellation_reason, >+ notify_patron => $cancellation_notify_patron, > }; > if (C4::Context->preference('AllowHoldDateInFuture')) { > $params->{reservedate} = $reservedates[$i] || undef; >diff --git a/reserve/request.pl b/reserve/request.pl >index 5d0887764d0..3a3be57e63d 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -113,8 +113,9 @@ if ( $op eq 'cud-move' ) { > elsif ( $op eq 'cud-cancel' ) { > my $reserve_id = $input->param('reserve_id'); > my $cancellation_reason = $input->param("cancellation-reason"); >+ my $cancellation_notify_patron = $input->param("cancellation-notify-patron"); > my $hold = Koha::Holds->find($reserve_id); >- $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold; >+ $hold->cancel( { cancellation_reason => $cancellation_reason, notify_patron => $cancellation_notify_patron } ) if $hold; > } > elsif ( $op eq 'cud-setLowestPriority' ) { > my $reserve_id = $input->param('reserve_id'); >-- >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