Lines 25-30
use C4::Auth qw( get_template_and_user haspermission );
Link Here
|
25 |
use C4::Output qw( output_html_with_http_headers ); |
25 |
use C4::Output qw( output_html_with_http_headers ); |
26 |
use C4::Circulation qw( barcodedecode ); |
26 |
use C4::Circulation qw( barcodedecode ); |
27 |
use C4::Context; |
27 |
use C4::Context; |
|
|
28 |
use C4::Acquisition qw( GetOrderFromItemnumber ); |
28 |
use MARC::File::XML; |
29 |
use MARC::File::XML; |
29 |
use List::MoreUtils qw( uniq ); |
30 |
use List::MoreUtils qw( uniq ); |
30 |
use Encode qw( encode_utf8 ); |
31 |
use Encode qw( encode_utf8 ); |
Lines 40-45
use Koha::BackgroundJob::BatchDeleteItem;
Link Here
|
40 |
use Koha::BackgroundJob::BatchUpdateItem; |
41 |
use Koha::BackgroundJob::BatchUpdateItem; |
41 |
use Koha::UI::Form::Builder::Item; |
42 |
use Koha::UI::Form::Builder::Item; |
42 |
use Koha::UI::Table::Builder::Items; |
43 |
use Koha::UI::Table::Builder::Items; |
|
|
44 |
use Koha::Serial::Items; |
45 |
use Koha::Serials; |
43 |
|
46 |
|
44 |
my $input = CGI->new; |
47 |
my $input = CGI->new; |
45 |
my $dbh = C4::Context->dbh; |
48 |
my $dbh = C4::Context->dbh; |
Lines 89-94
my $nextop = "";
Link Here
|
89 |
my $display_items; |
92 |
my $display_items; |
90 |
|
93 |
|
91 |
my @messages; |
94 |
my @messages; |
|
|
95 |
my %linked_orders_subscriptions; |
92 |
|
96 |
|
93 |
if ( $op eq "cud-action" ) { |
97 |
if ( $op eq "cud-action" ) { |
94 |
|
98 |
|
Lines 258-264
if ( $op eq "cud-show" || $op eq "show" ) {
Link Here
|
258 |
} else { |
262 |
} else { |
259 |
if ( defined $biblionumber && !@itemnumbers ) { |
263 |
if ( defined $biblionumber && !@itemnumbers ) { |
260 |
my $biblio = Koha::Biblios->find($biblionumber); |
264 |
my $biblio = Koha::Biblios->find($biblionumber); |
261 |
@itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); |
265 |
if(!@itemnumbers) { |
|
|
266 |
@itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); |
267 |
} |
268 |
foreach my $itemnumber (@itemnumbers) { |
269 |
$linked_orders_subscriptions{$itemnumber} = []; |
270 |
my $order = GetOrderFromItemnumber($itemnumber); |
271 |
my $serial_id = Koha::Serial::Items->search( { itemnumber => $itemnumber } )->get_column('serialid'); |
272 |
if ($order) { |
273 |
$linked_orders_subscriptions{$itemnumber} = |
274 |
{ ordernumber => $order->{ordernumber}, basket => $order->{basketno} }; |
275 |
} |
276 |
if ($serial_id) { |
277 |
my $subscription_id = Koha::Serials->search( { serialid => $serial_id } )->get_column('subscriptionid'); |
278 |
$linked_orders_subscriptions{$itemnumber} = { subscription => $subscription_id }; |
279 |
} |
280 |
} |
262 |
} |
281 |
} |
263 |
if ( my $list = $input->param('barcodelist') ) { |
282 |
if ( my $list = $input->param('barcodelist') ) { |
264 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
283 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
Lines 331-339
if ( $op eq "cud-show" || $op eq "show" ) {
Link Here
|
331 |
|
350 |
|
332 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
351 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
333 |
$template->param( |
352 |
$template->param( |
334 |
subfields => $subfields, |
353 |
subfields => $subfields, |
335 |
notfoundbarcodes => \@notfoundbarcodes, |
354 |
notfoundbarcodes => \@notfoundbarcodes, |
336 |
notfounditemnumbers => \@notfounditemnumbers |
355 |
notfounditemnumbers => \@notfounditemnumbers, |
|
|
356 |
linked_orders_subscriptions => \%linked_orders_subscriptions, |
337 |
); |
357 |
); |
338 |
$nextop = "cud-action"; |
358 |
$nextop = "cud-action"; |
339 |
$template->param( show => 1 ); |
359 |
$template->param( show => 1 ); |
340 |
- |
|
|