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 522-528
if ($op eq "additem") {
Link Here
|
522 |
} |
522 |
} |
523 |
else { |
523 |
else { |
524 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
524 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
525 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
525 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
526 |
my $fieldItem = $itemrecord->field($tagfield); |
526 |
my $fieldItem = $itemrecord->field($tagfield); |
527 |
$itemrecord->delete_field($fieldItem); |
527 |
$itemrecord->delete_field($fieldItem); |
528 |
$fieldItem->delete_subfields($tagsubfield); |
528 |
$fieldItem->delete_subfields($tagsubfield); |
Lines 538-545
if ($op eq "additem") {
Link Here
|
538 |
my $barcodeobj = C4::Barcodes->new; |
538 |
my $barcodeobj = C4::Barcodes->new; |
539 |
my $copynumber = $addedolditem->{'copynumber'}; |
539 |
my $copynumber = $addedolditem->{'copynumber'}; |
540 |
my $oldbarcode = $addedolditem->{'barcode'}; |
540 |
my $oldbarcode = $addedolditem->{'barcode'}; |
541 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
541 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
542 |
my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField("items.copynumber",$frameworkcode); |
542 |
my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField( "items.copynumber" ); |
543 |
|
543 |
|
544 |
# If there is a barcode and we can't find their new values, we can't add multiple copies |
544 |
# If there is a barcode and we can't find their new values, we can't add multiple copies |
545 |
my $testbarcode; |
545 |
my $testbarcode; |
Lines 625-631
if ($op eq "additem") {
Link Here
|
625 |
} |
625 |
} |
626 |
else { |
626 |
else { |
627 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
627 |
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin |
628 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); |
628 |
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" ); |
629 |
my $fieldItem = $itemrecord->field($tagfield); |
629 |
my $fieldItem = $itemrecord->field($tagfield); |
630 |
$itemrecord->delete_field($fieldItem); |
630 |
$itemrecord->delete_field($fieldItem); |
631 |
$fieldItem->delete_subfields($tagsubfield); |
631 |
$fieldItem->delete_subfields($tagsubfield); |
Lines 744-751
my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
Link Here
|
744 |
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code |
744 |
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code |
745 |
my @big_array; |
745 |
my @big_array; |
746 |
#---- finds where items.itemnumber is stored |
746 |
#---- finds where items.itemnumber is stored |
747 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", $frameworkcode); |
747 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
748 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", $frameworkcode); |
748 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
749 |
C4::Biblio::EmbedItemsInMarcBiblio({ |
749 |
C4::Biblio::EmbedItemsInMarcBiblio({ |
750 |
marc_record => $temp, |
750 |
marc_record => $temp, |
751 |
biblionumber => $biblionumber }); |
751 |
biblionumber => $biblionumber }); |
Lines 767-773
if ( C4::Context->preference('EasyAnalyticalRecords') ) {
Link Here
|
767 |
biblionumber => $hostbiblionumber, |
767 |
biblionumber => $hostbiblionumber, |
768 |
embed_items => 1 }); |
768 |
embed_items => 1 }); |
769 |
if ($hostrecord) { |
769 |
if ($hostrecord) { |
770 |
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) ); |
770 |
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber' ); |
771 |
foreach my $hostitem ($hostrecord->field($itemfield)){ |
771 |
foreach my $hostitem ($hostrecord->field($itemfield)){ |
772 |
if ($hostitem->subfield('9') eq $hostfield->subfield('9')){ |
772 |
if ($hostitem->subfield('9') eq $hostfield->subfield('9')){ |
773 |
push (@fields, $hostitem); |
773 |
push (@fields, $hostitem); |
Lines 827-833
foreach my $field (@fields) {
Link Here
|
827 |
} |
827 |
} |
828 |
} |
828 |
} |
829 |
|
829 |
|
830 |
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$frameworkcode); |
830 |
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField( "items.holdingbranch" ); |
831 |
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array; |
831 |
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array; |
832 |
|
832 |
|
833 |
# now, construct template ! |
833 |
# now, construct template ! |