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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt (-26 / +59 lines)
Lines 62-67 Link Here
62
    <script>
62
    <script>
63
        dayjs.extend(window.dayjs_plugin_isSameOrBefore);
63
        dayjs.extend(window.dayjs_plugin_isSameOrBefore);
64
    </script>
64
    </script>
65
    [% Asset.js("js/additional-fields.js") | $raw %]
65
    [% Asset.js("js/modals/place_booking.js") | $raw %]
66
    [% Asset.js("js/modals/place_booking.js") | $raw %]
66
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
67
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
67
    [% Asset.js("js/combobox.js") | $raw %]
68
    [% Asset.js("js/combobox.js") | $raw %]
Lines 84-95 Link Here
84
                type: "GET",
85
                type: "GET",
85
            });
86
            });
86
            var bookings = $.ajax({
87
            var bookings = $.ajax({
87
                url: "/api/v1/biblios/%s/bookings?_per_page=-1".format(biblionumber),
88
                url: '/api/v1/biblios/%s/bookings?_per_page=-1'.format(biblionumber),
88
                headers: { "x-koha-embed": "patron" },
89
                headers: { 'x-koha-embed': ['patron', 'extended_attributes'] },
89
                dataType: "json",
90
                dataType: 'json',
90
                type: "GET",
91
                type: 'GET',
91
            });
92
            });
92
93
            var extended_attribute_types;
94
            var authorised_values;
95
            AdditionalFields.fetchAndProcessExtendedAttributes("booking")
96
                .then(types => {
97
                    extended_attribute_types = types;
98
                    const catArray = Object.values(types)
99
                        .map(attr => attr.authorised_value_category_name)
100
                        .filter(Boolean);
101
                    return AdditionalFields.fetchAndProcessAuthorizedValues(catArray);
102
                })
103
                .then(values => {
104
                    authorised_values = values;
105
                });
93
            $.when(items, bookings).then(
106
            $.when(items, bookings).then(
94
                function (items, bookings) {
107
                function (items, bookings) {
95
                    var itemsSet = new vis.DataSet([
108
                    var itemsSet = new vis.DataSet([
Lines 122-127 Link Here
122
                            pickup_library: booking.pickup_library_id,
135
                            pickup_library: booking.pickup_library_id,
123
                            start: $toDisplayDate(startServerTz),
136
                            start: $toDisplayDate(startServerTz),
124
                            end: $toDisplayDate(endServerTz),
137
                            end: $toDisplayDate(endServerTz),
138
                            extended_attributes: booking.extended_attributes,
125
                            content: !isActive ? `<s>${patronContent}</s>` : patronContent,
139
                            content: !isActive ? `<s>${patronContent}</s>` : patronContent,
126
                            className: booking.status === "cancelled" ? "cancelled" : "",
140
                            className: booking.status === "cancelled" ? "cancelled" : "",
127
                            ...(permissions.CAN_user_circulate_manage_bookings ? { editable: !["cancelled", "completed"].includes(booking.status) ? { remove: true, updateTime: true } : false } : { editable: false }),
141
                            ...(permissions.CAN_user_circulate_manage_bookings ? { editable: !["cancelled", "completed"].includes(booking.status) ? { remove: true, updateTime: true } : false } : { editable: false }),
Lines 175-200 Link Here
175
                            // set end datetime hours and minutes to the end of the day
189
                            // set end datetime hours and minutes to the end of the day
176
                            let endDate = dayjs(data.end).endOf("day");
190
                            let endDate = dayjs(data.end).endOf("day");
177
191
178
                            $("#placeBookingModal").modal(
192
                            // Get the current booking to preserve extended attributes
179
                                "show",
193
                            let currentBooking = bookingsSet.get(data.id);
180
                                $(
194
                            let extendedAttributes = currentBooking.extended_attributes || [];
181
                                    '<button data-booking="' +
195
182
                                        data.id +
196
                            $('#placeBookingModal').modal('show', $(`<button
183
                                        '"  data-biblionumber="' +
197
                                data-booking="${data.id}"
184
                                        biblionumber +
198
                                data-biblionumber="[% biblionumber | uri %]"
185
                                        '"  data-itemnumber="' +
199
                                data-itemnumber="${data.group}"
186
                                        data.group +
200
                                data-patron="${data.patron}"
187
                                        '" data-patron="' +
201
                                data-pickup_library="${data.pickup_library}"
188
                                        data.patron +
202
                                data-start_date="${startDate.toISOString()}"
189
                                        '" data-pickup_library="' +
203
                                data-end_date="${endDate.toISOString()}"
190
                                        data.pickup_library +
204
                                data-extended_attributes='${JSON.stringify(extendedAttributes.map(attribute => ({
191
                                        '" data-start_date="' +
205
                                    field_id: attribute.field_id,
192
                                        startDate.toISOString() +
206
                                    value: attribute.value
193
                                        '" data-end_date="' +
207
                                })))}'
194
                                        endDate.toISOString() +
208
                            >`));
195
                                        '">'
196
                                )
197
                            );
198
                            $("#placeBookingModal").on("hide.bs.modal", function (e) {
209
                            $("#placeBookingModal").on("hide.bs.modal", function (e) {
199
                                if (update_success) {
210
                                if (update_success) {
200
                                    update_success = 0;
211
                                    update_success = 0;
Lines 255-261 Link Here
255
                    ajax: {
266
                    ajax: {
256
                        url: bookings_table_url,
267
                        url: bookings_table_url,
257
                    },
268
                    },
258
                    embed: ["item", "patron", "pickup_library"],
269
                    embed: ["item", "patron", "pickup_library", "extended_attributes"],
259
                    columns: [
270
                    columns: [
260
                        {
271
                        {
261
                            data: "booking_id",
272
                            data: "booking_id",
Lines 365-370 Link Here
365
                                return $date(row.end_date);
376
                                return $date(row.end_date);
366
                            },
377
                            },
367
                        },
378
                        },
379
                        {
380
                            data: "extended_attributes",
381
                            title: _("Additional fields"),
382
                            searchable: false,
383
                            orderable: false,
384
                            render: function (data, type, row, meta) {
385
                                return AdditionalFields.renderExtendedAttributesValues(
386
                                    data,
387
                                    extended_attribute_types,
388
                                    authorised_values,
389
                                    row.booking_id
390
                                ).join("<br>");
391
                            },
392
                        },
368
                        {
393
                        {
369
                            data: "",
394
                            data: "",
370
                            title: _("Actions"),
395
                            title: _("Actions"),
Lines 387-392 Link Here
387
                                    data-start_date="%s"
412
                                    data-start_date="%s"
388
                                    data-end_date="%s"
413
                                    data-end_date="%s"
389
                                    data-item_type_id="%s"
414
                                    data-item_type_id="%s"
415
                                    data-extended_attributes='%s'
390
                                >
416
                                >
391
                                    <i class="fa fa-pencil" aria-hidden="true"></i> %s
417
                                    <i class="fa fa-pencil" aria-hidden="true"></i> %s
392
                                </button>
418
                                </button>
Lines 399-404 Link Here
399
                                        escape_str(row.start_date),
425
                                        escape_str(row.start_date),
400
                                        escape_str(row.end_date),
426
                                        escape_str(row.end_date),
401
                                        escape_str(row.item.item_type_id),
427
                                        escape_str(row.item.item_type_id),
428
                                        escape_str(JSON.stringify(row.extended_attributes
429
                                            .filter(attribute => attribute.record_id == row.booking_id)
430
                                            .map(attribute => ({
431
                                                field_id: attribute.field_id,
432
                                                value: attribute.value
433
                                            }))
434
                                        )),
402
                                        _("Edit")
435
                                        _("Edit")
403
                                    );
436
                                    );
404
                                    result += `
437
                                    result += `
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt (+1 lines)
Lines 87-92 Link Here
87
    [% IF Koha.Preference('EnableBooking') %]
87
    [% IF Koha.Preference('EnableBooking') %]
88
        [% INCLUDE 'calendar.inc' %]
88
        [% INCLUDE 'calendar.inc' %]
89
        [% INCLUDE 'select2.inc' %]
89
        [% INCLUDE 'select2.inc' %]
90
        [% Asset.js("js/additional-fields.js") | $raw %]
90
        [% Asset.js("js/modals/place_booking.js") | $raw %]
91
        [% Asset.js("js/modals/place_booking.js") | $raw %]
91
    [% END %]
92
    [% END %]
92
93
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (+1 lines)
Lines 211-216 Link Here
211
    [% IF Koha.Preference('EnableBooking') %]
211
    [% IF Koha.Preference('EnableBooking') %]
212
        [% INCLUDE 'calendar.inc' %]
212
        [% INCLUDE 'calendar.inc' %]
213
        [% INCLUDE 'select2.inc' %]
213
        [% INCLUDE 'select2.inc' %]
214
        [% Asset.js("js/additional-fields.js") | $raw %]
214
        [% Asset.js("js/modals/place_booking.js") | $raw %]
215
        [% Asset.js("js/modals/place_booking.js") | $raw %]
215
    [% END %]
216
    [% END %]
216
217
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+1 lines)
Lines 1735-1740 Link Here
1735
    [% Asset.js("js/browser.js") | $raw %]
1735
    [% Asset.js("js/browser.js") | $raw %]
1736
1736
1737
    [% IF Koha.Preference('EnableBooking') %]
1737
    [% IF Koha.Preference('EnableBooking') %]
1738
        [% Asset.js("js/additional-fields.js") | $raw %]
1738
        [% Asset.js("js/modals/place_booking.js") | $raw %]
1739
        [% Asset.js("js/modals/place_booking.js") | $raw %]
1739
    [% END %]
1740
    [% END %]
1740
    <script>
1741
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (+1 lines)
Lines 141-146 Link Here
141
    [% IF Koha.Preference('EnableBooking') %]
141
    [% IF Koha.Preference('EnableBooking') %]
142
        [% INCLUDE 'calendar.inc' %]
142
        [% INCLUDE 'calendar.inc' %]
143
        [% INCLUDE 'select2.inc' %]
143
        [% INCLUDE 'select2.inc' %]
144
        [% Asset.js("js/additional-fields.js") | $raw %]
144
        [% Asset.js("js/modals/place_booking.js") | $raw %]
145
        [% Asset.js("js/modals/place_booking.js") | $raw %]
145
    [% END %]
146
    [% END %]
146
147
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (+2 lines)
Lines 96-101 Link Here
96
        dayjs.extend(window.dayjs_plugin_isSameOrBefore);
96
        dayjs.extend(window.dayjs_plugin_isSameOrBefore);
97
    </script>
97
    </script>
98
    [% Asset.js("js/catalog.js") | $raw %]
98
    [% Asset.js("js/catalog.js") | $raw %]
99
    [% Asset.js("js/additional-fields.js") | $raw %]
100
    [% Asset.js("js/modals/place_booking.js") | $raw %]
99
    [% Asset.js("js/browser.js") | $raw %]
101
    [% Asset.js("js/browser.js") | $raw %]
100
102
101
    [% IF Koha.Preference('EnableBooking') %]
103
    [% IF Koha.Preference('EnableBooking') %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+2 lines)
Lines 593-598 Link Here
593
        dayjs.extend(window.dayjs_plugin_isSameOrBefore);
593
        dayjs.extend(window.dayjs_plugin_isSameOrBefore);
594
    </script>
594
    </script>
595
    [% Asset.js("js/catalog.js") | $raw %]
595
    [% Asset.js("js/catalog.js") | $raw %]
596
    [% Asset.js("js/additional-fields.js") | $raw %]
597
    [% Asset.js("js/modals/place_booking.js") | $raw %]
596
    [% Asset.js("js/browser.js") | $raw %]
598
    [% Asset.js("js/browser.js") | $raw %]
597
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
599
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
598
600
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1111-1116 Link Here
1111
    [% END %]
1111
    [% END %]
1112
    [% Asset.js("js/holds.js") | $raw %]
1112
    [% Asset.js("js/holds.js") | $raw %]
1113
    [% INCLUDE 'calendar.inc' %]
1113
    [% INCLUDE 'calendar.inc' %]
1114
    [% Asset.js("js/additional-fields.js") | $raw %]
1114
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
1115
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
1115
    [% Asset.js("js/combobox.js") | $raw %]
1116
    [% Asset.js("js/combobox.js") | $raw %]
1116
    [% INCLUDE 'js-biblio-format.inc' %]
1117
    [% INCLUDE 'js-biblio-format.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt (-2 / +33 lines)
Lines 115-120 Link Here
115
    [% INCLUDE 'datatables.inc' %]
115
    [% INCLUDE 'datatables.inc' %]
116
    [% INCLUDE 'js-biblio-format.inc' %]
116
    [% INCLUDE 'js-biblio-format.inc' %]
117
    [% INCLUDE 'js-date-format.inc' %]
117
    [% INCLUDE 'js-date-format.inc' %]
118
    [% INCLUDE 'js-patron-format.inc' %]
119
    [% Asset.js("js/additional-fields.js") | $raw %]
118
    <script>
120
    <script>
119
        let table_settings = [% TablesSettings.GetTableSettings( 'circ', 'bookings', 'bookings-to-collect', 'json' ) | $raw %];
121
        let table_settings = [% TablesSettings.GetTableSettings( 'circ', 'bookings', 'bookings-to-collect', 'json' ) | $raw %];
120
122
Lines 132-137 Link Here
132
                libraries: all_libraries,
134
                libraries: all_libraries,
133
            };
135
            };
134
        $(document).ready(function() {
136
        $(document).ready(function() {
137
            var extended_attribute_types;
138
            var authorised_values;
139
            AdditionalFields.fetchAndProcessExtendedAttributes("booking")
140
                .then(types => {
141
                    extended_attribute_types = types;
142
                    const catArray = Object.values(types)
143
                        .map(attr => attr.authorised_value_category_name)
144
                        .filter(Boolean);
145
                    return AdditionalFields.fetchAndProcessAuthorizedValues(catArray);
146
                })
147
                .then(values => {
148
                    authorised_values = values;
149
                });
135
150
136
            let additional_filters = {
151
            let additional_filters = {
137
                start_date: function() {
152
                start_date: function() {
Lines 177-183 Link Here
177
                    "item+strings",
192
                    "item+strings",
178
                    "item.checkout",
193
                    "item.checkout",
179
                    "patron",
194
                    "patron",
180
                    "pickup_library"
195
                    "pickup_library",
196
                    "extended_attributes"
181
                ],
197
                ],
182
                order: [[ 7, "asc" ]],
198
                order: [[ 7, "asc" ]],
183
                columns: [{
199
                columns: [{
Lines 273-279 Link Here
273
                    render: function(data, type, row, meta) {
289
                    render: function(data, type, row, meta) {
274
                        return $date(row.start_date) + ' - ' + $date(row.end_date);
290
                        return $date(row.start_date) + ' - ' + $date(row.end_date);
275
                    }
291
                    }
276
                }]
292
                },
293
                {
294
                    data: "extended_attributes",
295
                    title: _("Additional fields"),
296
                    searchable: false,
297
                    orderable: false,
298
                    render: function (data, type, row, meta) {
299
                        return AdditionalFields.renderExtendedAttributesValues(
300
                            data,
301
                            extended_attribute_types,
302
                            authorised_values,
303
                            row.booking_id
304
                        ).join("<br>");
305
                    },
306
                },
307
                ]
277
            }, table_settings, 1, additional_filters, filters_options);
308
            }, table_settings, 1, additional_filters, filters_options);
278
309
279
            /** Date filtering */
310
            /** Date filtering */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 829-834 Link Here
829
    [% Asset.js("js/holds.js") | $raw %]
829
    [% Asset.js("js/holds.js") | $raw %]
830
    [% INCLUDE 'calendar.inc' %]
830
    [% INCLUDE 'calendar.inc' %]
831
    [% IF Koha.Preference('EnableBooking') %]
831
    [% IF Koha.Preference('EnableBooking') %]
832
        [% Asset.js("js/additional-fields.js") | $raw %]
832
        [% Asset.js("js/cancel_booking_modal.js") | $raw %]
833
        [% Asset.js("js/cancel_booking_modal.js") | $raw %]
833
        [% Asset.js("js/tables/bookings.js") | $raw %]
834
        [% Asset.js("js/tables/bookings.js") | $raw %]
834
    [% END %]
835
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js (-3 / +39 lines)
Lines 57-62 function datesOverlap(start1, end1, start2, end2) { Link Here
57
    // Ranges overlap if neither is completely before or after the other
57
    // Ranges overlap if neither is completely before or after the other
58
    return !(e1.isBefore(s2, "day") || s1.isAfter(e2, "day"));
58
    return !(e1.isBefore(s2, "day") || s1.isAfter(e2, "day"));
59
}
59
}
60
// Initialize AdditionalFields module
61
const additionalFields = AdditionalFields.init({
62
    containerId: "booking_extended_attributes",
63
    resourceType: "booking",
64
    selectors: {
65
        repeatableFieldClass: "repeatable-field",
66
        inputClass: "extended-attribute",
67
        fieldPrefix: "extended_attributes",
68
    },
69
});
60
70
61
/**
71
/**
62
 * Check if a date falls within a date range (inclusive)
72
 * Check if a date falls within a date range (inclusive)
Lines 117-122 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
117
    let start_date = button.data("start_date");
127
    let start_date = button.data("start_date");
118
    let end_date = button.data("end_date");
128
    let end_date = button.data("end_date");
119
    let item_type_id = button.data("item_type_id");
129
    let item_type_id = button.data("item_type_id");
130
    let extended_attributes = button.data("extended_attributes");
120
131
121
    // Get booking id if this is an edit
132
    // Get booking id if this is an edit
122
    booking_id = button.data("booking");
133
    booking_id = button.data("booking");
Lines 129-134 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
129
        $("#booking_id").val("");
140
        $("#booking_id").val("");
130
    }
141
    }
131
142
143
    additionalFields
144
        .fetchExtendedAttributes("booking")
145
        .then(response =>
146
            additionalFields.renderExtendedAttributes(
147
                response,
148
                extended_attributes
149
            )
150
        );
151
132
    // Patron select2
152
    // Patron select2
133
    $("#booking_patron_id").kohaSelect({
153
    $("#booking_patron_id").kohaSelect({
134
        dropdownParent: $(".modal-content", "#placeBookingModal"),
154
        dropdownParent: $(".modal-content", "#placeBookingModal"),
Lines 423-428 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
423
                biblionumber +
443
                biblionumber +
424
                "&_per_page=-1" +
444
                "&_per_page=-1" +
425
                '&q={"status":{"-in":["new","pending","active"]}}',
445
                '&q={"status":{"-in":["new","pending","active"]}}',
446
            headers: {
447
                "x-koha-embed": ["extended_attributes"],
448
            },
426
            dataType: "json",
449
            dataType: "json",
427
            type: "GET",
450
            type: "GET",
428
        });
451
        });
Lines 2130-2136 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
2130
                    item_type_id,
2153
                    item_type_id,
2131
                    start_date,
2154
                    start_date,
2132
                    end_date,
2155
                    end_date,
2133
                    periodPicker
2156
                    periodPicker,
2157
                    extended_attributes
2134
                );
2158
                );
2135
            },
2159
            },
2136
            function (jqXHR, textStatus, errorThrown) {
2160
            function (jqXHR, textStatus, errorThrown) {
Lines 2144-2150 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
2144
            item_type_id,
2168
            item_type_id,
2145
            start_date,
2169
            start_date,
2146
            end_date,
2170
            end_date,
2147
            periodPicker
2171
            periodPicker,
2172
            extended_attributes
2148
        );
2173
        );
2149
    }
2174
    }
2150
});
2175
});
Lines 2167-2173 function setFormValues( Link Here
2167
    item_type_id,
2192
    item_type_id,
2168
    start_date,
2193
    start_date,
2169
    end_date,
2194
    end_date,
2170
    periodPicker
2195
    periodPicker,
2196
    extended_attributes
2171
) {
2197
) {
2172
    // Set itemtype first if provided (needed for edit mode before setting dates)
2198
    // Set itemtype first if provided (needed for edit mode before setting dates)
2173
    if (item_type_id) {
2199
    if (item_type_id) {
Lines 2219-2224 function setFormValues( Link Here
2219
    } else {
2245
    } else {
2220
        periodPicker.redraw();
2246
        periodPicker.redraw();
2221
    }
2247
    }
2248
2249
    // If passed extended attributes, set them
2250
    if (extended_attributes) {
2251
        additionalFields.setValues(extended_attributes);
2252
    }
2222
}
2253
}
2223
2254
2224
/**
2255
/**
Lines 2281-2286 function createTimelineItem(data) { Link Here
2281
        patron: data.patron_id,
2312
        patron: data.patron_id,
2282
        start: $toDisplayDate(startServerTz),
2313
        start: $toDisplayDate(startServerTz),
2283
        end: $toDisplayDate(endServerTz),
2314
        end: $toDisplayDate(endServerTz),
2315
        extended_attributes: additionalFields.getValues(),
2284
        content: $patron_to_html(booking_patron, {
2316
        content: $patron_to_html(booking_patron, {
2285
            display_cardnumber: true,
2317
            display_cardnumber: true,
2286
            url: false,
2318
            url: false,
Lines 2339-2344 $("#placeBookingForm").on("submit", function (e) { Link Here
2339
        pickup_library_id: $("#pickup_library_id").val(),
2371
        pickup_library_id: $("#pickup_library_id").val(),
2340
        biblio_id: $("#booking_biblio_id").val(),
2372
        biblio_id: $("#booking_biblio_id").val(),
2341
        patron_id: $("#booking_patron_id").find(":selected").val(),
2373
        patron_id: $("#booking_patron_id").find(":selected").val(),
2374
        extended_attributes: additionalFields.getValues(),
2342
    };
2375
    };
2343
2376
2344
    const payload = buildBookingPayload(
2377
    const payload = buildBookingPayload(
Lines 2433-2436 $("#placeBookingModal").on("hidden.bs.modal", function (e) { Link Here
2433
    $("#booking_start_date").val("");
2466
    $("#booking_start_date").val("");
2434
    $("#booking_end_date").val("");
2467
    $("#booking_end_date").val("");
2435
    $("#booking_id").val("");
2468
    $("#booking_id").val("");
2469
2470
    // Clear additional fields
2471
    additionalFields.clear();
2436
});
2472
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/tables/bookings.js (-2 / +31 lines)
Lines 26-38 $(document).ready(function () { Link Here
26
        };
26
        };
27
27
28
        if (!bookings_table) {
28
        if (!bookings_table) {
29
            var extended_attribute_types;
30
            var authorised_values;
31
            AdditionalFields.fetchAndProcessExtendedAttributes("booking")
32
                .then(types => {
33
                    extended_attribute_types = types;
34
                    const catArray = Object.values(types)
35
                        .map(attr => attr.authorised_value_category_name)
36
                        .filter(Boolean);
37
                    return AdditionalFields.fetchAndProcessAuthorizedValues(
38
                        catArray
39
                    );
40
                })
41
                .then(values => {
42
                    authorised_values = values;
43
                });
44
29
            var bookings_table_url = "/api/v1/bookings";
45
            var bookings_table_url = "/api/v1/bookings";
30
            bookings_table = $("#bookings_table").kohaTable(
46
            bookings_table = $("#bookings_table").kohaTable(
31
                {
47
                {
32
                    ajax: {
48
                    ajax: {
33
                        url: bookings_table_url,
49
                        url: bookings_table_url,
34
                    },
50
                    },
35
                    embed: ["biblio", "item", "patron"],
51
                    embed: ["biblio", "item", "patron", "extended_attributes"],
36
                    columns: [
52
                    columns: [
37
                        {
53
                        {
38
                            data: "booking_id",
54
                            data: "booking_id",
Lines 94-99 $(document).ready(function () { Link Here
94
                                return $date(row.end_date);
110
                                return $date(row.end_date);
95
                            },
111
                            },
96
                        },
112
                        },
113
                        {
114
                            data: "extended_attributes",
115
                            title: _("Additional fields"),
116
                            searchable: false,
117
                            orderable: false,
118
                            render: function (data, type, row, meta) {
119
                                return AdditionalFields.renderExtendedAttributesValues(
120
                                    data,
121
                                    extended_attribute_types,
122
                                    authorised_values,
123
                                    row.booking_id
124
                                ).join("<br>");
125
                            },
126
                        },
97
                        {
127
                        {
98
                            data: "",
128
                            data: "",
99
                            title: __("Actions"),
129
                            title: __("Actions"),
100
- 

Return to bug 37829