Lines 95-101
sub set_item_default_location {
Link Here
|
95 |
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript |
95 |
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript |
96 |
sub _increment_barcode { |
96 |
sub _increment_barcode { |
97 |
my ($record, $frameworkcode) = @_; |
97 |
my ($record, $frameworkcode) = @_; |
98 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
98 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
99 |
unless ($record->field($tagfield)->subfield($tagsubfield)) { |
99 |
unless ($record->field($tagfield)->subfield($tagsubfield)) { |
100 |
my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items"); |
100 |
my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items"); |
101 |
$sth_barcode->execute; |
101 |
$sth_barcode->execute; |
Lines 353-359
sub removeFieldsForPrefill {
Link Here
|
353 |
my $item = shift; |
353 |
my $item = shift; |
354 |
|
354 |
|
355 |
# Getting item tag |
355 |
# Getting item tag |
356 |
my ($tag, $subtag) = GetMarcFromKohaField("items.barcode", ''); |
356 |
my ($tag, $subtag) = GetMarcFromKohaField( "items.barcode" ); |
357 |
|
357 |
|
358 |
# Getting list of subfields to keep |
358 |
# Getting list of subfields to keep |
359 |
my $subfieldsToUseWhenPrefill = C4::Context->preference('SubfieldsToUseWhenPrefill'); |
359 |
my $subfieldsToUseWhenPrefill = C4::Context->preference('SubfieldsToUseWhenPrefill'); |
Lines 526-532
if ($op eq "additem") {
Link Here
|
526 |
} |
526 |
} |
527 |
else { |
527 |
else { |
528 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
528 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
529 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
529 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
530 |
my $fieldItem = $itemrecord->field($tagfield); |
530 |
my $fieldItem = $itemrecord->field($tagfield); |
531 |
$itemrecord->delete_field($fieldItem); |
531 |
$itemrecord->delete_field($fieldItem); |
532 |
$fieldItem->delete_subfields($tagsubfield); |
532 |
$fieldItem->delete_subfields($tagsubfield); |
Lines 542-549
if ($op eq "additem") {
Link Here
|
542 |
my $barcodeobj = C4::Barcodes->new; |
542 |
my $barcodeobj = C4::Barcodes->new; |
543 |
my $copynumber = $addedolditem->{'copynumber'}; |
543 |
my $copynumber = $addedolditem->{'copynumber'}; |
544 |
my $oldbarcode = $addedolditem->{'barcode'}; |
544 |
my $oldbarcode = $addedolditem->{'barcode'}; |
545 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
545 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
546 |
my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField("items.copynumber",$frameworkcode); |
546 |
my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField( "items.copynumber" ); |
547 |
|
547 |
|
548 |
# If there is a barcode and we can't find their new values, we can't add multiple copies |
548 |
# If there is a barcode and we can't find their new values, we can't add multiple copies |
549 |
my $testbarcode; |
549 |
my $testbarcode; |
Lines 629-635
if ($op eq "additem") {
Link Here
|
629 |
} |
629 |
} |
630 |
else { |
630 |
else { |
631 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
631 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
632 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
632 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
633 |
my $fieldItem = $itemrecord->field($tagfield); |
633 |
my $fieldItem = $itemrecord->field($tagfield); |
634 |
$itemrecord->delete_field($fieldItem); |
634 |
$itemrecord->delete_field($fieldItem); |
635 |
$fieldItem->delete_subfields($tagsubfield); |
635 |
$fieldItem->delete_subfields($tagsubfield); |
Lines 748-755
my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
Link Here
|
748 |
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code |
748 |
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code |
749 |
my @big_array; |
749 |
my @big_array; |
750 |
#---- finds where items.itemnumber is stored |
750 |
#---- finds where items.itemnumber is stored |
751 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", $frameworkcode); |
751 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
752 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", $frameworkcode); |
752 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
753 |
C4::Biblio::EmbedItemsInMarcBiblio({ |
753 |
C4::Biblio::EmbedItemsInMarcBiblio({ |
754 |
marc_record => $temp, |
754 |
marc_record => $temp, |
755 |
biblionumber => $biblionumber }); |
755 |
biblionumber => $biblionumber }); |
Lines 771-777
if ( C4::Context->preference('EasyAnalyticalRecords') ) {
Link Here
|
771 |
biblionumber => $hostbiblionumber, |
771 |
biblionumber => $hostbiblionumber, |
772 |
embed_items => 1 }); |
772 |
embed_items => 1 }); |
773 |
if ($hostrecord) { |
773 |
if ($hostrecord) { |
774 |
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) ); |
774 |
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber' ); |
775 |
foreach my $hostitem ($hostrecord->field($itemfield)){ |
775 |
foreach my $hostitem ($hostrecord->field($itemfield)){ |
776 |
if ($hostitem->subfield('9') eq $hostfield->subfield('9')){ |
776 |
if ($hostitem->subfield('9') eq $hostfield->subfield('9')){ |
777 |
push (@fields, $hostitem); |
777 |
push (@fields, $hostitem); |
Lines 831-837
foreach my $field (@fields) {
Link Here
|
831 |
} |
831 |
} |
832 |
} |
832 |
} |
833 |
|
833 |
|
834 |
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$frameworkcode); |
834 |
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField( "items.holdingbranch" ); |
835 |
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array; |
835 |
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array; |
836 |
|
836 |
|
837 |
# now, construct template ! |
837 |
# now, construct template ! |