Bugzilla – Attachment 185880 Details for
Bug 36789
Transform a booking into checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36789: (follow-up) Adjust bookings/list.tt to handle bookings completed status
Bug-36789-follow-up-Adjust-bookingslisttt-to-handl.patch (text/plain), 5.12 KB, created by
Martin Renvoize (ashimema)
on 2025-08-29 07:47:20 UTC
(
hide
)
Description:
Bug 36789: (follow-up) Adjust bookings/list.tt to handle bookings completed status
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-08-29 07:47:20 UTC
Size:
5.12 KB
patch
obsolete
>From d9312b31b2f02fc6792127e13b3cfbcd6627c656 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >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 <martin.renvoize@openfifth.co.uk> >--- > .../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 @@ > <h1>Bookings for [% INCLUDE 'biblio-title-head.inc' %]</h1> > <div class="page-section" id="bookings-timeline"></div> > <div class="page-section"> >- [% 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' %] > <table id="bookings_table"></table> > </div> > </div> >@@ -117,7 +117,7 @@ > content: !isActive ? `<s>${patronContent}</s>` : 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 @@ > <input type="hidden" name="borrowernumber" value="%s"/> > <input type="hidden" name="barcode" value="%s"/> > <input type="hidden" name="duedatespec" value="%s"/> >- <input type="hidden" name="booking_id" value="%s"/> > <button id="checkout_action" class="btn btn-default btn-xs" type="submit"> >- %s >+ <i class="fa fa-check-circle" aria-hidden="true"></i> %s > </button> > </form> > `.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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36789
:
166213
|
167191
|
167242
|
167246
|
167268
|
167307
|
167309
|
167311
|
167368
|
167369
|
167602
|
167906
|
167907
|
170198
|
171553
|
171554
|
171555
|
172058
|
172059
|
172060
|
176452
|
176453
|
176489
|
185472
|
185473
|
185474
|
185878
|
185879
| 185880