Lines 26-31
use C4::Auth qw( get_template_and_user haspermission );
Link Here
|
26 |
use C4::Output qw( output_html_with_http_headers ); |
26 |
use C4::Output qw( output_html_with_http_headers ); |
27 |
use C4::Circulation qw( barcodedecode ); |
27 |
use C4::Circulation qw( barcodedecode ); |
28 |
use C4::Context; |
28 |
use C4::Context; |
|
|
29 |
use C4::Acquisition qw( GetOrderFromItemnumber ); |
29 |
use MARC::File::XML; |
30 |
use MARC::File::XML; |
30 |
use List::MoreUtils qw( uniq ); |
31 |
use List::MoreUtils qw( uniq ); |
31 |
use Encode qw( encode_utf8 ); |
32 |
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 85-90
my $nextop="";
Link Here
|
85 |
my $display_items; |
88 |
my $display_items; |
86 |
|
89 |
|
87 |
my @messages; |
90 |
my @messages; |
|
|
91 |
my %linked_orders_subscriptions; |
88 |
|
92 |
|
89 |
if ( $op eq "cud-action" ) { |
93 |
if ( $op eq "cud-action" ) { |
90 |
|
94 |
|
Lines 94-101
if ( $op eq "cud-action" ) {
Link Here
|
94 |
record_ids => \@itemnumbers, |
98 |
record_ids => \@itemnumbers, |
95 |
delete_biblios => $del_records, |
99 |
delete_biblios => $del_records, |
96 |
}; |
100 |
}; |
97 |
my $job_id = |
101 |
my $job_id = Koha::BackgroundJob::BatchDeleteItem->new->enqueue($params); |
98 |
Koha::BackgroundJob::BatchDeleteItem->new->enqueue($params); |
|
|
99 |
$nextop = 'enqueued'; |
102 |
$nextop = 'enqueued'; |
100 |
$template->param( job_id => $job_id, ); |
103 |
$template->param( job_id => $job_id, ); |
101 |
} |
104 |
} |
Lines 239-244
if ($op eq "cud-show" || $op eq "show"){
Link Here
|
239 |
if (defined $biblionumber && !@itemnumbers){ |
242 |
if (defined $biblionumber && !@itemnumbers){ |
240 |
my $biblio = Koha::Biblios->find($biblionumber); |
243 |
my $biblio = Koha::Biblios->find($biblionumber); |
241 |
@itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); |
244 |
@itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); |
|
|
245 |
foreach my $itemnumber (@itemnumbers) { |
246 |
$linked_orders_subscriptions{$itemnumber} = []; |
247 |
my $order = GetOrderFromItemnumber($itemnumber); |
248 |
my $serial_id = Koha::Serial::Items->search( { itemnumber => $itemnumber } )->get_column('serialid'); |
249 |
if ($order) { |
250 |
$linked_orders_subscriptions{$itemnumber} = |
251 |
{ ordernumber => $order->{ordernumber}, basket => $order->{basketno} }; |
252 |
} |
253 |
if ($serial_id) { |
254 |
my $subscription_id = Koha::Serials->search( { serialid => $serial_id } )->get_column('subscriptionid'); |
255 |
$linked_orders_subscriptions{$itemnumber} = { subscription => $subscription_id }; |
256 |
} |
257 |
} |
242 |
} |
258 |
} |
243 |
if ( my $list = $input->param('barcodelist') ) { |
259 |
if ( my $list = $input->param('barcodelist') ) { |
244 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
260 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
Lines 291-299
if ($op eq "cud-show" || $op eq "show"){
Link Here
|
291 |
|
307 |
|
292 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
308 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
293 |
$template->param( |
309 |
$template->param( |
294 |
subfields => $subfields, |
310 |
subfields => $subfields, |
295 |
notfoundbarcodes => \@notfoundbarcodes, |
311 |
notfoundbarcodes => \@notfoundbarcodes, |
296 |
notfounditemnumbers => \@notfounditemnumbers |
312 |
notfounditemnumbers => \@notfounditemnumbers, |
|
|
313 |
linked_orders_subscriptions => \%linked_orders_subscriptions, |
297 |
); |
314 |
); |
298 |
$nextop="cud-action"; |
315 |
$nextop="cud-action"; |
299 |
$template->param( show => 1 ); |
316 |
$template->param( show => 1 ); |
300 |
- |
|
|