From 31af594bb0b2e00ceb07c655059a59e62ed7ebdf Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Sun, 18 Feb 2024 17:25:33 +0000 Subject: [PATCH] Bug 33737: Fix undefined variable issues This patch resolves the undefined bookings_table variable issue reported and also further fixes a subsequent undefined timeline bug that was exposed by the original fix. Signed-off-by: Esther Melander Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 4 +--- koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index e468079c1e..cef6bfb483 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -759,6 +759,7 @@ table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %] table_settings_holds_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'holds-table', 'json' ) | $raw %] + var bookings_table; $(document).ready(function() { $("#info_digests").tooltip(); @@ -778,7 +779,6 @@ }); // Bookings - var bookings_table; // Load bookings table on tab selection $("#bookings-tab").on( "click", function(){ if ( !bookings_table ) { @@ -858,8 +858,6 @@ }, [], 0, { patron_id: "[% patron.borrowernumber | html %]", end_date: { ">=": today.toISOString() } }); }; }); - // Bookings - }); function uncheck_sibling(me){ diff --git a/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js index 3b325f0fc5..03c9e0b83b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js @@ -20,7 +20,7 @@ $("#cancelBookingForm").on('submit', function(e) { if (bookings_table) { bookings_table.api().ajax.reload(); } - if (timeline) { + if (typeof timeline !== 'undefined') { timeline.itemsData.remove(Number(booking_id)); } $('.bookings_count').html(parseInt($('.bookings_count').html(), 10)-1); -- 2.39.5