|
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 39-44
use Koha::BackgroundJob::BatchDeleteItem;
Link Here
|
| 39 |
use Koha::BackgroundJob::BatchUpdateItem; |
40 |
use Koha::BackgroundJob::BatchUpdateItem; |
| 40 |
use Koha::UI::Form::Builder::Item; |
41 |
use Koha::UI::Form::Builder::Item; |
| 41 |
use Koha::UI::Table::Builder::Items; |
42 |
use Koha::UI::Table::Builder::Items; |
|
|
43 |
use Koha::Serial::Items; |
| 44 |
use Koha::Serials; |
| 42 |
|
45 |
|
| 43 |
my $input = CGI->new; |
46 |
my $input = CGI->new; |
| 44 |
my $dbh = C4::Context->dbh; |
47 |
my $dbh = C4::Context->dbh; |
|
Lines 87-92
my $nextop = "";
Link Here
|
| 87 |
my $display_items; |
90 |
my $display_items; |
| 88 |
|
91 |
|
| 89 |
my @messages; |
92 |
my @messages; |
|
|
93 |
my %linked_orders_subscriptions; |
| 90 |
|
94 |
|
| 91 |
if ( $op eq "cud-action" ) { |
95 |
if ( $op eq "cud-action" ) { |
| 92 |
|
96 |
|
|
Lines 232-237
if ( $op eq "cud-show" || $op eq "show" ) {
Link Here
|
| 232 |
if ( defined $biblionumber && !@itemnumbers ) { |
236 |
if ( defined $biblionumber && !@itemnumbers ) { |
| 233 |
my $biblio = Koha::Biblios->find($biblionumber); |
237 |
my $biblio = Koha::Biblios->find($biblionumber); |
| 234 |
@itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); |
238 |
@itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); |
|
|
239 |
foreach my $itemnumber (@itemnumbers) { |
| 240 |
$linked_orders_subscriptions{$itemnumber} = []; |
| 241 |
my $order = GetOrderFromItemnumber($itemnumber); |
| 242 |
my $serial_id = Koha::Serial::Items->search( { itemnumber => $itemnumber } )->get_column('serialid'); |
| 243 |
if ($order) { |
| 244 |
$linked_orders_subscriptions{$itemnumber} = |
| 245 |
{ ordernumber => $order->{ordernumber}, basket => $order->{basketno} }; |
| 246 |
} |
| 247 |
if ($serial_id) { |
| 248 |
my $subscription_id = |
| 249 |
Koha::Serials->search( { serialid => $serial_id } )->get_column('subscriptionid'); |
| 250 |
$linked_orders_subscriptions{$itemnumber} = { subscription => $subscription_id }; |
| 251 |
} |
| 252 |
} |
| 235 |
} |
253 |
} |
| 236 |
if ( my $list = $input->param('barcodelist') ) { |
254 |
if ( my $list = $input->param('barcodelist') ) { |
| 237 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
255 |
my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); |
|
Lines 295-303
if ( $op eq "cud-show" || $op eq "show" ) {
Link Here
|
| 295 |
|
313 |
|
| 296 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
314 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
| 297 |
$template->param( |
315 |
$template->param( |
| 298 |
subfields => $subfields, |
316 |
subfields => $subfields, |
| 299 |
notfoundbarcodes => \@notfoundbarcodes, |
317 |
notfoundbarcodes => \@notfoundbarcodes, |
| 300 |
notfounditemnumbers => \@notfounditemnumbers |
318 |
notfounditemnumbers => \@notfounditemnumbers, |
|
|
319 |
linked_orders_subscriptions => \%linked_orders_subscriptions, |
| 301 |
); |
320 |
); |
| 302 |
$nextop = "cud-action"; |
321 |
$nextop = "cud-action"; |
| 303 |
$template->param( show => 1 ); |
322 |
$template->param( show => 1 ); |
| 304 |
- |
|
|