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.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7454a1d380)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Martin Renvoize 2024-11-29 09:16:35 +00:00 committed by Paul Derscheid
parent 48a3db2dad
commit a7b9e08e02
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
2 changed files with 37 additions and 8 deletions

View File

@ -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(

View File

@ -110,13 +110,32 @@
[% PROCESS csv_export %]
[% IF Koha.Preference('EDIFACT') && ediaccount %]
<div class="btn-group"><form action="/cgi-bin/koha/acqui/edi_ean.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-ediorder" />
<input type="hidden" name="basketno" value="[% basketno | html %]" />
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<button type="submit" class="btn btn-default" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</button>
</form></div>
<div class="btn-group">
[% IF eans.count == 1 %]
<form action="/cgi-bin/koha/acqui/basket.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-ediorder" />
<input type="hidden" name="basketno" value="[% basketno | html %]" />
<input type="hidden" name="ean" value="[% eans.0 | html %]" />
<button type="submit" class="btn btn-default" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</button>
</form>
[% ELSE %]
<button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</button>
<ul class="dropdown-menu">
[% FOREACH eanacct IN eans %]
<li>
<form action="/cgi-bin/koha/acqui/basket.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
<input type="hidden" value="cud-ediorder" name="op" />
<input type="hidden" name="ean" value="[% eanacct.ean | html %]">
<button type="submit" class="btn btn-default">[% eanacct.branch.branchname | html %] ([% eanacct.ean | html %]) [% IF eanacct.description %][[% eanacct.description | html %]][% END %]</button>
</form>
</li>
[% END %]
</ul>
[% END %]
</div>
[% END %]
[% IF ( active && books_loop ) %]