Bug 29002: Fix patron display for new bookings in timeline

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2023-08-23 11:54:19 +01:00 committed by Tomas Cohen Arazi
parent 9b9e9614d2
commit adcaee8b6d
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -406,13 +406,17 @@ $("#placeBookingForm").on('submit', function(e) {
bookings_table.api().ajax.reload();
}
if (typeof timeline !== 'undefined' && timeline !== null) {
let selected_patron = $("#booking_patron_id").select2('data')[0];
timeline.itemsData.add({
id: data.booking_id,
booking: data.booking_id,
patron: data.patron_id,
start: dayjs(data.start_date).toDate(),
end: dayjs(data.end_date).toDate(),
content: 'Booking: ' + data.booking_id,
content: $patron_to_html(selected_patron, {
display_cardnumber: true,
url: false
}),
editable: { remove: true, updateTime: true },
type: 'range',
group: data.item_id ? data.item_id : 0
@ -452,13 +456,17 @@ $("#placeBookingForm").on('submit', function(e) {
bookings_table.api().ajax.reload();
}
if (typeof timeline !== 'undefined' && timeline !== null) {
let selected_patron = $("#booking_patron_id").select2('data')[0];
timeline.itemsData.update({
id: data.booking_id,
booking: data.booking_id,
patron: data.patron_id,
start: dayjs(data.start_date).toDate(),
end: dayjs(data.end_date).toDate(),
content: 'Booking: ' + data.booking_id,
content: $patron_to_html(selected_patron, {
display_cardnumber: true,
url: false
}),
editable: { remove: true, updateTime: true },
type: 'range',
group: data.item_id ? data.item_id : 0