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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/bookings-table.inc (+75 lines)
Line 0 Link Here
1
[% USE Branches %]
2
[% USE ItemTypes %]
3
[% USE KohaDates %]
4
[% PROCESS 'i18n.inc' %]
5
6
<table id="opac-user-bookings-table" class="table table-bordered table-striped">
7
    <caption>Bookings <span class="count">([% BOOKINGS.count | html %] total)</span></caption>
8
    <thead>
9
        <tr>
10
            <th class="all anti-the">Title</th>
11
            <th class="psort">Placed on</th>
12
            <th class="psort">Pickup location</th>
13
            <th class="psort">Start date</th>
14
            <th class="psort">End date</th>
15
            <th class="psort">Item type</th>
16
            <th class="psort">Barcode</th>
17
            <th class="psort">Provided by</th>
18
            <th class="nosort">Modify</th>
19
            <th></th>
20
        </tr>
21
    </thead>
22
    <tbody>
23
        [% FOREACH BOOKING IN BOOKINGS %]
24
            <tr>
25
                <td class="title">
26
                    [% INCLUDE 'biblio-title.inc' biblio=BOOKING.biblio link => 1 %]
27
                    [% BOOKING.item.enumchron | html %]
28
                    [% BOOKING.biblio.author | html %]
29
                </td>
30
                <td class="creation-date">
31
                    [% BOOKING.creation_date | $KohaDates %]
32
                </td>
33
                <td class="pickup-library">
34
                    [% BOOKING.pickup_library.branchname | html %]
35
                    <button type="button" class="btn btn-sm btn-link" data-bs-toggle="modal" data-bs-target="#change-pickup-location-[% BOOKING.booking_id | html %]">
36
                        <i class="fa fa-pencil-alt" aria-hidden="true"></i>&nbsp;Change
37
                    </button>
38
                    [% PROCESS 'modals/bookings.inc' action = 'change-pickup-location' %]
39
                </td>
40
                <td class="start-date">
41
                    [% BOOKING.start_date | $KohaDates %]
42
                </td>
43
                <td class="end-date">
44
                    [% BOOKING.end_date | $KohaDates %]
45
                </td>
46
                [% IF BOOKING.item %]
47
                    <td class="item-type">
48
                        [% BOOKING.item.itemtype.description %]
49
                    </td>
50
                    <td class="barcode">
51
                        [% BOOKING.item.barcode %]
52
                    </td>
53
                [% ELSE %]
54
                    <td>&ndash;</td>
55
                    <td>&ndash;</td>
56
                [% END %]
57
                <td class="branch">
58
                    [% Branches.GetName(BOOKING.item.homebranch) | html %]
59
                </td>
60
                <td class="modify">
61
                    <button
62
                        type="button"
63
                        class="btn btn-sm btn-danger btn-delete-booking"
64
                        data-bs-toggle="modal"
65
                        data-bs-target="#cancel-[% BOOKING.booking_id | html %]"
66
                    >
67
                        <i class="fa fa-times" aria-hidden="true"></i>&nbsp;[% tp('Cancel booking button', 'Cancel') | html %]
68
                    </button>
69
                    [% PROCESS 'modals/bookings.inc' action = 'cancel' %]
70
                </td>
71
                <td></td>
72
            </tr>
73
        [% END # /FOREACH HOLDS %]
74
    </tbody>
75
</table>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/bookings.inc (+93 lines)
Line 0 Link Here
1
[% USE Branches %]
2
[% SET booking_id = BOOKING.booking_id | html %]
3
4
<div class="modal" id="[% action %]-[% booking_id %]" tabindex="-1" aria-labelledby="[% action %]-[% booking_id %]-label" aria-hidden="true">
5
    <div class="modal-dialog">
6
        <form id="[% action %]-form-[% booking_id %]" action="/cgi-bin/koha/opac-bookings.pl" method="post">
7
            [% INCLUDE 'csrf-token.inc' %]
8
            <input type="hidden" name="op" value="cud-[% action.replace('-', '_') %]">
9
            <div class="modal-content">
10
                <div class="modal-header">
11
                    <h1 class="modal-title" id="[% action %]-[% booking_id %]-label">
12
                        [% SWITCH action %]
13
                            [% CASE 'change-pickup-location' %]
14
                                Change pickup location for booking of <em>[% INCLUDE 'biblio-title.inc' biblio=BOOKING.item.biblio %]</em>
15
                            [% CASE 'cancel' %]
16
                                Cancel booking of <em>[% INCLUDE 'biblio-title.inc' biblio=BOOKING.item.biblio %]</em>
17
                            [% CASE 'add' %]
18
                                Place a booking
19
                            [% CASE %]
20
                        [% END %]
21
                    </h1>
22
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
23
                </div>
24
                <div class="modal-body">
25
                    [% SWITCH action %]
26
                        [% CASE 'change-pickup-location' %]
27
                            <div class="form-group">
28
                                <label for="new-pickup-location-[% booking_id %]">New pickup location:</label>
29
                                <select name="new_pickup_location" id="new-pickup-location-[% booking_id %]" class="form-select">
30
                                    [% PROCESS options_for_libraries libraries = Branches.pickup_locations({ search_params => { biblio => BOOKING.item.biblio, patron => BOOKING.patron_id }, selected => BOOKING.pickup_library_id }) %]
31
                                </select>
32
                            </div>
33
                        [% CASE 'cancel' %]
34
                            <span>Are you sure you want to cancel your booking of <em>[% INCLUDE 'biblio-title.inc' biblio=BOOKING.item.biblio %]</em>?</span>
35
                        [% CASE 'add' %]
36
                        <!--
37
                            <input name="biblio_id">
38
                            <input name="item_id">
39
                            <input name="pickup_library_id">
40
                            <input name="start_date">
41
                            <input name="end_date">
42
                        -->
43
                            <fieldset class="brief">
44
                                <input type="hidden" name="biblio_id" id="biblio-id" value="[% biblio.biblionumber %]">
45
                                <ol>
46
                                    <li>
47
                                        <label class="required" for="pickup-library-id">Pickup at:</label>
48
                                        <select name="pickup_library_id" id="pickup-library-id" required>
49
                                            <option selected>Please select a pickup location</option>
50
                                            [% PROCESS options_for_libraries libraries = Branches.pickup_locations({ search_params => { biblio => biblio.biblionumber, patron => logged_in_user.borrowernumber } }) %]
51
                                        </select>
52
                                        <span class="required">Required</span>
53
                                    </li>
54
                                    <label for="booking-item-id">Item: </label>
55
                                        <select name="item_id" id="booking-item-id">
56
                                            <option value="0">Any item</option>
57
                                            [% FOR item IN biblio.bookable_items %]
58
                                                <option value="[% item.itemnumber %]">[% item.barcode %]</option>
59
                                            [% END %]
60
                                        </select>
61
                                    </li>
62
                                    <li>
63
                                        <div id="period_fields">
64
                                            <label class="required" for="period">Booking dates: </label>
65
                                            <input type="text" id="period" name="period" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-disable-shortcuts="true" required autocomplete="off">
66
                                            <span class="required">Required</span>
67
                                        </div>
68
                                        <div class="hint">Select the booking start date (and end date in the next patch)</div>
69
                                    </li>
70
                                </ol>
71
                            </fieldset>
72
                        [% CASE %]
73
                    [% END %]
74
                    <input type="hidden" name="booking_id" value="[% booking_id %]" />
75
                </div>
76
                <div class="modal-footer">
77
                    <button type="submit" name="[% action.replace('-', '_') %]" value="1" class="btn btn-primary">
78
                        <i class="fa fa-check" aria-hidden="true"></i>&nbsp;
79
                        [% SWITCH action %]
80
                            [% CASE 'cancel' %]
81
                                <span>Confirm</span>
82
                            [% CASE %]
83
                                Save
84
                        [% END %]
85
                    </button>
86
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
87
                        <i class="fa fa-times" aria-hidden="true"></i>&nbsp;Cancel
88
                    </button>
89
                </div>
90
            </div> <!-- /.modal-content -->
91
        </form>
92
    </div> <!-- /.modal-dialog -->
93
</div> <!-- /.modal -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (+4 lines)
Lines 7-12 Link Here
7
                <li><a class="reserve btn btn-link btn-lg" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblio.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></li>
7
                <li><a class="reserve btn btn-link btn-lg" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblio.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></li>
8
            [% END %]
8
            [% END %]
9
        [% END %]
9
        [% END %]
10
11
        [% IF ( BookableItems ) %]
12
            <li><a class="booking btn btn-link btn-lg" href="/cgi-bin/koha/opac-bookings.pl?biblio_id=[% biblio.biblionumber | html %]"><i class="fa fa-fw fa-calendar" aria-hidden="true"></i> Place booking</a></li>
13
        [% END %]
10
    [% END %]
14
    [% END %]
11
15
12
    [% IF Koha.Preference('UseRecalls') %]
16
    [% IF Koha.Preference('UseRecalls') %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc (+9 lines)
Lines 122-127 Link Here
122
                <a href="/cgi-bin/koha/opac-shelves.pl?op=list">Lists</a></li>
122
                <a href="/cgi-bin/koha/opac-shelves.pl?op=list">Lists</a></li>
123
            [% END %]
123
            [% END %]
124
124
125
            [% IF logged_in_user.bookings.count %]
126
                [% IF ( bookingsview ) %]
127
                    <li class="active">
128
                [% ELSE %]
129
                    <li>
130
                [% END %]
131
                <a href="/cgi-bin/koha/opac-bookings.pl">Bookings ([% logged_in_user.bookings.count | html %])</a></li>
132
            [% END %]
133
125
            [% IF Koha.Preference( 'RoutingSerials' ) && logged_in_user && logged_in_user.get_routing_lists.count %]
134
            [% IF Koha.Preference( 'RoutingSerials' ) && logged_in_user && logged_in_user.get_routing_lists.count %]
126
                [% IF ( routinglistsview ) %]
135
                [% IF ( routinglistsview ) %]
127
                    <li class="active">
136
                    <li class="active">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-bookings.tt (+147 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE Branches %]
6
[% USE ItemTypes %]
7
[% USE Price %]
8
[% USE AuthorisedValues %]
9
[% USE AdditionalContents %]
10
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
11
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
12
[% SET OpacMySummaryNote = AdditionalContents.get( location => "OpacMySummaryNote", lang => lang, library => branchcode ) %]
13
14
[% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %]
15
[% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC -->
16
17
[% INCLUDE 'doc-head-open.inc' %]
18
<title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
19
[% INCLUDE 'doc-head-close.inc' %]
20
[% Asset.css("css/overdrive.css") | $raw %]
21
[% BLOCK cssinclude %][% END %]
22
</head>
23
[% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
24
[% INCLUDE 'masthead.inc' %]
25
26
<div class="main">
27
    [% WRAPPER breadcrumbs %]
28
        [% WRAPPER breadcrumb_item %]
29
            <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
30
        [% END %]
31
        [% WRAPPER breadcrumb_item bc_active= 1 %]
32
            <span>Your bookings</span>
33
        [% END %]
34
    [% END #/ WRAPPER breadcrumbs %]
35
36
    <div class="container-fluid">
37
        <div class="row">
38
            <div class="col col-lg-2 order-2 order-lg-1">
39
                <div id="navigation">
40
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
41
                </div>
42
            </div>
43
            <div class="col-md-12 col-lg-10 order-1 order-lg-2">
44
                <div id="userbookings" class="maincontent">
45
                    <h1>Your bookings</h1>
46
47
                    [% IF op == 'list' %]
48
                        <div class="toptabs">
49
                            <ul class="nav nav-tabs" id="list-tabs">
50
                                <li id="user-bookings-tab" class="nav-item">
51
                                    <a class="nav-link active" id="your-bookings" href="/cgi-bin/koha/opac-bookings.pl?op=list">Your bookings</a>
52
                                </li>
53
                            </ul>
54
                        </div> <!-- /.toptabs -->
55
                        <div class="tab-content">
56
                            <div id="toolbar" class="toolbar clearfix">
57
                                <div class="list-actions">
58
                                    <button
59
                                        type="button"
60
                                        class="btn btn-sm btn-link"
61
                                        data-bs-toggle="modal"
62
                                        data-bs-target="#add-[% BOOKING.booking_id | html %]"
63
                                    >
64
                                        <i class="fa fa-fw fa-plus" aria-hidden="true"></i>&nbsp;New booking
65
                                    </button>
66
                                    [% PROCESS 'modals/bookings.inc' action = 'add' %]
67
                                </div> <!-- / .list-actions -->
68
                            </div> <!-- / #toolbar -->
69
                            [% PROCESS 'bookings-table.inc' %]
70
                        </div>
71
                    [% END %]
72
                </div> <!-- /#userdetails -->
73
            </div> <!-- /.col-10 -->
74
        </div> <!-- /.row -->
75
    </div> <!-- /.container-fluid -->
76
</div> <!-- /#main -->
77
78
[% INCLUDE 'opac-bottom.inc' %]
79
[% BLOCK jsinclude %]
80
    [% Asset.js("js/form-submit.js") | $raw %]
81
    [% Asset.js("lib/vis-timeline/vis-timeline-graph2d.min.js") | $raw %]
82
    [% INCLUDE 'calendar.inc' %]
83
    [% INCLUDE 'datatables.inc' %]
84
85
    <script>
86
        $(document).ready(() => {
87
            const dataTable = $("#opac-user-bookings-table");
88
            const thIndex = $(dataTable).find("th.psort").index();
89
            $(dataTable)
90
                .dataTable($.extend(true, {}, dataTablesDefaults, {
91
                    "sorting": [
92
                        [thIndex, 'asc']
93
                    ],
94
                    "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
95
                    "columnDefs": [{
96
                            "targets": ["nosort"],
97
                            "sortable": false,
98
                            "searchable": false
99
                        },
100
                        {
101
                            "type": "anti-the",
102
                            "targets": ["anti-the"]
103
                        },
104
                        {
105
                            "visible": false,
106
                            "targets": ["hidden"]
107
                        },
108
                        {
109
                            "className": 'dtr-control',
110
                            "orderable": false,
111
                            "targets": -1
112
                        }
113
                    ],
114
                    "language": {
115
                        "search": "_INPUT_",
116
                        "searchPlaceholder": _("Search")
117
                    },
118
                    "autoWidth": false,
119
                    "responsive": {
120
                        details: {
121
                            type: 'column',
122
                            target: -1
123
                        }
124
                    },
125
                    buttons: [
126
                        /* Override default button set so that we can extend the options of print and csv */
127
                        'clearFilter', 'copy',
128
                        {
129
                            extend: "print",
130
                            exportOptions: {
131
                                /* Print view should show all columns (even invisible ones) unless they are .noExport */
132
                                columns: ":not(.noExport)"
133
                            }
134
                        },
135
                        {
136
                            extend: "csv",
137
                            exportOptions: {
138
                                /* CSV export should include all columns (even invisible ones) unless they are .noExport */
139
                                columns: ":not(.noExport)"
140
                            }
141
                        }
142
                    ]
143
                }));
144
        });
145
    </script>
146
147
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +12 lines)
Lines 298-303 Link Here
298
                                    <span>Holds ([% RESERVES.count | html %])</span>
298
                                    <span>Holds ([% RESERVES.count | html %])</span>
299
                                [% END %]
299
                                [% END %]
300
                            [% END %]
300
                            [% END %]
301
                            [% IF ( BOOKINGS.count ) %]
302
                                [% WRAPPER tab_item tabname= "opac-user-bookings" %]
303
                                    <span>Bookings ([% BOOKINGS.count | html %])</span>
304
                                [% END %]
305
                            [% END %]
301
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
306
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
302
                                [% WRAPPER tab_item tabname= "opac-user-recalls" %]
307
                                [% WRAPPER tab_item tabname= "opac-user-recalls" %]
303
                                    <span>Recalls ([% RECALLS.count | html %])</span>
308
                                    <span>Recalls ([% RECALLS.count | html %])</span>
Lines 843-848 Link Here
843
                                [% END # /tab_panel#opac-user-holds %]
848
                                [% END # /tab_panel#opac-user-holds %]
844
                            [% END # / #RESERVES.count %]
849
                            [% END # / #RESERVES.count %]
845
850
851
                            [% IF ( BOOKINGS.count ) %]
852
                                [% WRAPPER tab_panel tabname="opac-user-bookings" %]
853
                                    [% PROCESS 'bookings-table.inc' %]
854
                                [% END # /tab_panel#opac-user-bookings %]
855
                            [% END # / #BOOKINGS.count %]
856
846
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
857
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
847
                                [% WRAPPER tab_panel tabname="opac-user-recalls" %]
858
                                [% WRAPPER tab_panel tabname="opac-user-recalls" %]
848
                                    <table id="recalls-table" class="table table-bordered table-striped">
859
                                    <table id="recalls-table" class="table table-bordered table-striped">
Lines 1217-1223 Link Here
1217
                );
1228
                );
1218
            });
1229
            });
1219
1230
1220
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1231
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table,#opac-user-bookings-table");
1221
            dTables.each(function(){
1232
            dTables.each(function(){
1222
                var thIndex = $(this).find("th.psort").index();
1233
                var thIndex = $(this).find("th.psort").index();
1223
                $(this).on("init.dt", function() {
1234
                $(this).on("init.dt", function() {
(-)a/opac/opac-bookings.pl (+130 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use C4::Members ();
21
use C4::Auth    qw( get_template_and_user );
22
use C4::Output  qw( output_html_with_http_headers );
23
24
use Koha::Biblios   ();
25
use Koha::Booking   ();
26
use Koha::Bookings  ();
27
use Koha::DateUtils qw(dt_from_string);
28
use Koha::Patrons   ();
29
30
use CGI         qw( -utf8 );
31
use Carp        qw( croak );
32
use Digest::SHA qw( sha1_base64 );
33
use Time::HiRes qw( time );
34
35
my $query = CGI->new;
36
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
38
    {
39
        template_name => 'opac-bookings.tt',
40
        query         => $query,
41
        type          => 'opac',
42
    }
43
);
44
45
my $patron = Koha::Patrons->find($borrowernumber);
46
47
my $op = $query->param('op') // 'list';
48
if ( $op eq 'list' ) {
49
    my $bookings = Koha::Bookings->search( { patron_id => $patron->borrowernumber } )->filter_by_active;
50
    my $hash     = sha1_base64( join q{}, time, rand );
51
52
    my $biblio;
53
    my $biblio_id = $query->param('biblio_id');
54
    if ($biblio_id) {
55
        $biblio = Koha::Biblios->find($biblio_id);
56
    }
57
58
    $template->param(
59
        op      => 'list', BOOKINGS => $bookings,
60
        BOOKING => { booking_id => $hash },
61
        biblio  => $biblio,
62
    );
63
}
64
65
if ( $op eq 'cud-add' ) {
66
    my $booking = Koha::Booking->new(
67
        {
68
            patron_id         => $patron->borrowernumber,
69
            biblio_id         => $query->param('biblio_id'),
70
            item_id           => $query->param('item_id'),
71
            pickup_library_id => $query->param('pickup_library_id'),
72
            start_date        => dt_from_string( $query->param('period') ),
73
            end_date          => dt_from_string( $query->param('period') )->add( days => 7 )->truncate( to => 'day' ),
74
        }
75
    )->store;
76
77
    print $query->redirect('/cgi-bin/koha/opac-bookings.pl?op=list') or croak;
78
}
79
80
if ( $op eq 'cud-cancel' ) {
81
    my $booking_id = $query->param('booking_id');
82
    my $booking    = Koha::Bookings->find($booking_id);
83
    if ( !$booking ) {
84
        print $query->redirect('/cgi-bin/koha/errors/404.pl') or croak;
85
        exit;
86
    }
87
88
    if ( $booking->patron_id ne $patron->borrowernumber ) {
89
        print $query->redirect('/cgi-bin/koha/errors/403.pl') or croak;
90
        exit;
91
    }
92
93
    my $is_deleted = $booking->delete;
94
    if ( !$is_deleted ) {
95
        print $query->redirect('/cgi-bin/koha/errors/500.pl') or croak;
96
        exit;
97
    }
98
99
    print $query->redirect('/cgi-bin/koha/opac-user.pl?tab=opac-user-bookings') or croak;
100
}
101
102
if ( $op eq 'cud-change_pickup_location' ) {
103
    my $booking_id          = $query->param('booking_id');
104
    my $new_pickup_location = $query->param('new_pickup_location');
105
    my $booking             = Koha::Bookings->find($booking_id);
106
107
    if ( !$booking ) {
108
        print $query->redirect('/cgi-bin/koha/errors/404.pl') or croak;
109
        exit;
110
    }
111
112
    if ( $booking->patron_id ne $patron->borrowernumber ) {
113
        print $query->redirect('/cgi-bin/koha/errors/403.pl') or croak;
114
        exit;
115
    }
116
117
    my $is_updated = $booking->update( { pickup_library_id => $new_pickup_location } );
118
    if ( !$is_updated ) {
119
        print $query->redirect('/cgi-bin/koha/errors/500.pl') or croak;
120
        exit;
121
    }
122
123
    print $query->redirect('/cgi-bin/koha/opac-user.pl?tab=opac-user-bookings') or croak;
124
}
125
126
$template->param(
127
    bookingsview => 1,
128
);
129
130
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
(-)a/opac/opac-detail.pl (+3 lines)
Lines 670-675 my $holdable_items = $biblio->items->filter_by_for_hold->count; Link Here
670
# If we don't have a patron, then holdable items determines holdability
670
# If we don't have a patron, then holdable items determines holdability
671
my $can_holds_be_placed = $patron ? 0 : $holdable_items;
671
my $can_holds_be_placed = $patron ? 0 : $holdable_items;
672
672
673
my $can_bookings_be_placed = $patron ? $biblio->bookable_items->count : 0;
674
673
my ( $itemloop_has_images, $otheritemloop_has_images );
675
my ( $itemloop_has_images, $otheritemloop_has_images );
674
my $item_level_holds;
676
my $item_level_holds;
675
my $item_checkouts;
677
my $item_checkouts;
Lines 780-785 $template->param( Link Here
780
    item_checkouts           => $item_checkouts,
782
    item_checkouts           => $item_checkouts,
781
    item_level_holds         => $item_level_holds,
783
    item_level_holds         => $item_level_holds,
782
    ReservableItems          => $can_holds_be_placed,
784
    ReservableItems          => $can_holds_be_placed,
785
    BookableItems            => $can_bookings_be_placed,
783
    itemloop_has_images      => $itemloop_has_images,
786
    itemloop_has_images      => $itemloop_has_images,
784
    otheritemloop_has_images => $otheritemloop_has_images,
787
    otheritemloop_has_images => $otheritemloop_has_images,
785
);
788
);
(-)a/opac/opac-user.pl (-1 / +6 lines)
Lines 334-339 $template->param( Link Here
334
    showpriority   => $show_priority,
334
    showpriority   => $show_priority,
335
);
335
);
336
336
337
my $bookings = $patron->bookings->filter_by_active;
338
339
$template->param(
340
    BOOKINGS => $bookings,
341
);
342
337
if ( C4::Context->preference('UseRecalls') ) {
343
if ( C4::Context->preference('UseRecalls') ) {
338
    my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
344
    my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
339
    $template->param( RECALLS => $recalls );
345
    $template->param( RECALLS => $recalls );
340
- 

Return to bug 33738