From 4dee997544a537d17cd855beb020940c4bf53811 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 --- 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 213e622ee25..86f24e88c0e 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -2371,6 +2371,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 %]" @@ -2381,5 +2382,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.25.1