Lines 161-166
if ( $op eq "edititem" || $op eq "dupeitem" ) {
Link Here
|
161 |
if ( !$item ) { |
161 |
if ( !$item ) { |
162 |
$itemnumber = undef; |
162 |
$itemnumber = undef; |
163 |
$template->param( item_doesnt_exist => 1 ); |
163 |
$template->param( item_doesnt_exist => 1 ); |
|
|
164 |
output_and_exit( $input, $cookie, $template, 'unknown_item' ) |
164 |
} |
165 |
} |
165 |
} |
166 |
} |
166 |
|
167 |
|
Lines 469-493
if ($op eq "additem") {
Link Here
|
469 |
} elsif ($op eq "edititem") { |
470 |
} elsif ($op eq "edititem") { |
470 |
#------------------------------------------------------------------------------- |
471 |
#------------------------------------------------------------------------------- |
471 |
# retrieve item if exist => then, it's a modif |
472 |
# retrieve item if exist => then, it's a modif |
472 |
$nextop = "additem"; |
473 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
473 |
if ($itemnumber) { |
474 |
$nextop = "saveitem"; |
474 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
|
|
475 |
$nextop = "saveitem"; |
476 |
} |
477 |
#------------------------------------------------------------------------------- |
475 |
#------------------------------------------------------------------------------- |
478 |
} elsif ($op eq "dupeitem") { |
476 |
} elsif ($op eq "dupeitem") { |
479 |
#------------------------------------------------------------------------------- |
477 |
#------------------------------------------------------------------------------- |
480 |
# retrieve item if exist => then, it's a modif |
478 |
# retrieve item if exist => then, it's a modif |
481 |
if ($itemnumber) { |
479 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
482 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
480 |
if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { |
483 |
if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { |
481 |
my ($barcode) = |
484 |
my ($barcode) = |
482 |
C4::Barcodes::ValueBuilder::incremental::get_barcode; |
485 |
C4::Barcodes::ValueBuilder::incremental::get_barcode; |
483 |
$current_item->{barcode} = $barcode; |
486 |
$current_item->{barcode} = $barcode; |
484 |
} |
487 |
} |
485 |
else { |
488 |
else { |
486 |
$current_item->{barcode} = undef; # Don't save it! |
489 |
$current_item->{barcode} = undef; # Don't save it! |
|
|
490 |
} |
491 |
} |
487 |
} |
492 |
|
488 |
|
493 |
$nextop = "additem"; |
489 |
$nextop = "additem"; |