View | Details | Raw Unified | Return to bug 27943
Collapse All | Expand All

(-)a/C4/AuthoritiesMarc.pm (+79 lines)
Lines 886-891 sub BuildSummary { Link Here
886
    my @seefrom;
886
    my @seefrom;
887
    my @seealso;
887
    my @seealso;
888
    my @otherscript;
888
    my @otherscript;
889
    my @equalterm;
890
889
    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
891
    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
890
# construct UNIMARC summary, that is quite different from MARC21 one
892
# construct UNIMARC summary, that is quite different from MARC21 one
891
# accepted form
893
# accepted form
Lines 939-944 sub BuildSummary { Link Here
939
        use C4::Heading::MARC21;
941
        use C4::Heading::MARC21;
940
        my $handler = C4::Heading::MARC21->new();
942
        my $handler = C4::Heading::MARC21->new();
941
        my $subfields_to_report;
943
        my $subfields_to_report;
944
        my $subfields_to_subdivision="";
945
        my $delimiter = " -- ";
942
        foreach my $field ($record->field('1..')) {
946
        foreach my $field ($record->field('1..')) {
943
            my $tag = $field->tag();
947
            my $tag = $field->tag();
944
            next if "152" eq $tag;
948
            next if "152" eq $tag;
Lines 1015-1020 sub BuildSummary { Link Here
1015
        foreach my $field ($record->field('6..')) {
1019
        foreach my $field ($record->field('6..')) {
1016
            push @notes, { note => $field->as_string(), field => $field->tag() };
1020
            push @notes, { note => $field->as_string(), field => $field->tag() };
1017
        }
1021
        }
1022
1023
        foreach my $field ($record->field('7..'))
1024
        {
1025
            my $tag = $field->tag();
1026
1027
            if ($tag eq '700') {
1028
                $subfields_to_report = 'abcdefghjklmnopqrst';
1029
                $subfields_to_subdivision='vxyz';
1030
                $delimiter=" -- ";
1031
            } elsif ($tag eq '710') {
1032
                $subfields_to_report = 'abcdefghklmnoprst';
1033
                $subfields_to_subdivision='vxyz';
1034
                $delimiter=" -- ";
1035
            } elsif ($tag eq '711') {
1036
                $subfields_to_report = 'acdefghklnpqst';
1037
                $subfields_to_subdivision='vxyz';
1038
                $delimiter=" -- ";
1039
            } elsif ($tag eq '730') {
1040
                $subfields_to_report = 'adfghklmnoprst';
1041
                $subfields_to_subdivision='vxyz';
1042
                $delimiter=" -- ";
1043
            } elsif ($tag eq '748') {
1044
                $subfields_to_report = 'ab';
1045
                $subfields_to_subdivision='vxyz';
1046
                $delimiter=" -- ";
1047
            } elsif ($tag eq '750') {
1048
                $subfields_to_report = 'ab';
1049
                $subfields_to_subdivision='vxyz';
1050
                $delimiter=" -- ";
1051
            } elsif ($tag eq '751') {
1052
                $subfields_to_report = 'a';
1053
                $subfields_to_subdivision='vxyz';
1054
                $delimiter=" -- ";
1055
            } elsif ($tag eq '755') {
1056
                $subfields_to_report = 'abvxyz';
1057
                $subfields_to_subdivision='vxyz';
1058
                $delimiter=" -- ";
1059
            } elsif ($tag eq '780') {
1060
                $subfields_to_report = 'vxyz';
1061
                $delimiter=" ";
1062
            } elsif ($tag eq '781') {
1063
                $subfields_to_report = 'vxyz';
1064
                $delimiter=" ";
1065
            } elsif ($tag eq '782') {
1066
                $subfields_to_report = 'vxyz';
1067
                $delimiter=" ";
1068
            } elsif ($tag eq '785') {
1069
               $subfields_to_report = 'vxyz';
1070
                $delimiter=" ";
1071
            }
1072
1073
            my $heading = $field->as_string($subfields_to_report);
1074
1075
            my $subheading = $field->as_string($subfields_to_subdivision,$delimiter);
1076
            if(length $subheading > 0 )
1077
            {
1078
                $heading.=$delimiter.$subheading;
1079
            }
1080
1081
            if ($subfields_to_report) {
1082
                push @equalterm, {
1083
                    heading => $heading,
1084
                    hemain  => ( $field->subfield( substr($subfields_to_report, 0, 1) ) // undef ),
1085
                    field   => $tag,
1086
                };
1087
            } else {
1088
                push @equalterm, {
1089
                    heading => $field->as_string(),
1090
                    hemain  => ( $field->subfield( 'a' ) // undef ),
1091
                    field   => $tag,
1092
                };
1093
            }
1094
        }
1095
1018
        foreach my $field ($record->field('880')) {
1096
        foreach my $field ($record->field('880')) {
1019
            my $linkage = $field->subfield('6');
1097
            my $linkage = $field->subfield('6');
1020
            my $category = substr $linkage, 0, 1;
1098
            my $category = substr $linkage, 0, 1;
Lines 1042-1047 sub BuildSummary { Link Here
1042
    $summary{seefrom} = \@seefrom;
1120
    $summary{seefrom} = \@seefrom;
1043
    $summary{seealso} = \@seealso;
1121
    $summary{seealso} = \@seealso;
1044
    $summary{otherscript} = \@otherscript;
1122
    $summary{otherscript} = \@otherscript;
1123
    $summary{equalterm} = \@equalterm;
1045
    return \%summary;
1124
    return \%summary;
1046
}
1125
}
1047
1126
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc (+6 lines)
Lines 69-74 Link Here
69
            </span>
69
            </span>
70
            [% UNLESS loop.last %] | [% END %]
70
            [% UNLESS loop.last %] | [% END %]
71
          [% END %]
71
          [% END %]
72
          [% IF summary.equalterm.size %]
73
            [% FOREACH term IN summary.equalterm %]
74
                <span class="label">=</span>
75
                <span class="authorized">[% term.heading %]</span>
76
            [% END %]
77
          [% END %]
72
        </div>
78
        </div>
73
        [% IF ( marcflavour == 'UNIMARC' ) %]
79
        [% IF ( marcflavour == 'UNIMARC' ) %]
74
          [% IF summary.notes %]
80
          [% IF summary.notes %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc (-1 / +6 lines)
Lines 61-66 Link Here
61
                <span class="authorizedheading">[% authorize.heading | html %]</span>
61
                <span class="authorizedheading">[% authorize.heading | html %]</span>
62
                [% UNLESS loop.last %] | [% END %]
62
                [% UNLESS loop.last %] | [% END %]
63
            [% END %]
63
            [% END %]
64
            [% IF summary.equalterm.size %]
65
                [% FOREACH term IN summary.equalterm %]
66
                        <span class="label">=</span>
67
                        <span class="authorized">[% term.heading %]</span>
68
                [% END %]
69
            [% END %]
64
        </div>
70
        </div>
65
        [% IF ( marcflavour == 'UNIMARC' ) %]
71
        [% IF ( marcflavour == 'UNIMARC' ) %]
66
            [% IF summary.notes %]
72
            [% IF summary.notes %]
67
- 

Return to bug 27943