From 1f077c8b1e8ce34f605209b2cc2209aa62e7ac86 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Jan 2024 16:45:03 +0000 Subject: [PATCH] Bbug 35813: Add success feedback after placing/editing bookings This patch restores the lost behaviour that a successful add/edit of a booking via the 'Place booking' modal should notify the end user that the submission was sucessful. Test plan 1) Set an item as bookable to expose the 'Place booking' button 2) Place a new booking from the following pages and confirm that you now recieve feedback. * Catalog > Title > Details * Catalog > Title > MARC details * Catalog > Title > ISBD details * Catalog > Title > Item details * Catalog > Title > Bookings 3) Edit a booking on the 'Catalog > Title > Bookings' page and confirm you now recieve feedback. --- .../intranet-tmpl/prog/en/modules/bookings/list.tt | 1 + .../prog/en/modules/catalogue/ISBDdetail.tt | 1 + .../prog/en/modules/catalogue/MARCdetail.tt | 1 + .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 1 + .../prog/en/modules/catalogue/moredetail.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js | 10 ++++++++-- 6 files changed, 14 insertions(+), 4 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 6e0cb5e4f4d..97ef91231cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt @@ -32,6 +32,7 @@
+
[% INCLUDE 'cat-toolbar.inc' %]

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

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt index b2e706b3ca3..d9deb23895b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -47,6 +47,7 @@
+
[% INCLUDE 'cat-toolbar.inc' %]

[% IF ( unknownbiblionumber ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt index 3575bec9c7d..8efb6891e8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt @@ -54,6 +54,7 @@
The record you requested does not exist ([% biblionumber | html %]).
[% ELSE %] +
[% INCLUDE 'cat-toolbar.inc' %] [% UNLESS ( popup ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index ccdcb8ed251..0903be51aaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -91,6 +91,7 @@ [% CoceHost = Koha.Preference('CoceHost') %] [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %] +
[% INCLUDE 'cat-toolbar.inc' %] [% IF ( ocoins ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index ad312988073..0619a8b0fbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -41,11 +41,11 @@
+
+ [% INCLUDE 'cat-toolbar.inc' %]

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

- [% INCLUDE 'cat-toolbar.inc' %] -

[% title | html %]

diff --git a/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js b/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js index 4cf49eb0da5..502b80e049b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js +++ b/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js @@ -488,7 +488,10 @@ $("#placeBookingForm").on('submit', function(e) { // Update bookings counts $('.bookings_count').html(parseInt($('.bookings_count').html(), 10)+1); - + + // Set feedback + $('#transient_result').replaceWith('
'+_("Booking successfully placed")+'
'); + // Close modal $('#placeBookingModal').modal('hide'); }); @@ -539,7 +542,10 @@ $("#placeBookingForm").on('submit', function(e) { }); timeline.focus(data.booking_id); } - + + // Set feedback + $('#transient_result').replaceWith('
'+_("Booking successfully updated")+'
'); + // Close modal $('#placeBookingModal').modal('hide'); }); -- 2.43.0