|
Lines 43-48
use C4::ClassSource qw( GetClassSources GetClassSource );
Link Here
|
| 43 |
use Koha::DateUtils qw( dt_from_string ); |
43 |
use Koha::DateUtils qw( dt_from_string ); |
| 44 |
use Koha::Items; |
44 |
use Koha::Items; |
| 45 |
use Koha::ItemTypes; |
45 |
use Koha::ItemTypes; |
|
|
46 |
use Koha::Items; |
| 46 |
use Koha::Libraries; |
47 |
use Koha::Libraries; |
| 47 |
use Koha::Patrons; |
48 |
use Koha::Patrons; |
| 48 |
use Koha::SearchEngine::Indexer; |
49 |
use Koha::SearchEngine::Indexer; |
|
Lines 84-89
sub get_item_from_barcode {
Link Here
|
| 84 |
return($result); |
85 |
return($result); |
| 85 |
} |
86 |
} |
| 86 |
|
87 |
|
|
|
88 |
sub add_item_to_volume { |
| 89 |
my ( $biblionumber, $itemnumber, $volume, $volume_description ) = @_; |
| 90 |
|
| 91 |
return unless $volume; |
| 92 |
|
| 93 |
my $volume_id; |
| 94 |
if ( $volume eq 'create' ) { |
| 95 |
my $volume = Koha::Biblio::Volume->new( |
| 96 |
{ |
| 97 |
biblionumber => $biblionumber, |
| 98 |
description => $volume_description, |
| 99 |
} |
| 100 |
)->store(); |
| 101 |
|
| 102 |
$volume_id = $volume->id; |
| 103 |
} |
| 104 |
else { |
| 105 |
$volume_id = $volume; |
| 106 |
} |
| 107 |
|
| 108 |
my $volume_item = Koha::Biblio::Volume::Item->new( |
| 109 |
{ |
| 110 |
itemnumber => $itemnumber, |
| 111 |
volume_id => $volume_id, |
| 112 |
} |
| 113 |
)->store(); |
| 114 |
} |
| 115 |
|
| 87 |
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code |
116 |
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code |
| 88 |
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript |
117 |
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript |
| 89 |
sub _increment_barcode { |
118 |
sub _increment_barcode { |
|
Lines 423-428
my $fa_barcode = $input->param('barcode');
Link Here
|
| 423 |
my $fa_branch = $input->param('branch'); |
452 |
my $fa_branch = $input->param('branch'); |
| 424 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
453 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
| 425 |
my $fa_duedatespec = $input->param('duedatespec'); |
454 |
my $fa_duedatespec = $input->param('duedatespec'); |
|
|
455 |
my $volume = $input->param('volume'); |
| 456 |
my $volume_description = $input->param('volume_description'); |
| 426 |
|
457 |
|
| 427 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
458 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
| 428 |
|
459 |
|
|
Lines 529-534
if ($op eq "additem") {
Link Here
|
| 529 |
# if barcode exists, don't create, but report The problem. |
560 |
# if barcode exists, don't create, but report The problem. |
| 530 |
unless ($exist_itemnumber) { |
561 |
unless ($exist_itemnumber) { |
| 531 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber ); |
562 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber ); |
|
|
563 |
add_item_to_volume( $oldbiblionumber, $oldbibitemnum, $volume, $volume_description ); |
| 532 |
|
564 |
|
| 533 |
# Pushing the last created item cookie back |
565 |
# Pushing the last created item cookie back |
| 534 |
if ($prefillitem && defined $record) { |
566 |
if ($prefillitem && defined $record) { |
|
Lines 628-633
if ($op eq "additem") {
Link Here
|
| 628 |
if (!$exist_itemnumber) { |
660 |
if (!$exist_itemnumber) { |
| 629 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = |
661 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = |
| 630 |
AddItemFromMarc( $record, $biblionumber, { skip_record_index => 1 } ); |
662 |
AddItemFromMarc( $record, $biblionumber, { skip_record_index => 1 } ); |
|
|
663 |
add_item_to_volume( $oldbiblionumber, $oldbibitemnum, $volume, $volume_description ); |
| 631 |
|
664 |
|
| 632 |
# We count the item only if it was really added |
665 |
# We count the item only if it was really added |
| 633 |
# That way, all items are added, even if there was some already existing barcodes |
666 |
# That way, all items are added, even if there was some already existing barcodes |
|
Lines 998-1003
foreach my $tag ( keys %{$tagslib}){
Link Here
|
| 998 |
|
1031 |
|
| 999 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
1032 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
| 1000 |
$template->param( |
1033 |
$template->param( |
|
|
1034 |
volumes => scalar Koha::Biblio::Volumes->search({ biblionumber => $biblionumber }), |
| 1001 |
biblionumber => $biblionumber, |
1035 |
biblionumber => $biblionumber, |
| 1002 |
title => $oldrecord->{title}, |
1036 |
title => $oldrecord->{title}, |
| 1003 |
author => $oldrecord->{author}, |
1037 |
author => $oldrecord->{author}, |