diff --git a/C4/Biblio.pm b/C4/Biblio.pm index db371362bd..1c6d43b7ce 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1879,12 +1879,8 @@ sub GetMarcSubjects { } my $separator = C4::Context->preference("authoritysep") unless $counter==0; # ignore $9 - push @subfields_loop, {code => $code, value => $value, link_loop => \@link_loop, separator => $separator} unless ($subject_subfield->[0] == 9 ); - # this needs to be added back in in a way that the template can expose it properly - #if ( $code == 9 ) { - # $link = "an:".$subject_subfield->[1]; - # $flag = 1; - #} + my @this_link_loop = @link_loop; + push @subfields_loop, {code => $code, value => $value, link_loop => \@this_link_loop, separator => $separator} unless ($subject_subfield->[0] == 9 ); $counter++; } @@ -1926,25 +1922,37 @@ sub GetMarcAuthors { foreach my $field ( $record->fields ) { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; - my %hash; + my @subfields_loop; + my @link_loop; my @subfields = $field->subfields(); my $count_auth = 0; + # if there is an authority link, build the link with Koha-Auth-Number: subfield9 + my $subfield9 = $field->subfield('9'); for my $authors_subfield (@subfields) { - #unimarc-specific line - next if ($marcflavour eq 'UNIMARC' and (($authors_subfield->[0] eq '3') or ($authors_subfield->[0] eq '5'))); + # don't load unimarc subfields 3, 5 + next if ($marcflavour eq 'UNIMARC' and ($authors_subfield->[0] =~ (3|5) ) ); my $subfieldcode = $authors_subfield->[0]; - my $value; - # deal with UNIMARC author responsibility - if ( $marcflavour eq 'UNIMARC' and ($authors_subfield->[0] eq '4')) { - $value = "(".GetAuthorisedValueDesc( $field->tag(), $authors_subfield->[0], $authors_subfield->[1], '', $tagslib ).")"; - } else { - $value = $authors_subfield->[1]; - } - $hash{tag} = $field->tag; - $hash{value} .= $value . " " if ($subfieldcode != 9) ; - $hash{link} .= $value if ($subfieldcode eq 9); + my $value = $authors_subfield->[1]; + my $linkvalue = $value; + $linkvalue =~ s/(\(|\))//g; + my $operator = " and " unless $count_auth==0; + # if we have an authority link, use that as the link, otherwise use standard searching + if ($subfield9) { + @link_loop = ({'limit' => 'Koha-Auth-Number' ,link => "$subfield9" }); + } + else { + # reset $linkvalue if UNIMARC author responsibility + if ( $marcflavour eq 'UNIMARC' and ($authors_subfield->[0] eq '4')) { + $linkvalue = "(".GetAuthorisedValueDesc( $field->tag(), $authors_subfield->[0], $authors_subfield->[1], '', $tagslib ).")"; + } + push @link_loop, {'limit' => 'au', link => $linkvalue, operator => $operator }; + } + my @this_link_loop = @link_loop; + my $separator = C4::Context->preference("authoritysep") unless $count_auth==0; + push @subfields_loop, {code => $subfieldcode, value => $value, link_loop => \@this_link_loop, separator => $separator} unless ($authors_subfield->[0] == 9 ); + $count_auth++; } - push @marcauthors, \%hash; + push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop }; } return \@marcauthors; } diff --git a/C4/Search.pm b/C4/Search.pm index ab6edc3e5d..9dfef9d2f0 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -885,7 +885,7 @@ sub buildQuery { foreach my $this_limit (@limits) { if ( $this_limit =~ /available/ ) { # available is defined as (items.notloan is NULL) and (items.itemlost > 0 or NULL) (last clause handles NULL values for lost in zebra) - $availability_limit .="( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and ((lost,st-numeric gt 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; + $availability_limit .="( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and ((lost,st-numeric ge 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; $limit_cgi .= "&limit=available"; $limit_desc .=""; } diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index c44a0423a8..0e8fcb8f51 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -210,11 +210,11 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { } if ( $#subfields_data == 0 ) { $subfields_data[0]->{marc_lib} = ''; - $subfields_data[0]->{marc_subfield} = ''; +# $subfields_data[0]->{marc_subfield} = ''; } - if ( $#subfields_data >= 0 ) { + if ( $#subfields_data >= 0) { my %tag_data; - if ( $fields[$x_i]->tag() eq $fields[ $x_i - 1 ]->tag() ) { + if ( $fields[$x_i]->tag() eq $fields[ $x_i - 1 ]->tag() && (C4::Context->preference('LabelMARCView') eq 'economical')) { $tag_data{tag} = ""; } else { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index a640c6f74c..4a23a96ba7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -4,7 +4,7 @@

Refine your search