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

(-)a/C4/AuthoritiesMarc.pm (-9 / +34 lines)
Lines 948-954 sub BuildSummary { Link Here
948
        $summary{type} = $authref->{authtypetext};
948
        $summary{type} = $authref->{authtypetext};
949
        $summary{summary} = $authref->{summary};
949
        $summary{summary} = $authref->{summary};
950
    }
950
    }
951
    my $marc21subfields = 'abcdfghjklmnopqrstuvxyz';
951
    my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68';
952
    my %marc21controlrefs = ( 'a' => 'earlier',
952
    my %marc21controlrefs = ( 'a' => 'earlier',
953
        'b' => 'later',
953
        'b' => 'later',
954
        'd' => 'acronym',
954
        'd' => 'acronym',
Lines 1027-1037 sub BuildSummary { Link Here
1027
# see :
1027
# see :
1028
            foreach my $field ($record->field('5..')) {
1028
            foreach my $field ($record->field('5..')) {
1029
                if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
1029
                if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
1030
                    push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader' };
1030
                    push @seealso, {
1031
                        heading => $field->as_string('abcdefgjxyz'),
1032
                        type => 'broader',
1033
                        search => $field->as_string('abcdefgjxyz'),
1034
                        authid => $field->subfield('9')
1035
                    };
1031
                } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
1036
                } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
1032
                    push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower' };
1037
                    push @seealso, {
1038
                        heading => $field->as_string('abcdefgjxyz'),
1039
                        type => 'narrower',
1040
                        search => $field->as_string('abcdefgjxyz'),
1041
                        authid => $field->subfield('9')
1042
                    };
1033
                } elsif ($field->subfield('a')) {
1043
                } elsif ($field->subfield('a')) {
1034
                    push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso' };
1044
                    push @seealso, {
1045
                        heading => $field->as_string('abcdefgxyz'),
1046
                        type => 'seealso',
1047
                        search => $field->as_string('abcdefgjxyz'),
1048
                        authid => $field->subfield('9')
1049
                    };
1035
                }
1050
                }
1036
            }
1051
            }
1037
# // form
1052
# // form
Lines 1079-1098 sub BuildSummary { Link Here
1079
            } #See From
1094
            } #See From
1080
            foreach my $field ($record->field('4..')) {
1095
            foreach my $field ($record->field('4..')) {
1081
                my $type = 'seefrom';
1096
                my $type = 'seefrom';
1082
                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
1097
                $type = ($marc21controlrefs{substr $field->subfield('w'), '0'} || '') if ($field->subfield('w'));
1083
                if ($type eq 'subfi') {
1098
                if ($type eq 'subfi') {
1084
                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
1099
                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') || '' };
1085
                } else {
1100
                } else {
1086
                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $type };
1101
                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $type || '' };
1087
                }
1102
                }
1088
            } #See Also
1103
            } #See Also
1089
            foreach my $field ($record->field('5..')) {
1104
            foreach my $field ($record->field('5..')) {
1090
                my $type = 'seealso';
1105
                my $type = 'seealso';
1091
                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
1106
                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
1092
                if ($type eq 'subfi') {
1107
                if ($type eq 'subfi') {
1093
                    push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
1108
                    push @seealso, {
1109
                        heading => $field->as_string($marc21subfields),
1110
                        type => $field->subfield('i') || '',
1111
                        search => $field->as_string($marc21subfields) || '',
1112
                        authid => $field->subfield('9') || ''
1113
                    };
1094
                } else {
1114
                } else {
1095
                    push @seealso, { heading => $field->as_string($marc21subfields), type => $type };
1115
                    push @seealso, {
1116
                        heading => $field->as_string($marc21subfields),
1117
                        type => $type || '',
1118
                        search => $field->as_string($marc21subfields) || '',
1119
                        authid => $field->subfield('9') || ''
1120
                    };
1096
                }
1121
                }
1097
            }
1122
            }
1098
            foreach my $field ($record->field('6..')) {
1123
            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 %]</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/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>[% authtypetext %]</td>
61
                    <td>[% authtypetext %]</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