|
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 "action" ) { |
93 |
if ( $op eq "action" ) { |
| 90 |
|
94 |
|
|
Lines 238-243
if ($op eq "show"){
Link Here
|
| 238 |
if (defined $biblionumber && !@itemnumbers){ |
242 |
if (defined $biblionumber && !@itemnumbers){ |
| 239 |
my $biblio = Koha::Biblios->find($biblionumber); |
243 |
my $biblio = Koha::Biblios->find($biblionumber); |
| 240 |
@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 |
} |
| 241 |
} |
258 |
} |
| 242 |
if ( my $list = $input->param('barcodelist') ) { |
259 |
if ( my $list = $input->param('barcodelist') ) { |
| 243 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
260 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
|
Lines 290-298
if ($op eq "show"){
Link Here
|
| 290 |
|
307 |
|
| 291 |
# 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. |
| 292 |
$template->param( |
309 |
$template->param( |
| 293 |
subfields => $subfields, |
310 |
subfields => $subfields, |
| 294 |
notfoundbarcodes => \@notfoundbarcodes, |
311 |
notfoundbarcodes => \@notfoundbarcodes, |
| 295 |
notfounditemnumbers => \@notfounditemnumbers |
312 |
notfounditemnumbers => \@notfounditemnumbers, |
|
|
313 |
linked_orders_subscriptions => \%linked_orders_subscriptions, |
| 296 |
); |
314 |
); |
| 297 |
$nextop="action" |
315 |
$nextop="action" |
| 298 |
} # -- End action="show" |
316 |
} # -- End action="show" |
| 299 |
- |
|
|