From cae4772552fa6c32112d5abf2763f154108dab66 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 21 Jun 2023 19:21:05 +0000 Subject: [PATCH] Bug 34086: Show location on detail page when there is no permenant location To test: 1. Have some items without a permanent location. 2. Go to the staff detail page. 3. In the 'Home library' column notice the span .shelvingloc is empty. 4. Add a permanent location, now the shelvingloc is populated 5. Apply patch 6. The location should now show even when there is no permenant location. Signed-off-by: Sam Lau Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit b5c6435fe8df35ef45b6cfd4cc7c4f7e7c92b52a) Signed-off-by: Martin Renvoize (cherry picked from commit ee71ace105a263ecf8ecedd846c83414a8455bab) Signed-off-by: Matt Blenkinsop --- .../prog/en/modules/catalogue/detail.tt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 6e1a89539b..ef6e9e32d9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -404,15 +404,15 @@ [% Branches.GetName(item.homebranch) | html %] - + [%# 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. %] + [% SET item_location = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) %] [% IF item.permanent_location %] [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %] [% permloc_authval | html %] - [% IF item.location AND item.location != permloc_authval AND item.location != item.permanent_location %] - ([% item.location | html %]) + [% IF item_location AND item_location != permloc_authval AND item.location != item.permanent_location %] + ([% item_location | html %]) [% END %] [% ELSE %] [% item.location | html %] -- 2.39.2