From 34488eb7ae5865d12f8d4d7ac6ea38af33e35668 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 --- 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 980153fe305..dafd77ab889 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 7f7fceb0b70..e04674a086c 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -2391,6 +2391,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 %]" @@ -2401,5 +2402,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.34.1