From f7fdb496e97222105705cbe9960054b42bf036e4 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 27 Sep 2022 11:41:14 +0000 Subject: [PATCH] Bug 31632: Display multiple suggestions for record in basket In case suggestions are duplicated, allow several to be attached and display them all To test: 1 - Follow plan in previous patch to attach 2 suggestions when adding order 2 - Confirm both suggestions display after record added to basket --- acqui/basket.pl | 6 ++---- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index c028dc0219..b1ff3610dc 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -497,10 +497,8 @@ sub get_order_infos { } - my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); - $line{suggestionid} = $$suggestion{suggestionid}; - $line{surnamesuggestedby} = $$suggestion{surnamesuggestedby}; - $line{firstnamesuggestedby} = $$suggestion{firstnamesuggestedby}; + my @suggestions = Koha::Suggestions->search({ biblionumber => $line{biblionumber} })->as_list; + $line{suggestions} = \@suggestions; foreach my $key (qw(transferred_from transferred_to)) { if ($line{$key}) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 9d2687881d..e6c79ed2a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -540,10 +540,10 @@ [%- IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear | html -%] [%- ELSIF ( books_loo.copyrightdate ) %] [% books_loo.copyrightdate | html %][% END -%] [%- IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement | html %][% END -%] - [%- IF ( books_loo.suggestionid ) %] + [% FOREACH suggestion IN books_loo.suggestions %]
- Suggested by: [% books_loo.surnamesuggestedby | html %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby | html %] [% END %] - (suggestion #[% books_loo.suggestionid | html %]) + Suggested by: [% suggestion.suggester.surname | html %][% IF ( suggestion.suggester.firstname ) %], [% suggestion.suggester.firstname | html %] [% END %] + (suggestion #[% suggestion.suggestionid | html %]) [% END %]

[% IF ( books_loo.order_internalnote ) %] -- 2.30.2