From c871b26f6eaa025d15c3b82997b445407f191e53 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 23 May 2023 13:42:01 +0200 Subject: [PATCH] Bug 33568: Display the desk name for the first hold MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Owen Leonard Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi Signed-off-by: Katrin Fischer --- api/v1/swagger/paths/biblios.yaml | 1 + .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml index 95d5062f57..8e66625123 100644 --- a/api/v1/swagger/paths/biblios.yaml +++ b/api/v1/swagger/paths/biblios.yaml @@ -430,6 +430,7 @@ - first_hold - first_hold+strings - first_hold.patron + - first_hold.desk - recall - recall+strings - recall.patron 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 9151170965..b4632ecda8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -2173,7 +2173,7 @@ [%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] [%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; - let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,item_type"]; + let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk,item_type"]; [% IF Koha.Preference('LocalCoverImages') %] embed.push('cover_image_ids'); [% END %] @@ -2425,8 +2425,11 @@ if ( row.first_hold ) { if ( row.first_hold.waiting_date ) { - [%# FIXME We lost the desk name, we need an additional embed %] - nodes += '%s'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); + if ( row.first_hold.desk ) { + nodes += '%s'.format(_("Waiting at %s, %s since %s.".format(row.first_hold._strings.pickup_library_id.str, row.first_hold.desk.desk_name, $date(row.first_hold.waiting_date)))); + } else { + nodes += '%s'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); + } [% IF Koha.Preference('canreservefromotherbranches') %] if ( row.first_hold.waiting_date || row.first_hold.priority == 1 ) { let patron_to_html = $patron_to_html(row.first_hold.patron); [%# FIXME What about hide_patron_infos_if_needed?? %] -- 2.39.5