From 4d6048e56961c24518d73f0ceba1a4032e5ede7f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Apr 2023 09:44:16 +0200 Subject: [PATCH] Bug 33568: Shelving location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 --- .../prog/en/modules/catalogue/detail.tt | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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 7b71caeaa83..f850a1df93b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -2487,9 +2487,9 @@ }); [% END %] - const can_edit_items_from = [% To.json(can_edit_items_from) | $raw %]; const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %]; + const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib])); let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; let embed = ["+strings"]; [% IF Koha.Preference('LocalCoverImages') %] @@ -2577,9 +2577,23 @@ searchable: true, orderable: true, render: function (data, type, row, meta) { - return row._strings.home_library_id.str; + let nodes = '%s'.format(row._strings.home_library_id.str); + nodes += '' + [%# If permanent location is defined, show description or code and + display current location in parentheses. If not, display current location. + Note that permanent location is a code, and location may be an authval. + %] + + let loc_str = row._strings.location.str; + if ( row.permanent_location && row.permanent_location != row.location ) { + let permanent_loc_str = av_loc[row.permanent_location]; + nodes += '%s (%s)'.format(permanent_loc_str, loc_str); + } else { + nodes += loc_str; + } + nodes += ''; + return nodes; } - // FIXME Display the shelving location }, { data: "me.collection_code", -- 2.34.1