Lines 156-161
my ($template, $loggedinuser, $cookie)
Link Here
|
156 |
flagsrequired => {editcatalogue => $userflags}, |
156 |
flagsrequired => {editcatalogue => $userflags}, |
157 |
}); |
157 |
}); |
158 |
|
158 |
|
|
|
159 |
if ( $op eq 'edititem' || $op eq 'dupeitem' ) { |
160 |
my $item = Koha::Items->find($itemnumber); |
161 |
if ( !$item ) { |
162 |
$itemnumber = undef; |
163 |
$template->param( item_doesnt_exist => 1 ); |
164 |
output_and_exit( $input, $cookie, $template, 'unknown_item' ); |
165 |
} |
166 |
} |
159 |
|
167 |
|
160 |
# Does the user have a restricted item editing permission? |
168 |
# Does the user have a restricted item editing permission? |
161 |
my $patron = Koha::Patrons->find( $loggedinuser ); |
169 |
my $patron = Koha::Patrons->find( $loggedinuser ); |
Lines 471-490
if ($op eq "additem") {
Link Here
|
471 |
#------------------------------------------------------------------------------- |
479 |
#------------------------------------------------------------------------------- |
472 |
# retrieve item if exist => then, it's a modif |
480 |
# retrieve item if exist => then, it's a modif |
473 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
481 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
474 |
# FIXME Handle non existent item |
482 |
$nextop = "saveitem"; |
475 |
$nextop = "saveitem"; |
|
|
476 |
#------------------------------------------------------------------------------- |
483 |
#------------------------------------------------------------------------------- |
477 |
} elsif ($op eq "dupeitem") { |
484 |
} elsif ($op eq "dupeitem") { |
478 |
#------------------------------------------------------------------------------- |
485 |
#------------------------------------------------------------------------------- |
479 |
# retrieve item if exist => then, it's a modif |
486 |
# retrieve item if exist => then, it's a modif |
480 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
487 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
481 |
# FIXME Handle non existent item |
488 |
if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { |
482 |
if (C4::Context->preference('autoBarcode') eq 'incremental') { |
489 |
my ($barcode) = C4::Barcodes::ValueBuilder::incremental::get_barcode; |
483 |
my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode; |
|
|
484 |
$current_item->{barcode} = $barcode; |
490 |
$current_item->{barcode} = $barcode; |
485 |
} |
491 |
} |
486 |
else { |
492 |
else { |
487 |
$current_item->{barcode} = undef; # Don't save it! |
493 |
$current_item->{barcode} = undef; # Don't save it! |
488 |
} |
494 |
} |
489 |
|
495 |
|
490 |
$nextop = "additem"; |
496 |
$nextop = "additem"; |