|
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 $uid = Koha::Patrons->find( $loggedinuser )->userid; |
169 |
my $uid = Koha::Patrons->find( $loggedinuser )->userid; |
|
Lines 463-482
if ($op eq "additem") {
Link Here
|
| 463 |
#------------------------------------------------------------------------------- |
471 |
#------------------------------------------------------------------------------- |
| 464 |
# retrieve item if exist => then, it's a modif |
472 |
# retrieve item if exist => then, it's a modif |
| 465 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
473 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
| 466 |
# FIXME Handle non existent item |
474 |
$nextop = "saveitem"; |
| 467 |
$nextop = "saveitem"; |
|
|
| 468 |
#------------------------------------------------------------------------------- |
475 |
#------------------------------------------------------------------------------- |
| 469 |
} elsif ($op eq "dupeitem") { |
476 |
} elsif ($op eq "dupeitem") { |
| 470 |
#------------------------------------------------------------------------------- |
477 |
#------------------------------------------------------------------------------- |
| 471 |
# retrieve item if exist => then, it's a modif |
478 |
# retrieve item if exist => then, it's a modif |
| 472 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
479 |
$current_item = Koha::Items->find($itemnumber)->unblessed; |
| 473 |
# FIXME Handle non existent item |
480 |
if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { |
| 474 |
if (C4::Context->preference('autoBarcode') eq 'incremental') { |
481 |
my ($barcode) = |
| 475 |
my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode; |
482 |
C4::Barcodes::ValueBuilder::incremental::get_barcode; |
| 476 |
$current_item->{barcode} = $barcode; |
483 |
$current_item->{barcode} = $barcode; |
| 477 |
} |
484 |
} |
| 478 |
else { |
485 |
else { |
| 479 |
$current_item->{barcode} = undef; # Don't save it! |
486 |
$current_item->{barcode} = undef; # Don't save it! |
| 480 |
} |
487 |
} |
| 481 |
|
488 |
|
| 482 |
$nextop = "additem"; |
489 |
$nextop = "additem"; |