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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt (-6 / +6 lines)
Lines 81-95 Link Here
81
    var update_success = 0;
81
    var update_success = 0;
82
    var bookings_table;
82
    var bookings_table;
83
    var timeline;
83
    var timeline;
84
    let biblionumber = "[% biblionumber | uri %]";
84
    $(document).ready(function(){
85
    $(document).ready(function(){
85
86
86
        var items = $.ajax({
87
        var items = $.ajax({
87
            url: '/api/v1/biblios/[% biblionumber | uri %]/items?bookable=1',
88
            url: '/api/v1/biblios/%s/items?bookable=1'.format(biblionumber),
88
            dataType: 'json',
89
            dataType: 'json',
89
            type: 'GET'
90
            type: 'GET'
90
        });
91
        });
91
        var bookings = $.ajax({
92
        var bookings = $.ajax({
92
            url: '/api/v1/biblios/[% biblionumber | uri %]/bookings?_per_page=-1',
93
            url: '/api/v1/biblios/%s/bookings?_per_page=-1'.format(biblionumber),
93
            headers: { 'x-koha-embed': 'patron' },
94
            headers: { 'x-koha-embed': 'patron' },
94
            dataType: 'json',
95
            dataType: 'json',
95
            type: 'GET',
96
            type: 'GET',
Lines 217-223 Link Here
217
            }
218
            }
218
        };
219
        };
219
220
220
        var bookings_table_url = "/api/v1/biblios/[% biblionumber | uri %]/bookings";
221
        var bookings_table_url = "/api/v1/biblios/%s/bookings".format(biblionumber);
221
        bookings_table = $('#bookings_table').kohaTable({
222
        bookings_table = $('#bookings_table').kohaTable({
222
            "ajax": {
223
            "ajax": {
223
                "url": bookings_table_url
224
                "url": bookings_table_url
Lines 310-317 Link Here
310
                "render": function(data, type, row, meta) {
311
                "render": function(data, type, row, meta) {
311
                    let result = "";
312
                    let result = "";
312
                    [% IF CAN_user_circulate_manage_bookings %]
313
                    [% IF CAN_user_circulate_manage_bookings %]
313
                    result += '<button type="button" class="btn btn-default btn-xs edit-action" data-bs-toggle="modal" data-bs-target="#placeBookingModal" data-booking="'+row.booking_id+'" data-biblionumber="[% biblionumber | uri %]" data-itemnumber="'+row.item_id+'" data-patron="'+row.patron_id+'" data-pickup_library="'+row.pickup_library_id+'" data-start_date="'+row.start_date+'" data-end_date="'+row.end_date+'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</button>';
314
                    result += '<button type="button" class="btn btn-default btn-xs edit-action" data-bs-toggle="modal" data-bs-target="#placeBookingModal" data-booking="%s" data-biblionumber="%s" data-itemnumber="%s" data-patron="%s" data-pickup_library="%s" data-start_date="%s" data-end_date="%s"><i class="fa fa-pencil" aria-hidden="true"></i> %s</button>'.format(row.booking_id, biblionumber, row.item_id,  row.patron_id, row.pickup_library_id, row.start_date, row.end_date, _("Edit"));
314
                    result += '<button type="button" class="btn btn-default btn-xs cancel-action" data-bs-toggle="modal" data-bs-target="#cancelBookingModal" data-booking="'+row.booking_id+'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Cancel")+'</button>';
315
                    result += '<button type="button" class="btn btn-default btn-xs cancel-action" data-bs-toggle="modal" data-bs-target="#cancelBookingModal" data-booking="%s"><i class="fa fa-trash" aria-hidden="true"></i> %s</button>'.format(row.booking_id, ("Cancel"));
315
                    [% END %]
316
                    [% END %]
316
                    return result;
317
                    return result;
317
                }
318
                }
318
- 

Return to bug 38147