From e16a346026e67596ba2907ca61e7c1cec3707173 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 29 Nov 2024 09:16:35 +0000 Subject: [PATCH] Bug 37993: Replace edi_ean link with dropdown The edi_ean page is a slim page with a single select input for selecting the appropriate library and ean. This patch replaces the link to that page with a simple select in the menu on the original page instead. --- acqui/basket.pl | 12 ++++++- .../prog/en/modules/acqui/basket.tt | 33 +++++++++++++++---- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 1a6ef3ca478..b9715babc85 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -94,7 +94,17 @@ my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); my $schema = Koha::Database->new()->schema(); my $rs = $schema->resultset('VendorEdiAccount')->search( { vendor_id => $booksellerid, } ); -$template->param( ediaccount => ($rs->count > 0)); +my $ediaccount = ( $rs->count > 0 ); +$template->param( ediaccount => $ediaccount ); +if ($ediaccount) { + my @eans = $schema->resultset('EdifactEan')->search( + {}, + { + join => 'branch', + } + ); + $template->param( eans => \@eans ); +} unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) { $template->param( 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 b7df301861d..66cbcc6419e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -110,13 +110,32 @@ [% PROCESS csv_export %] [% IF Koha.Preference('EDIFACT') && ediaccount %] -
- [% INCLUDE 'csrf-token.inc' %] - - - - -
+
+ [% IF eans.count == 1 %] +
+ [% INCLUDE 'csrf-token.inc' %] + + + + +
+ [% ELSE %] + + + [% END %] +
[% END %] [% IF ( active && books_loop ) %] -- 2.47.1