From d9312b31b2f02fc6792127e13b3cfbcd6627c656 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 15 Aug 2025 16:09:43 +0000 Subject: [PATCH] Bug 36789: (follow-up) Adjust bookings/list.tt to handle bookings completed status - Add fa-check-circle as an icon to "Transform to checkout" button - Remove unncessary booking_id input, placeholder and value in format call. - Include completed in - editable property of vis-timeline - filters array of additional filters include - init call to AdditionalFilters lib - onChange handler of AdditionalFilters lib - condition for rendering actions Signed-off-by: Martin Renvoize --- .../prog/en/modules/bookings/list.tt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt index 796308b53ea..509c80e491c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt @@ -41,7 +41,7 @@

Bookings for [% INCLUDE 'biblio-title-head.inc' %]

- [% INCLUDE 'additional-filters.inc' filters = [ { id = 'filter-expired', label_show = t('Include expired'), label_hide = t('Exclude expired') }, { id = 'filter-cancelled', label_show = t('Include cancelled'), label_hide = t('Exclude cancelled') }, ] filter_class = 'bookings' %] + [% INCLUDE 'additional-filters.inc' filters = [ { id = 'filter-expired', label_show = t('Include expired'), label_hide = t('Exclude expired') }, { id = 'filter-cancelled', label_show = t('Include cancelled'), label_hide = t('Exclude cancelled') }, { id = 'filter-completed', label_show = t('Include completed'), label_hide = t('Exclude completed') },] filter_class = 'bookings' %]
@@ -117,7 +117,7 @@ content: !isActive ? `${patronContent}` : patronContent, className: booking.status === "cancelled" ? "cancelled" : "", [% IF CAN_user_circulate_manage_bookings %] - editable: booking.status !== "cancelled" ? { remove: true, updateTime: true } : false, + editable: !["cancelled", "completed"].includes(booking.status) ? { remove: true, updateTime: true } : false, [% ELSE %] editable: false, [% END %] @@ -202,7 +202,7 @@ } ); - const additional_filters = AdditionalFilters.init(["filter-expired", "filter-cancelled"]) + const additional_filters = AdditionalFilters.init(["filter-expired", "filter-cancelled", "filter-completed"]) .onChange((filters, { anyFiltersNotApplied }) => { bookings_table.DataTable().ajax.reload(); }) @@ -219,6 +219,9 @@ if (isNotApplied(filters['filter-cancelled'])) { filtered.push("cancelled"); } + if (isNotApplied(filters['filter-completed'])) { + filtered.push("completed"); + } return { "-in": filtered }; } }); @@ -360,7 +363,7 @@ "orderable": false, "render": function(data, type, row, meta) { let result = ""; - const is_readonly = row.status === "cancelled"; + const is_readonly = ["cancelled", "completed"].includes(row.status); [% IF CAN_user_circulate_manage_bookings %] if (!is_readonly) { result += ` @@ -408,9 +411,8 @@ - `.format( @@ -418,7 +420,6 @@ escape_str(row.patron_id), escape_str(row.item.external_id), escape_str(row.end_date), - escape_str(row.booking_id), _("Transform to checkout") ); } -- 2.51.0