From 5dee489dbfeb91003c0ff69d35cd89d020ad97d3 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 18 May 2022 17:38:37 -0300 Subject: [PATCH] Bug 22456: Staff interface handling This patch introduces a new tab to the 'Holds awaiting pickup' screen for holds that have cancellation requests. This can be accepted (by cancelling the hold) or rejected. To test: 1. Set circulation rules for cancellation requests, allowing them for certain item type. 2. Have some waiting holds for a patron on an item type that allows requesting cancellation. 3. Visit 'Holds awaiting pickup' => SUCCESS: No holds have cancellation requests 4. In the OPAC, on the user details, notice some holds have the ability to be requested cancellation. 5. Choose to request cancellation => SUCCESS: Request is placed, the button is disabled 6. In 'Holds awaiting pickup' you can see them 7. Play with rejecting/accepting => SUCCESS: It works! 8. Things are reflected in the OPAC side --- admin/columns_settings.yml | 31 +++++++++++++++++++ circ/waitingreserves.pl | 4 +++ .../prog/en/includes/waiting_holds.inc | 11 +++++++ .../prog/en/modules/circ/waitingreserves.tt | 31 +++++++++++++++++-- 4 files changed, 75 insertions(+), 2 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 15f53114ee..4bfc52bf7a 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1403,6 +1403,37 @@ modules: - columnname: action + holdscr: + columns: + - + columnname: checkbox + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: waiting_since + - + columnname: date_hold_placed + - + columnname: expiration_date + - + columnname: title + - + columnname: patron + - + columnname: home_library + - + columnname: current_location + - + columnname: shelving_location + - + columnname: call_number + - + columnname: copy_number + - + columnname: enumeration + - + columnname: action + overdues: circ-overdues: default_display_length: 20 diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 608fb49d3f..fac7f02d98 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -116,6 +116,8 @@ while ( my $hold = $holds->next ) { } +my $holds_with_cancellation_requests = Koha::Holds->waiting->filter_by_has_cancellation_requests; + $template->param(cancel_result => \@cancel_result) if @cancel_result; $template->param( @@ -123,6 +125,8 @@ $template->param( reservecount => scalar @reserve_loop, overloop => \@over_loop, overcount => scalar @over_loop, + cancel_reqs_count => $holds_with_cancellation_requests->count, + cancel_reqs => $holds_with_cancellation_requests, show_date => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), tab => $tab, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc index 4738e44b5e..1f7b1dcb13 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc @@ -1,3 +1,4 @@ +[% USE KohaDates %] [% USE ItemTypes %] [% USE AuthorisedValues %] @@ -8,6 +9,9 @@ [% END %] + [% IF table_name == 'holdscr' %] + + [% END %] @@ -28,6 +32,13 @@ [% END %] + [% IF table_name == 'holdscr' %] + + [% END %]
Waiting since Date hold placedDate cancellation requestedExpiration date Title Patron[% reserveloo.waitingdate | $KohaDates %] [% reserveloo.reservedate | $KohaDates %] + [% FOREACH cancellation_request IN reserveloo.cancellation_requests %] + [% cancellation_request.creation_date | $KohaDates %] + [% END %] + [% reserveloo.expirationdate | $KohaDates %] [% INCLUDE 'biblio-title.inc' biblio=reserveloo.biblio link = 1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt index b6e06f7bc9..b70d1f8dc5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt @@ -48,6 +48,15 @@ View all libraries [% END %] + [% IF reject_result_error %] +
+ [% IF reject_result_error.invalid_status %] +

There was a problem rejecting the cancellation request. Cannot reject an already completed cancellation request.

+ [% ELSE %] +

Some error occurred while rejecting the cancellation request. Please check the logs

+ [% END %] +
+ [% END %] [% IF ( cancel_result ) %] [% FOREACH cancel_result %] [% IF ( messagetransfert ) %] @@ -88,6 +97,11 @@ Holds waiting over [% Koha.Preference('ReservesMaxPickUpDelay') | html %] days: [% overcount | html %] +
  • + + Holds with cancellation requests: [% cancel_reqs_count | html %] + +
  • @@ -125,6 +139,13 @@
    No holds found.
    [% END %]
    +
    + [% IF cancel_reqs_count %] + [% INCLUDE waiting_holds.inc select_column='1' table_name='holdscr' reserveloop=cancel_reqs tab='holdscr' %] + [% ELSE %] +
    No holds found.
    + [% END %] +
    [% END %] @@ -180,8 +201,9 @@ [% INCLUDE 'columns_settings.inc' %]