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; |