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

(-)a/authorities/blinddetail-biblio-search.pl (-3 / +19 lines)
Lines 55-60 my $authid = $query->param('authid'); Link Here
55
my $index        = $query->param('index');
55
my $index        = $query->param('index');
56
my $tagid        = $query->param('tagid');
56
my $tagid        = $query->param('tagid');
57
my $relationship = $query->param('relationship');
57
my $relationship = $query->param('relationship');
58
my $source       = $query->param('source');
59
my $marcflavour  = C4::Context->preference("marcflavour");
58
60
59
# open template
61
# open template
60
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 85-91 if ($authid) { Link Here
85
    # Get all values for each distinct subfield and add to subfield loop
87
    # Get all values for each distinct subfield and add to subfield loop
86
    my %done_subfields;
88
    my %done_subfields;
87
    for ( $field->subfields ) {
89
    for ( $field->subfields ) {
88
        next if $_->[0] eq '9';    # $9 will be set with authid value
90
        if ( $marcflavour eq 'UNIMARC' ) {
91
            next if $_->[0] eq '3';    # $3 will be set with authid value (in UNIMARC authority records)
92
        }
93
        next if $_->[0] eq '9';        # $9 will be set with authid value
89
        my $letter = $_->[0];
94
        my $letter = $_->[0];
90
        $letter ||= '@';
95
        $letter ||= '@';
91
        next if defined $done_subfields{$letter};
96
        next if defined $done_subfields{$letter};
Lines 94-100 if ($authid) { Link Here
94
        $done_subfields{$letter} = 1;
99
        $done_subfields{$letter} = 1;
95
    }
100
    }
96
101
97
    push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ($relationship);
102
    # If a relationship code has been selected, add it to the appropriate
103
    # subfield of @subfield_loop, depending on the MARC flavour being used.
104
    if ($relationship) {
105
        my $relationship_subfield;
106
        if ( $marcflavour eq 'UNIMARC' ) {
107
            $relationship_subfield = '5';
108
        } elsif ( $marcflavour eq 'MARC21' ) {
109
            $relationship_subfield = 'w';
110
        }
111
        push @subfield_loop, { marc_subfield => $relationship_subfield, marc_values => $relationship };
112
    }
98
113
99
    # Copy the ISNI number over (should one exist) to subfield $o when linking
114
    # Copy the ISNI number over (should one exist) to subfield $o when linking
100
    # authorities with authorities in UNIMARC instances. This only applies to
115
    # authorities with authorities in UNIMARC instances. This only applies to
Lines 142-148 $template->param( Link Here
142
    indicator2    => $indicator2,
157
    indicator2    => $indicator2,
143
    SUBFIELD_LOOP => \@subfield_loop,
158
    SUBFIELD_LOOP => \@subfield_loop,
144
    tag_number    => $tag_number,
159
    tag_number    => $tag_number,
145
    rancor        => $index =~ /rancor$/,
160
    rancor        => ( $index =~ /rancor$/ ) ? 1 : 0,
161
    source        => $source,
146
);
162
);
147
163
148
output_html_with_http_headers $query, $cookie, $template->output;
164
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-2 / +16 lines)
Lines 1-6 Link Here
1
[% USE To %]
1
[% USE To %]
2
[% USE Koha %]
2
[% PROCESS 'i18n.inc' %]
3
[% PROCESS 'i18n.inc' %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
5
[% SET marcflavour = Koha.Preference('marcflavour') %]
4
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
5
<title
7
<title
6
    >[% FILTER collapse %]
8
    >[% FILTER collapse %]
Lines 38-44 Link Here
38
                        [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
40
                        [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
39
                            [%- To.json( marc_value ) | html -%]
41
                            [%- To.json( marc_value ) | html -%]
40
                        [%- END -%]
42
                        [%- END -%]
41
                    [%- END -%]‡9[% authid | html %]";
43
                    [%- END -%]
44
                    [% IF ( marcflavour == 'UNIMARC' ) %]‡3[% authid | html %]";
45
                    [% ELSIF ( marcflavour == 'MARC21' ) %]‡9[% authid | html %]";
46
                    [% END %]
42
                [% END %]
47
                [% END %]
43
                RancorReplaceField( new_line, "[% indicator1 | html %]", "[% indicator2 | html %]" );
48
                RancorReplaceField( new_line, "[% indicator1 | html %]", "[% indicator2 | html %]" );
44
            [% ELSE %]
49
            [% ELSE %]
Lines 167-173 Link Here
167
                    [% IF ( clear ) %]
172
                    [% IF ( clear ) %]
168
                        if (subfield){subfield.value="" ;}
173
                        if (subfield){subfield.value="" ;}
169
                    [% ELSE %]
174
                    [% ELSE %]
170
                        if(code.value=='9'){
175
                        [% IF ( marcflavour == 'UNIMARC' ) %]
176
                            [% IF ( source == 'auth' ) %]
177
                                var authid_subfield = "3";
178
                            [% ELSIF ( source == 'biblio' ) %]
179
                                var authid_subfield = "9";
180
                            [% END %]
181
                        [% ELSIF ( marcflavour == 'MARC21' ) %]
182
                            var authid_subfield = "9";
183
                        [% END %]
184
                        if(code.value==authid_subfield){
171
                            subfield.value = "[% To.json(authid) | $raw %]";
185
                            subfield.value = "[% To.json(authid) | $raw %]";
172
                            subfield.className = subfield.className.replace("no_matching_authority_field", "matching_authority_field");
186
                            subfield.className = subfield.className.replace("no_matching_authority_field", "matching_authority_field");
173
                            break;
187
                            break;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt (-6 / +6 lines)
Lines 154-167 Link Here
154
        }
154
        }
155
155
156
        function doauth(authid, index, repet){
156
        function doauth(authid, index, repet){
157
            [% IF source == 'auth' %]
157
            var source = "[% source %]";
158
            if ( source == 'auth' ) {
158
                var elem = document.getElementById("special_relationship");
159
                var elem = document.getElementById("special_relationship");
159
                var relationship = elem.options[elem.selectedIndex].value;
160
                var relationship = elem.options[elem.selectedIndex].value;
160
161
161
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
162
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&source=' + source + '&relationship=' + relationship);
162
            [% ELSE %]
163
            } else {
163
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
164
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&source=' + source);
164
            [% END %]
165
            }
165
        }
166
        }
166
    </script>
167
    </script>
167
[% END %]
168
[% END %]
168
- 

Return to bug 21453