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:
parent
48a3db2dad
commit
a7b9e08e02
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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 ) %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue