Lines 2008-2035
sub searchResults {
Link Here
|
2008 |
# Pull out the items fields |
2008 |
# Pull out the items fields |
2009 |
my @fields = $marcrecord->field($itemtag); |
2009 |
my @fields = $marcrecord->field($itemtag); |
2010 |
my $marcflavor = C4::Context->preference("marcflavour"); |
2010 |
my $marcflavor = C4::Context->preference("marcflavour"); |
|
|
2011 |
|
2011 |
# adding linked items that belong to host records |
2012 |
# adding linked items that belong to host records |
2012 |
my $analyticsfield = '773'; |
2013 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
2013 |
if ($marcflavor eq 'MARC21' || $marcflavor eq 'NORMARC') { |
2014 |
my $analyticsfield = '773'; |
2014 |
$analyticsfield = '773'; |
2015 |
if ($marcflavor eq 'MARC21' || $marcflavor eq 'NORMARC') { |
2015 |
} elsif ($marcflavor eq 'UNIMARC') { |
2016 |
$analyticsfield = '773'; |
2016 |
$analyticsfield = '461'; |
2017 |
} elsif ($marcflavor eq 'UNIMARC') { |
2017 |
} |
2018 |
$analyticsfield = '461'; |
2018 |
foreach my $hostfield ( $marcrecord->field($analyticsfield)) { |
2019 |
} |
2019 |
my $hostbiblionumber = $hostfield->subfield("0"); |
2020 |
foreach my $hostfield ( $marcrecord->field($analyticsfield)) { |
2020 |
my $linkeditemnumber = $hostfield->subfield("9"); |
2021 |
my $hostbiblionumber = $hostfield->subfield("0"); |
2021 |
if( $hostbiblionumber ) { |
2022 |
my $linkeditemnumber = $hostfield->subfield("9"); |
2022 |
my $hostbiblio = GetMarcBiblio({ |
2023 |
if( $hostbiblionumber ) { |
2023 |
biblionumber => $hostbiblionumber, |
2024 |
my $hostbiblio = GetMarcBiblio({ |
2024 |
embed_items => 1 }); |
2025 |
biblionumber => $hostbiblionumber, |
2025 |
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) ); |
2026 |
embed_items => 1 }); |
2026 |
if( $hostbiblio ) { |
2027 |
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) ); |
2027 |
my @hostitems = $hostbiblio->field($itemfield); |
2028 |
if( $hostbiblio ) { |
2028 |
foreach my $hostitem (@hostitems){ |
2029 |
my @hostitems = $hostbiblio->field($itemfield); |
2029 |
if ($hostitem->subfield("9") eq $linkeditemnumber){ |
2030 |
foreach my $hostitem (@hostitems){ |
2030 |
my $linkeditem =$hostitem; |
2031 |
if ($hostitem->subfield("9") eq $linkeditemnumber){ |
2031 |
# append linked items if they exist |
2032 |
my $linkeditem =$hostitem; |
2032 |
push @fields, $linkeditem if $linkeditem; |
2033 |
# append linked items if they exist |
|
|
2034 |
push @fields, $linkeditem if $linkeditem; |
2035 |
} |
2033 |
} |
2036 |
} |
2034 |
} |
2037 |
} |
2035 |
} |
2038 |
} |