View | Details | Raw Unified | Return to bug 37993
Collapse All | Expand All

(-)a/acqui/basket.pl (-1 / +11 lines)
Lines 94-100 my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); Link Here
94
my $schema = Koha::Database->new()->schema();
94
my $schema = Koha::Database->new()->schema();
95
my $rs = $schema->resultset('VendorEdiAccount')->search(
95
my $rs = $schema->resultset('VendorEdiAccount')->search(
96
    { vendor_id => $booksellerid, } );
96
    { vendor_id => $booksellerid, } );
97
$template->param( ediaccount => ($rs->count > 0));
97
my $ediaccount = ( $rs->count > 0 );
98
$template->param( ediaccount => $ediaccount );
99
if ($ediaccount) {
100
    my @eans = $schema->resultset('EdifactEan')->search(
101
        {},
102
        {
103
            join => 'branch',
104
        }
105
    );
106
    $template->param( eans => \@eans );
107
}
98
108
99
unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
109
unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
100
    $template->param(
110
    $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-8 / +26 lines)
Lines 110-122 Link Here
110
                                        [% PROCESS csv_export %]
110
                                        [% PROCESS csv_export %]
111
111
112
                                        [% IF Koha.Preference('EDIFACT') && ediaccount %]
112
                                        [% IF Koha.Preference('EDIFACT') && ediaccount %]
113
                                            <div class="btn-group"><form action="/cgi-bin/koha/acqui/edi_ean.pl" method="post">
113
                                            <div class="btn-group">
114
                                                [% INCLUDE 'csrf-token.inc' %]
114
                                                [% IF eans.count == 1 %]
115
                                                <input type="hidden" name="op" value="cud-ediorder" />
115
                                                    <form action="/cgi-bin/koha/acqui/basket.pl" method="post">
116
                                                <input type="hidden" name="basketno" value="[% basketno | html %]" />
116
                                                        [% INCLUDE 'csrf-token.inc' %]
117
                                                <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
117
                                                        <input type="hidden" name="op" value="cud-ediorder" />
118
                                                <button type="submit" class="btn btn-default" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</button>
118
                                                        <input type="hidden" name="basketno" value="[% basketno | html %]" />
119
                                            </form></div>
119
                                                        <input type="hidden" name="ean" value="[% eans.0 | html %]" />
120
                                                        <button type="submit" class="btn btn-default" id="ediorderbutton"><i class="fa fa-download"></i> Create EDIFACT order</button>
121
                                                    </form>
122
                                                [% ELSE %]
123
                                                    <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>
124
                                                    <ul class="dropdown-menu">
125
                                                        [% FOREACH eanacct IN eans %]
126
                                                        <li>
127
                                                        <form action="/cgi-bin/koha/acqui/basket.pl" method="post">
128
                                                            [% INCLUDE 'csrf-token.inc' %]
129
                                                            <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
130
                                                            <input type="hidden" value="cud-ediorder" name="op" />
131
                                                            <input type="hidden" name="ean" value="[% eanacct.ean | html %]">
132
                                                            <button type="submit" class="btn btn-default">[% eanacct.branch.branchname | html %] ([% eanacct.ean | html %]) [% IF eanacct.description %][[% eanacct.description | html %]][% END %]</button>
133
                                                        </form>
134
                                                        </li>
135
                                                        [% END %]
136
                                                    </ul>
137
                                                [% END %]
138
                                            </div>
120
                                        [% END %]
139
                                        [% END %]
121
140
122
                                        [% IF ( active && books_loop ) %]
141
                                        [% IF ( active && books_loop ) %]
123
- 

Return to bug 37993