View | Details | Raw Unified | Return to bug 37141
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc (+6 lines)
Lines 31-36 Link Here
31
            [% END %]
31
            [% END %]
32
            [% WRAPPER tab_item tabname="bookings" %]
32
            [% WRAPPER tab_item tabname="bookings" %]
33
                [% SET bookings_count = patron.bookings.filter_by_active.count %]
33
                [% SET bookings_count = patron.bookings.filter_by_active.count %]
34
                [% SET expired_bookings_count = patron.bookings.count - bookings_count %]
34
                <span class="bookings_count">Bookings ([% bookings_count || 0 | html %])</span>
35
                <span class="bookings_count">Bookings ([% bookings_count || 0 | html %])</span>
35
            [% END %]
36
            [% END %]
36
        [% END %]
37
        [% END %]
Lines 232-237 Link Here
232
                        <a id="expired_filter" class="filtered"><i class="fa fa-bars"></i> Show expired</a>
233
                        <a id="expired_filter" class="filtered"><i class="fa fa-bars"></i> Show expired</a>
233
                    </fieldset>
234
                    </fieldset>
234
                    <table id="bookings_table" style="width: 100% !Important;"></table>
235
                    <table id="bookings_table" style="width: 100% !Important;"></table>
236
                [% ELSIF ( expired_bookings_count ) %]
237
                    <fieldset class="action filters" style="cursor:pointer;">
238
                        <a id="expired_filter"><i class="fa fa-filter"></i> Hide expired</a>
239
                    </fieldset>
240
                    <table id="bookings_table" style="width: 100% !Important;"></table>
235
                [% ELSE %]
241
                [% ELSE %]
236
                    <p>Patron has nothing booked.</p>
242
                    <p>Patron has nothing booked.</p>
237
                [% END %]
243
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js (-2 / +3 lines)
Lines 2-9 Link Here
2
// Bookings
2
// Bookings
3
var bookings_table;
3
var bookings_table;
4
$(document).ready(function () {
4
$(document).ready(function () {
5
    // Determine whether we have a filtered list
6
    let filter_expired = $("#expired_filter").hasClass('filtered');
7
5
    // Load bookings table on tab selection
8
    // Load bookings table on tab selection
6
    let filter_expired = true;
7
    $("#bookings-tab").on("click", function () {
9
    $("#bookings-tab").on("click", function () {
8
        let additional_filters = {
10
        let additional_filters = {
9
            patron_id: patron_borrowernumber,
11
            patron_id: patron_borrowernumber,
10
- 

Return to bug 37141