From ddca40a5d45b3d11d520fa09a188bea7c3b4f6a7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Jun 2023 15:56:46 +0200 Subject: [PATCH] Bug 33547: Display AV descriptions instead of codes Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: BULAC - http://www.bulac.fr/ Signed-off-by: Heather Hernandez Signed-off-by: Laurence Rault Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_33547.pl | 9 +++++++-- installer/data/mysql/en/mandatory/sample_notices.yml | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_33547.pl b/installer/data/mysql/atomicupdate/bug_33547.pl index 980153fe30..dafd77ab88 100755 --- a/installer/data/mysql/atomicupdate/bug_33547.pl +++ b/installer/data/mysql/atomicupdate/bug_33547.pl @@ -14,7 +14,8 @@ return { }); } - my $notice_template = q{[%~ SET train = train_item.train ~%] + my $notice_template = q{[%~ USE AuthorisedValues ~%] +[%~ SET train = train_item.train ~%] [%~ SET item = train_item.catalogue_item ~%] Train name: [% train.name %] Sent on: [% train.sent_on | $KohaDates %] @@ -24,7 +25,11 @@ Sent on: [% train.sent_on | $KohaDates %] Item number #[% train_item.user_train_item_id %] [% FOREACH item_attribute IN train_item.attributes %] - [% item_attribute.processing_attribute.name %]: [% item_attribute.value %] + [%~ SET value = item_attribute.value ~%] + [%~ IF item_attribute.processing_attribute.type == 'authorised_value' ~%] + [%~ SET value = AuthorisedValues.GetByCode(item_attribute.processing_attribute.option_source, item_attribute.value) ~%] + [%~ END ~%] + [% item_attribute.processing_attribute.name %]: [% value %] [% END %]}; $dbh->do(q{ diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index b9ac82e621..a55ca0da08 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -2394,6 +2394,7 @@ tables: message_transport_type: print lang: default content: + - "[%~ USE AuthorisedValues ~%]" - "[%~ SET train = train_item.train ~%]" - "[%~ SET item = train_item.catalogue_item ~%]" - "Train name: [% train.name %]" @@ -2404,5 +2405,9 @@ tables: - "Item number #[% train_item.user_train_item_id %]" - "" - "[% FOREACH item_attribute IN train_item.attributes %]" - - " [% item_attribute.processing_attribute.name %]: [% item_attribute.value %]" + - " [%~ SET value = item_attribute.value ~%]" + - " [%~ IF item_attribute.processing_attribute.type == 'authorised_value' ~%]" + - " [%~ SET value = AuthorisedValues.GetByCode(item_attribute.processing_attribute.option_source, item_attribute.value) ~%]" + - " [%~ END ~%]" + - " [% item_attribute.processing_attribute.name %]: [% value %]" - "[% END %]" -- 2.39.5