Lines 462-475
if ($op eq "additem") {
Link Here
|
462 |
} elsif ($op eq "edititem") { |
462 |
} elsif ($op eq "edititem") { |
463 |
#------------------------------------------------------------------------------- |
463 |
#------------------------------------------------------------------------------- |
464 |
# retrieve item if exist => then, it's a modif |
464 |
# retrieve item if exist => then, it's a modif |
465 |
$current_item = Koha::Items->find($itemnumber)->unblessed or undef; |
465 |
if (my $item = Koha::Items->find($itemnumber)) { |
|
|
466 |
$current_item = $item->unblessed; |
467 |
} else { |
468 |
$current_item = undef; |
469 |
} |
470 |
|
466 |
$nextop = $current_item ? "saveitem" : "additem"; |
471 |
$nextop = $current_item ? "saveitem" : "additem"; |
467 |
#------------------------------------------------------------------------------- |
472 |
#------------------------------------------------------------------------------- |
468 |
} elsif ($op eq "dupeitem") { |
473 |
} elsif ($op eq "dupeitem") { |
469 |
#------------------------------------------------------------------------------- |
474 |
#------------------------------------------------------------------------------- |
470 |
# retrieve item if exist => then, it's a modif |
475 |
# retrieve item if exist => then, it's a modif |
471 |
$current_item = Koha::Items->find($itemnumber)->unblessed or undef; |
476 |
if (my $item = Koha::Items->find($itemnumber)) { |
472 |
if (!$current_item) { $nextop = "additem"; last; } |
477 |
$current_item = $item->unblessed; |
|
|
478 |
} else { |
479 |
$current_item = undef; |
480 |
} |
481 |
|
482 |
if (!$current_item) { $nextop = "additem"; return; } |
473 |
if (C4::Context->preference('autoBarcode') eq 'incremental') { |
483 |
if (C4::Context->preference('autoBarcode') eq 'incremental') { |
474 |
my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode; |
484 |
my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode; |
475 |
$current_item->{barcode} = $barcode; |
485 |
$current_item->{barcode} = $barcode; |
476 |
- |
|
|