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

(-)a/C4/AuthoritiesMarc.pm (-9 / +39 lines)
Lines 952-958 sub BuildSummary { Link Here
952
        $summary{type} = $authref->{authtypetext};
952
        $summary{type} = $authref->{authtypetext};
953
        $summary{summary} = $authref->{summary};
953
        $summary{summary} = $authref->{summary};
954
    }
954
    }
955
    my $marc21subfields = 'abcdfghjklmnopqrstuvxyz';
955
    my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68';
956
    my %marc21controlrefs = ( 'a' => 'earlier',
956
    my %marc21controlrefs = ( 'a' => 'earlier',
957
        'b' => 'later',
957
        'b' => 'later',
958
        'd' => 'acronym',
958
        'd' => 'acronym',
Lines 1032-1042 sub BuildSummary { Link Here
1032
# see :
1032
# see :
1033
        foreach my $field ($record->field('5..')) {
1033
        foreach my $field ($record->field('5..')) {
1034
            if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
1034
            if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
1035
                push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader', field => $field->tag() };
1035
                push @seealso, {
1036
                    heading => $field->as_string('abcdefgjxyz'),
1037
                    type => 'broader',
1038
                    field => $field->tag(),
1039
                    search => $field->as_string('abcdefgjxyz'),
1040
                    authid => $field->subfield('9')
1041
                };
1036
            } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
1042
            } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
1037
                push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower', field => $field->tag() };
1043
                push @seealso, {
1044
                    heading => $field->as_string('abcdefgjxyz'),
1045
                    type => 'narrower',
1046
                    field => $field->tag(),
1047
                    search => $field->as_string('abcdefgjxyz'),
1048
                    authid => $field->subfield('9')
1049
                };
1038
            } elsif ($field->subfield('a')) {
1050
            } elsif ($field->subfield('a')) {
1039
                push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso', field => $field->tag() };
1051
                push @seealso, {
1052
                    heading => $field->as_string('abcdefgxyz'),
1053
                    type => 'seealso',
1054
                    field => $field->tag(),
1055
                    search => $field->as_string('abcdefgjxyz'),
1056
                    authid => $field->subfield('9')
1057
                };
1040
            }
1058
            }
1041
        }
1059
        }
1042
# // form
1060
# // form
Lines 1088-1115 sub BuildSummary { Link Here
1088
        }
1106
        }
1089
        foreach my $field ($record->field('4..')) { #See From
1107
        foreach my $field ($record->field('4..')) { #See From
1090
            my $type = 'seefrom';
1108
            my $type = 'seefrom';
1091
            $type = $marc21controlrefs{substr $field->subfield('w'), 0, 1} if ($field->subfield('w'));
1109
            $type = ($marc21controlrefs{substr $field->subfield('w'), 0, 1} || '') if ($field->subfield('w'));
1092
            if ($type eq 'notapplicable') {
1110
            if ($type eq 'notapplicable') {
1093
                $type = substr $field->subfield('w'), 2, 1;
1111
                $type = substr $field->subfield('w'), 2, 1;
1094
                $type = 'earlier' if $type && $type ne 'n';
1112
                $type = 'earlier' if $type && $type ne 'n';
1095
            }
1113
            }
1096
            if ($type eq 'subfi') {
1114
            if ($type eq 'subfi') {
1097
                push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i'), field => $field->tag() };
1115
                push @seefrom, { heading => $field->as_string($marc21subfields), type => ($field->subfield('i') || ''), field => $field->tag() };
1098
            } else {
1116
            } else {
1099
                push @seefrom, { heading => $field->as_string($marc21subfields), type => $type, field => $field->tag() };
1117
                push @seefrom, { heading => $field->as_string($marc21subfields), type => $type, field => $field->tag() };
1100
            }
1118
            }
1101
        }
1119
        }
1102
        foreach my $field ($record->field('5..')) { #See Also
1120
        foreach my $field ($record->field('5..')) { #See Also
1103
            my $type = 'seealso';
1121
            my $type = 'seealso';
1104
            $type = $marc21controlrefs{substr $field->subfield('w'), 0, 1} if ($field->subfield('w'));
1122
            $type = ($marc21controlrefs{substr $field->subfield('w'), 0, 1} || '') if ($field->subfield('w'));
1105
            if ($type eq 'notapplicable') {
1123
            if ($type eq 'notapplicable') {
1106
                $type = substr $field->subfield('w'), 2, 1;
1124
                $type = substr $field->subfield('w'), 2, 1;
1107
                $type = 'earlier' if $type && $type ne 'n';
1125
                $type = 'earlier' if $type && $type ne 'n';
1108
            }
1126
            }
1109
            if ($type eq 'subfi') {
1127
            if ($type eq 'subfi') {
1110
                push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i'), field => $field->tag() };
1128
                push @seealso, {
1129
                    heading => $field->as_string($marc21subfields),
1130
                    type => $field->subfield('i'),
1131
                    field => $field->tag(),
1132
                    search => $field->as_string($marc21subfields) || '',
1133
                    authid => $field->subfield('9') || ''
1134
                };
1111
            } else {
1135
            } else {
1112
                push @seealso, { heading => $field->as_string($marc21subfields), type => $type, field => $field->tag() };
1136
                push @seealso, {
1137
                    heading => $field->as_string($marc21subfields),
1138
                    type => $type,
1139
                    field => $field->tag(),
1140
                    search => $field->as_string($marc21subfields) || '',
1141
                    authid => $field->subfield('9') || ''
1142
                };
1113
            }
1143
            }
1114
        }
1144
        }
1115
        foreach my $field ($record->field('6..')) {
1145
        foreach my $field ($record->field('6..')) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc (-14 / +18 lines)
Lines 2-20 Link Here
2
    [% IF marcflavour == 'UNIMARC' %]
2
    [% IF marcflavour == 'UNIMARC' %]
3
        [% SWITCH type %]
3
        [% SWITCH type %]
4
        [% CASE 'broader' %]
4
        [% CASE 'broader' %]
5
            <span class="BT">[% heading %]</span> --
5
            <span class="BT">[% heading | html %]</span> --
6
        [% CASE 'narrower' %]
6
        [% CASE 'narrower' %]
7
            <span class="NT">[% heading %]</span> --
7
            <span class="NT">[% heading | html %]</span> --
8
        [% CASE 'narrower' %]
8
        [% CASE 'narrower' %]
9
            <span class="NT">[% heading %]</span> --
9
            <span class="NT">[% heading | html %]</span> --
10
        [% CASE 'seefrom' %]
10
        [% CASE 'seefrom' %]
11
            <span class="UF">[% heading %]</span> --
11
            <span class="UF">[% heading | html %]</span> --
12
        [% CASE 'seealso' %]
12
        [% CASE 'seealso' %]
13
            <span class="RT">[% heading %]</span> --
13
            <span class="RT">[% heading | html %]</span> --
14
        [% END %]
14
        [% END %]
15
    [% ELSE %]
15
    [% ELSE %]
16
        [% IF ( label ) %]<span class="label">[% label %]</span>[% END %]
16
        [% IF ( label ) %]<span class="label">[% label | html %]</span>[% END %]
17
        <span class="heading">[% heading %]</span>
17
        <span class="heading">
18
        [% IF ( linkpath && search ) %]<a href="[% link | url %][% search | url %]">[% heading | html %]</a>
19
        [% ELSE %][% heading | html %][% END %]
20
        </span>
18
        [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
21
        [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
19
        [% CASE 'earlier' %](Earlier heading)
22
        [% CASE 'earlier' %](Earlier heading)
20
        [% CASE 'later' %](Later heading)
23
        [% CASE 'later' %](Later heading)
Lines 22-56 Link Here
22
        [% CASE 'musical' %](Musical composition)
25
        [% CASE 'musical' %](Musical composition)
23
        [% CASE 'broader' %](Broader heading)
26
        [% CASE 'broader' %](Broader heading)
24
        [% CASE 'narrower' %](Narrower heading)
27
        [% CASE 'narrower' %](Narrower heading)
25
        [% CASE %]([% type %])
28
        [% CASE 'parent' %](Immediate parent body)
29
        [% CASE %]([% type | html %])
26
        [% END %]</span>[% END %]
30
        [% END %]</span>[% END %]
27
    [% END %]
31
    [% END %]
28
[% END %]
32
[% END %]
29
[% BLOCK authresult %]
33
[% BLOCK authresult %]
30
    [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
34
    [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %]
31
    [% UNLESS ( summary.summaryonly ) %]
35
    [% UNLESS ( summary.summaryonly ) %]
32
        [% FOREACH authorize IN summary.authorized %]
36
        [% FOREACH authorize IN summary.authorized %]
33
            <span class="authorizedheading">[% authorize %]</span>
37
            <span class="authorizedheading">[% authorize | html %]</span>
34
        [% END %]
38
        [% END %]
35
        [% IF ( marcflavour == 'UNIMARC' ) %]
39
        [% IF ( marcflavour == 'UNIMARC' ) %]
36
            [% FOREACH note IN summary.notes %]
40
            [% FOREACH note IN summary.notes %]
37
                <span class="note">[% note %]</span>
41
                <span class="note">[% note | html %]</span>
38
            [% END %]
42
            [% END %]
39
            [% FOREACH seefro IN summary.seefrom %]
43
            [% FOREACH seefro IN summary.seefrom %]
40
                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %]
44
                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type search='' %]
41
            [% END %]
45
            [% END %]
42
        [% ELSE %]
46
        [% ELSE %]
43
            [% IF ( summary.seefrom ) %]
47
            [% IF ( summary.seefrom ) %]
44
                [% FOREACH seefro IN summary.seefrom %]
48
                [% FOREACH seefro IN summary.seefrom %]
45
                    <div class="seefrom authref">
49
                    <div class="seefrom authref">
46
                    [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %]
50
                    [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %]
47
                    </div>
51
                    </div>
48
                [% END %]
52
                [% END %]
49
            [% END %]
53
            [% END %]
50
            [% IF ( summary.seealso ) %]
54
            [% IF ( summary.seealso ) %]
51
                [% FOREACH seeals IN summary.seealso %]
55
                [% FOREACH seeals IN summary.seealso %]
52
                    <div class="seealso authref">
56
                    <div class="seealso authref">
53
                    [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %]
57
                    [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %]
54
                    </div>
58
                    </div>
55
                [% END %]
59
                [% END %]
56
            [% END %]
60
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-1 / +1 lines)
Lines 64-70 function searchauthority() { Link Here
64
    [% ELSE %]
64
    [% ELSE %]
65
    <tr>
65
    <tr>
66
    [% END %]
66
    [% END %]
67
      <td>[% PROCESS authresult summary=resul.summary %]</td>
67
      <td>[% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=" %]</td>
68
      <td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
68
      <td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
69
  [% UNLESS ( resul.isEDITORS ) %]
69
  [% UNLESS ( resul.isEDITORS ) %]
70
      <td>
70
      <td>
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc (-14 / +18 lines)
Lines 2-20 Link Here
2
    [% IF marcflavour == 'UNIMARC' %]
2
    [% IF marcflavour == 'UNIMARC' %]
3
        [% SWITCH type %]
3
        [% SWITCH type %]
4
        [% CASE 'broader' %]
4
        [% CASE 'broader' %]
5
            <span class="BT">[% heading %]</span> --
5
            <span class="BT">[% heading | html %]</span> --
6
        [% CASE 'narrower' %]
6
        [% CASE 'narrower' %]
7
            <span class="NT">[% heading %]</span> --
7
            <span class="NT">[% heading | html %]</span> --
8
        [% CASE 'narrower' %]
8
        [% CASE 'narrower' %]
9
            <span class="NT">[% heading %]</span> --
9
            <span class="NT">[% heading | html %]</span> --
10
        [% CASE 'seefrom' %]
10
        [% CASE 'seefrom' %]
11
            <span class="UF">[% heading %]</span> --
11
            <span class="UF">[% heading | html %]</span> --
12
        [% CASE 'seealso' %]
12
        [% CASE 'seealso' %]
13
            <span class="RT">[% heading %]</span> --
13
            <span class="RT">[% heading | html %]</span> --
14
        [% END %]
14
        [% END %]
15
    [% ELSE %]
15
    [% ELSE %]
16
        [% IF ( label ) %]<span class="label">[% label %]</span>[% END %]
16
        [% IF ( label ) %]<span class="label">[% label | html %]</span>[% END %]
17
        <span class="heading">[% heading %]</span>
17
        <span class="heading">
18
        [% IF ( linkpath && search ) %]<a href="[% link | url %][% search | url %]">[% heading | html %]</a>
19
        [% ELSE %][% heading | html %][% END %]
20
        </span>
18
        [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
21
        [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
19
        [% CASE 'earlier' %](Earlier heading)
22
        [% CASE 'earlier' %](Earlier heading)
20
        [% CASE 'later' %](Later heading)
23
        [% CASE 'later' %](Later heading)
Lines 22-56 Link Here
22
        [% CASE 'musical' %](Musical composition)
25
        [% CASE 'musical' %](Musical composition)
23
        [% CASE 'broader' %](Broader heading)
26
        [% CASE 'broader' %](Broader heading)
24
        [% CASE 'narrower' %](Narrower heading)
27
        [% CASE 'narrower' %](Narrower heading)
25
        [% CASE %]([% type %])
28
        [% CASE 'parent' %](Immediate parent body)
29
        [% CASE %]([% type | html %])
26
        [% END %]</span>[% END %]
30
        [% END %]</span>[% END %]
27
    [% END %]
31
    [% END %]
28
[% END %]
32
[% END %]
29
[% BLOCK authresult %]
33
[% BLOCK authresult %]
30
    [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
34
    [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %]
31
    [% UNLESS ( summary.summaryonly ) %]
35
    [% UNLESS ( summary.summaryonly ) %]
32
        [% FOREACH authorize IN summary.authorized %]
36
        [% FOREACH authorize IN summary.authorized %]
33
            <span class="authorizedheading">[% authorize.heading %]</span>
37
            <span class="authorizedheading">[% authorize.heading | html %]</span>
34
        [% END %]
38
        [% END %]
35
        [% IF ( marcflavour == 'UNIMARC' ) %]
39
        [% IF ( marcflavour == 'UNIMARC' ) %]
36
            [% FOREACH note IN summary.notes %]
40
            [% FOREACH note IN summary.notes %]
37
                <span class="note">[% note %]</span>
41
                <span class="note">[% note | html %]</span>
38
            [% END %]
42
            [% END %]
39
            [% FOREACH seefro IN summary.seefrom %]
43
            [% FOREACH seefro IN summary.seefrom %]
40
                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %]
44
                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type search='' %]
41
            [% END %]
45
            [% END %]
42
        [% ELSE %]
46
        [% ELSE %]
43
            [% IF ( summary.seefrom ) %]
47
            [% IF ( summary.seefrom ) %]
44
                [% FOREACH seefro IN summary.seefrom %]
48
                [% FOREACH seefro IN summary.seefrom %]
45
                    <div class="seefrom authref">
49
                    <div class="seefrom authref">
46
                    [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %]
50
                    [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %]
47
                    </div>
51
                    </div>
48
                [% END %]
52
                [% END %]
49
            [% END %]
53
            [% END %]
50
            [% IF ( summary.seealso ) %]
54
            [% IF ( summary.seealso ) %]
51
                [% FOREACH seeals IN summary.seealso %]
55
                [% FOREACH seeals IN summary.seealso %]
52
                    <div class="seealso authref">
56
                    <div class="seealso authref">
53
                    [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %]
57
                    [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %]
54
                    </div>
58
                    </div>
55
                [% END %]
59
                [% END %]
56
            [% END %]
60
            [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt (-1 / +1 lines)
Lines 57-63 Link Here
57
            [% ELSE %]
57
            [% ELSE %]
58
                <tr>
58
                <tr>
59
            [% END %]
59
            [% END %]
60
                    <td>[% PROCESS authresult summary=resul.summary %]</td>
60
                    <td>[% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&valuec=" %]</td>
61
                    <td>[% resul.authtype %]</td>
61
                    <td>[% resul.authtype %]</td>
62
					[% UNLESS ( resul.isEDITORS ) %]
62
					[% UNLESS ( resul.isEDITORS ) %]
63
						<td>
63
						<td>
(-)a/opac/opac-authorities-home.pl (-3 / +2 lines)
Lines 58-67 foreach my $thisauthtype ( Link Here
58
}
58
}
59
59
60
if ( $op eq "do_search" ) {
60
if ( $op eq "do_search" ) {
61
    my @marclist = ($query->param('marclista'),$query->param('marclistb'),$query->param('marclistc'));
61
    my @marclist = ($query->param('marclista') || '',$query->param('marclistb') || '',$query->param('marclistc') || 'mainentry');
62
    my @and_or = ($query->param('and_ora'),$query->param('and_orb'),$query->param('and_orc'));
62
    my @and_or = ($query->param('and_ora'),$query->param('and_orb'),$query->param('and_orc'));
63
    my @excluding = ($query->param('excludinga'),$query->param('excludingb'),$query->param('excludingc'),);
63
    my @excluding = ($query->param('excludinga'),$query->param('excludingb'),$query->param('excludingc'),);
64
    my @operator = ($query->param('operatora'),$query->param('operatorb'),$query->param('operatorc'));
64
    my @operator = ($query->param('operatora') || '',$query->param('operatorb') || '',$query->param('operatorc'));
65
    my $orderby = $query->param('orderby');
65
    my $orderby = $query->param('orderby');
66
    my @value = ($query->param('valuea') || "",$query->param('valueb') || "",$query->param('valuec') || "",);
66
    my @value = ($query->param('valuea') || "",$query->param('valueb') || "",$query->param('valuec') || "",);
67
67
68
- 

Return to bug 3462