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

(-)a/authorities/blinddetail-biblio-search.pl (-4 / +18 lines)
Lines 57-64 my $dbh = C4::Context->dbh; Link Here
57
my $authid       = $query->param('authid');
57
my $authid       = $query->param('authid');
58
my $index        = $query->param('index');
58
my $index        = $query->param('index');
59
my $tagid        = $query->param('tagid');
59
my $tagid        = $query->param('tagid');
60
my $source       = $query->param('source');
60
my $relationship = $query->param('relationship');
61
my $relationship = $query->param('relationship');
61
62
63
my $marcflavour  = C4::Context->preference("marcflavour");
64
62
# open template
65
# open template
63
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
66
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
64
    {
67
    {
Lines 89-95 if ($authid) { Link Here
89
    # Get all values for each distinct subfield and add to subfield loop
92
    # Get all values for each distinct subfield and add to subfield loop
90
    my %done_subfields;
93
    my %done_subfields;
91
    for ( $field->subfields ) {
94
    for ( $field->subfields ) {
92
        next if $_->[0] eq '9'; # $9 will be set with authid value
95
        next if $_->[0] eq '3'; # $3 will be set with authid value (in UNIMARC authorities)
96
        next if $_->[0] eq '9'; # $9 will be set with authid value (in MARC21/NORMARC authorities and also MARC21/NORMARC/UNIMARC biblios)
93
        my $letter = $_->[0];
97
        my $letter = $_->[0];
94
        $letter ||= '@';
98
        $letter ||= '@';
95
        next if defined $done_subfields{$letter};
99
        next if defined $done_subfields{$letter};
Lines 98-104 if ($authid) { Link Here
98
        $done_subfields{$letter} = 1;
102
        $done_subfields{$letter} = 1;
99
    }
103
    }
100
104
101
    push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship );
105
    # If a relationship code has been selected, add it to the appropriate
106
    # subfield of @subfield_loop, depending on the MARC flavour being used.
107
    if ( $relationship ) {
108
        my $relationship_subfield;
109
        if ( $marcflavour eq 'UNIMARC' ) {
110
            $relationship_subfield = '5';
111
        } elsif ( $marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC' ) {
112
            $relationship_subfield = 'w';
113
        }
114
        push( @subfield_loop, { marc_subfield => $relationship_subfield, marc_values => $relationship } ) ;
115
    }
102
116
103
    my $controlled_ind = $auth->controlled_indicators({ record => $record, biblio_tag => $tag_number });
117
    my $controlled_ind = $auth->controlled_indicators({ record => $record, biblio_tag => $tag_number });
104
    $indicator1 = $controlled_ind->{ind1};
118
    $indicator1 = $controlled_ind->{ind1};
Lines 112-120 if ($authid) { Link Here
112
    $template->param( "clear" => 1 );
126
    $template->param( "clear" => 1 );
113
}
127
}
114
128
115
116
117
$template->param(
129
$template->param(
130
    source          => $source,
131
    marcflavour     => $marcflavour,
118
    authid          => $authid ? $authid : "",
132
    authid          => $authid ? $authid : "",
119
    index           => $index,
133
    index           => $index,
120
    tagid           => $tagid,
134
    tagid           => $tagid,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-2 / +13 lines)
Lines 35-41 Link Here
35
                    [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
35
                    [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
36
                        [%- marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html -%]
36
                        [%- marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html -%]
37
                    [%- END -%]
37
                    [%- END -%]
38
                [%- END -%]‡9[% authid | html %]";
38
                [%- END -%][% IF ( marcflavour == 'UNIMARC' ) %]‡3[% authid %]";
39
                [% ELSIF ( marcflavour == 'MARC21' ) || ( marcflavour == 'NORMARC' ) %]‡9[% authid %]";
40
                [% END %]
39
                [% END %]
41
                [% END %]
40
                RancorReplaceField( new_line, "[% indicator1 | html %]", "[% indicator2 | html %]" );
42
                RancorReplaceField( new_line, "[% indicator1 | html %]", "[% indicator2 | html %]" );
41
            [% ELSE %]
43
            [% ELSE %]
Lines 135-141 Link Here
135
                [% IF ( clear ) %]
137
                [% IF ( clear ) %]
136
                    if (subfield){subfield.value="" ;}
138
                    if (subfield){subfield.value="" ;}
137
                [% ELSE %]
139
                [% ELSE %]
138
                    if(code.value=='9'){
140
                [% IF ( marcflavour == 'UNIMARC' ) %]
141
                    [% IF ( source == 'auth' ) %]
142
                        var authid_subfield = "3";
143
                    [% ELSIF ( source == 'biblio' ) %]
144
                        var authid_subfield = "9";
145
                    [% END %]
146
                [% ELSIF ( marcflavour == 'MARC21' ) || ( marcflavour == 'NORMARC' ) %]
147
                    var authid_subfield = "9";
148
                [% END %]
149
                    if(code.value==authid_subfield){
139
                        subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
150
                        subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
140
                        break;
151
                        break;
141
                    }
152
                    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt (-6 / +6 lines)
Lines 99-112 Link Here
99
        }
99
        }
100
100
101
        function doauth(authid, index, repet){
101
        function doauth(authid, index, repet){
102
            [% IF source == 'auth' %]
102
            var source = "[% source %]";
103
            if ( source == 'auth' ) {
103
                var e = document.getElementById("relationship");
104
                var e = document.getElementById("relationship");
104
                var relationship = e.options[e.selectedIndex].value;
105
                var relationship = e.options[e.selectedIndex].value;
105
106
106
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
107
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&source=' + source + '&relationship=' + relationship);
107
            [% ELSE %]
108
            } else {
108
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
109
                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&source=' + source);
109
            [% END %]
110
            }
110
        }
111
        }
111
    </script>
112
    </script>
112
[% END %]
113
[% END %]
113
- 

Return to bug 21453