Bugzilla – Attachment 170083 Details for
Bug 37141
Add option to display completed bookings from patron page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table
Bug-37141-follow-up-Check-for-expired-bookings-whe.patch (text/plain), 2.82 KB, created by
David Nind
on 2024-08-06 08:19:58 UTC
(
hide
)
Description:
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-08-06 08:19:58 UTC
Size:
2.82 KB
patch
obsolete
>From 4a69bcbbaf1583751d0faced4c6241a5a22a2f09 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Mon, 5 Aug 2024 13:41:23 +0000 >Subject: [PATCH] Bug 37141: (follow-up) Check for expired bookings when > rendering bookings table > >We preserve the existing logic of this bug and add another case >for when we just encounter expired bookings. > >In that case we render the fieldset without the 'filtered' class and >determine the value of filter_expired in bookings.js by the class being set. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/en/includes/patron-detail-tabs.inc | 6 ++++++ > koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js | 4 +++- > 2 files changed, 9 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >index d831c30673..c81430d1f5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >@@ -31,6 +31,7 @@ > [% END %] > [% WRAPPER tab_item tabname="bookings" %] > [% SET bookings_count = patron.bookings.filter_by_active.count %] >+ [% SET expired_bookings_count = patron.bookings.count - bookings_count %] > <span class="bookings_count">Bookings ([% bookings_count || 0 | html %])</span> > [% END %] > [% END %] >@@ -232,6 +233,11 @@ > <a id="expired_filter" class="filtered"><i class="fa fa-bars"></i> Show expired</a> > </fieldset> > <table id="bookings_table" style="width: 100% !Important;"></table> >+ [% ELSIF ( expired_bookings_count ) %] >+ <fieldset class="action filters" style="cursor:pointer;"> >+ <a id="expired_filter"><i class="fa fa-filter"></i> Hide expired</a> >+ </fieldset> >+ <table id="bookings_table" style="width: 100% !Important;"></table> > [% ELSE %] > <p>Patron has nothing booked.</p> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js b/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js >index 22af9db15c..75bdda54b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js >@@ -2,8 +2,10 @@ > // Bookings > var bookings_table; > $(document).ready(function () { >+ // Determine whether we have a filtered list >+ let filter_expired = $("#expired_filter").hasClass('filtered'); >+ > // Load bookings table on tab selection >- let filter_expired = true; > $("#bookings-tab").on("click", function () { > let additional_filters = { > patron_id: patron_borrowernumber, >-- >2.39.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 37141
:
167934
|
168420
|
170057
|
170063
|
170064
|
170081
|
170082
|
170083
|
170088
|
170089
|
170090
|
170091