Lines 22-50
Link Here
|
22 |
use Modern::Perl; |
22 |
use Modern::Perl; |
23 |
|
23 |
|
24 |
use CGI qw ( -utf8 ); |
24 |
use CGI qw ( -utf8 ); |
|
|
25 |
use List::MoreUtils qw/any/; |
26 |
use MARC::File::XML; |
27 |
use MIME::Base64 qw(decode_base64url encode_base64url); |
28 |
use Storable qw(thaw freeze); |
29 |
use URI::Escape; |
30 |
|
25 |
use C4::Auth; |
31 |
use C4::Auth; |
26 |
use C4::Output; |
|
|
27 |
use C4::Biblio; |
32 |
use C4::Biblio; |
28 |
use C4::Items; |
|
|
29 |
use C4::Context; |
30 |
use C4::Circulation; |
33 |
use C4::Circulation; |
31 |
use C4::Koha; |
|
|
32 |
use C4::ClassSource; |
34 |
use C4::ClassSource; |
|
|
35 |
use C4::Context; |
36 |
use C4::Items; |
37 |
use C4::Koha; |
38 |
use C4::Members; |
39 |
use C4::Output; |
40 |
use C4::Search; |
41 |
|
42 |
use Koha::Biblio::Volume::Items; |
43 |
use Koha::Biblio::Volumes; |
33 |
use Koha::DateUtils; |
44 |
use Koha::DateUtils; |
34 |
use Koha::Items; |
|
|
35 |
use Koha::ItemTypes; |
45 |
use Koha::ItemTypes; |
|
|
46 |
use Koha::Items; |
36 |
use Koha::Libraries; |
47 |
use Koha::Libraries; |
37 |
use Koha::Patrons; |
48 |
use Koha::Patrons; |
38 |
use Koha::SearchEngine::Indexer; |
49 |
use Koha::SearchEngine::Indexer; |
39 |
use List::MoreUtils qw/any/; |
|
|
40 |
use C4::Search; |
41 |
use Storable qw(thaw freeze); |
42 |
use URI::Escape; |
43 |
use C4::Members; |
44 |
|
45 |
use MARC::File::XML; |
46 |
use URI::Escape; |
47 |
use MIME::Base64 qw(decode_base64url encode_base64url); |
48 |
|
50 |
|
49 |
our $dbh = C4::Context->dbh; |
51 |
our $dbh = C4::Context->dbh; |
50 |
|
52 |
|
Lines 74-79
sub get_item_from_barcode {
Link Here
|
74 |
return($result); |
76 |
return($result); |
75 |
} |
77 |
} |
76 |
|
78 |
|
|
|
79 |
sub add_item_to_volume { |
80 |
my ( $biblionumber, $itemnumber, $volume, $volume_description ) = @_; |
81 |
|
82 |
return unless $volume; |
83 |
|
84 |
my $volume_id; |
85 |
if ( $volume eq 'create' ) { |
86 |
my $volume = Koha::Biblio::Volume->new( |
87 |
{ |
88 |
biblionumber => $biblionumber, |
89 |
description => $volume_description, |
90 |
} |
91 |
)->store(); |
92 |
|
93 |
$volume_id = $volume->id; |
94 |
} |
95 |
else { |
96 |
$volume_id = $volume; |
97 |
} |
98 |
|
99 |
my $volume_item = Koha::Biblio::Volume::Item->new( |
100 |
{ |
101 |
itemnumber => $itemnumber, |
102 |
volume_id => $volume_id, |
103 |
} |
104 |
)->store(); |
105 |
} |
106 |
|
77 |
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code |
107 |
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code |
78 |
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript |
108 |
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript |
79 |
sub _increment_barcode { |
109 |
sub _increment_barcode { |
Lines 412-417
my $fa_barcode = $input->param('barcode');
Link Here
|
412 |
my $fa_branch = $input->param('branch'); |
442 |
my $fa_branch = $input->param('branch'); |
413 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
443 |
my $fa_stickyduedate = $input->param('stickyduedate'); |
414 |
my $fa_duedatespec = $input->param('duedatespec'); |
444 |
my $fa_duedatespec = $input->param('duedatespec'); |
|
|
445 |
my $volume = $input->param('volume'); |
446 |
my $volume_description = $input->param('volume_description'); |
415 |
|
447 |
|
416 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
448 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
417 |
|
449 |
|
Lines 519-524
if ($op eq "additem") {
Link Here
|
519 |
# if barcode exists, don't create, but report The problem. |
551 |
# if barcode exists, don't create, but report The problem. |
520 |
unless ($exist_itemnumber) { |
552 |
unless ($exist_itemnumber) { |
521 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber ); |
553 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber ); |
|
|
554 |
add_item_to_volume( $oldbiblionumber, $oldbibitemnum, $volume, $volume_description ); |
522 |
|
555 |
|
523 |
# Pushing the last created item cookie back |
556 |
# Pushing the last created item cookie back |
524 |
if ($prefillitem && defined $record) { |
557 |
if ($prefillitem && defined $record) { |
Lines 618-623
if ($op eq "additem") {
Link Here
|
618 |
if (!$exist_itemnumber) { |
651 |
if (!$exist_itemnumber) { |
619 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = |
652 |
my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = |
620 |
AddItemFromMarc( $record, $biblionumber, { skip_record_index => 1 } ); |
653 |
AddItemFromMarc( $record, $biblionumber, { skip_record_index => 1 } ); |
|
|
654 |
add_item_to_volume( $oldbiblionumber, $oldbibitemnum, $volume, $volume_description ); |
621 |
|
655 |
|
622 |
# We count the item only if it was really added |
656 |
# We count the item only if it was really added |
623 |
# That way, all items are added, even if there was some already existing barcodes |
657 |
# That way, all items are added, even if there was some already existing barcodes |
Lines 988-993
foreach my $tag ( keys %{$tagslib}){
Link Here
|
988 |
|
1022 |
|
989 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
1023 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
990 |
$template->param( |
1024 |
$template->param( |
|
|
1025 |
volumes => scalar Koha::Biblio::Volumes->search({ biblionumber => $biblionumber }), |
991 |
biblionumber => $biblionumber, |
1026 |
biblionumber => $biblionumber, |
992 |
title => $oldrecord->{title}, |
1027 |
title => $oldrecord->{title}, |
993 |
author => $oldrecord->{author}, |
1028 |
author => $oldrecord->{author}, |