Bugzilla – Attachment 135411 Details for
Bug 22456
Allow patrons to cancel their waiting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22456: Staff interface handling
Bug-22456-Staff-interface-handling.patch (text/plain), 8.13 KB, created by
David Nind
on 2022-05-26 20:54:27 UTC
(
hide
)
Description:
Bug 22456: Staff interface handling
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-05-26 20:54:27 UTC
Size:
8.13 KB
patch
obsolete
>From 0b56e0866f6b0b2a83f56565751cb895185bf262 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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 > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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 %] > <table class="holds_table" id="[% table_name | html %]"> >@@ -8,6 +9,9 @@ > [% END %] > <th>Waiting since</th> > <th>Date hold placed</th> >+ [% IF table_name == 'holdscr' %] >+ <th>Date cancellation requested</th> >+ [% END %] > <th>Expiration date</th> > <th class="anti-the">Title</th> > <th>Patron</th> >@@ -28,6 +32,13 @@ > [% END %] > <td><span data-order="[% reserveloo.waitingdate | html %]">[% reserveloo.waitingdate | $KohaDates %]</span></td> > <td><span data-order="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %]</span></td> >+ [% IF table_name == 'holdscr' %] >+ <td> >+ [% FOREACH cancellation_request IN reserveloo.cancellation_requests %] >+ <span>[% cancellation_request.creation_date | $KohaDates %]</span> >+ [% END %] >+ </td> >+ [% END %] > <td><span data-order="[% reserveloo.expirationdate | html %]">[% reserveloo.expirationdate | $KohaDates %]</span></td> > <td> > [% 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</a></span> > [% END %] > </h2> >+ [% IF reject_result_error %] >+ <div class="error message"> >+ [% IF reject_result_error.invalid_status %] >+ <p>There was a problem rejecting the cancellation request. Cannot reject an already completed cancellation request.</p> >+ [% ELSE %] >+ <p>Some error occurred while rejecting the cancellation request. Please check the logs</p> >+ [% END %] >+ </div> >+ [% END %] > [% IF ( cancel_result ) %] > [% FOREACH cancel_result %] > [% IF ( messagetransfert ) %] >@@ -88,6 +97,11 @@ > Holds waiting over [% Koha.Preference('ReservesMaxPickUpDelay') | html %] days: [% overcount | html %] > </a> > </li> >+ <li role="presentation"> >+ <a href="#holdscr" aria-controls="holdscr" role="tab" data-toggle="tab"> >+ Holds with cancellation requests: [% cancel_reqs_count | html %] >+ </a> >+ </li> > </ul> > <div class="tab-content"> > <div role="tabpanel" class="tab-pane active" id="holdswaiting"> >@@ -125,6 +139,13 @@ > <div class="dialog message">No holds found.</div> > [% END %] > </div> >+ <div role="tabpanel" class="tab-pane" id="holdscr"> >+ [% IF cancel_reqs_count %] >+ [% INCLUDE waiting_holds.inc select_column='1' table_name='holdscr' reserveloop=cancel_reqs tab='holdscr' %] >+ [% ELSE %] >+ <div class="dialog message">No holds found.</div> >+ [% END %] >+ </div> > </div> > [% END %] > >@@ -180,8 +201,9 @@ > [% INCLUDE 'columns_settings.inc' %] > <script> > var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); >- var holdst_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %]; >- var holdso_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %]; >+ var holdst_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %]; >+ var holdso_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %]; >+ var holdscr_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdscr', 'json' ) | $raw %]; > > $(document).ready(function() { > >@@ -195,6 +217,11 @@ > "order": [[1, 'asc']] > }, holdso_table_settings); > >+ KohaTable("holdscr", { >+ "sPaginationType": "full", >+ "order": [[1, 'asc']] >+ }, holdscr_table_settings); >+ > let cancel_link; > > $("#cancelModalConfirmBtn").on("click",function(e) { >-- >2.30.2
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 22456
:
135165
|
135166
|
135167
|
135168
|
135169
|
135170
|
135171
|
135319
|
135320
|
135321
|
135322
|
135323
|
135324
|
135325
|
135326
|
135349
|
135350
|
135351
|
135352
|
135396
|
135397
|
135398
|
135399
|
135400
|
135401
|
135402
|
135403
|
135404
|
135405
|
135406
|
135407
|
135408
|
135409
|
135410
|
135411
|
135430
|
135830
|
135831
|
135832
|
135838
|
135839
|
135840
|
135841
|
135842
|
135843
|
135844
|
135845
|
135846
|
137580
|
137581
|
137582
|
137583
|
137584
|
137585
|
137586
|
137587
|
137588
|
137589
|
137591
|
138209
|
138210
|
138211
|
138212
|
138213
|
138214
|
138215
|
138216
|
138217
|
138218