|
Lines 70-80
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 70 |
} |
70 |
} |
| 71 |
); |
71 |
); |
| 72 |
|
72 |
|
|
|
73 |
# Extract the tag number from the index |
| 74 |
my $tag_number = $index; |
| 75 |
$tag_number =~ s/^tag_(\d*)_.*$/$1/; |
| 76 |
|
| 73 |
# fill arrays |
77 |
# fill arrays |
| 74 |
my @subfield_loop; |
78 |
my @subfield_loop; |
| 75 |
my ($indicator1, $indicator2); |
79 |
my ($indicator1, $indicator2); |
| 76 |
if ($authid) { |
80 |
if ($authid) { |
| 77 |
my $authtypecode = Koha::Authorities->find($authid)->authtypecode; |
81 |
my $auth = Koha::Authorities->find( $authid ); |
|
|
82 |
my $authtypecode = $auth ? $auth->authtypecode : q{}; |
| 78 |
my $auth_type = Koha::Authority::Types->find($authtypecode); |
83 |
my $auth_type = Koha::Authority::Types->find($authtypecode); |
| 79 |
my $record = GetAuthority($authid); |
84 |
my $record = GetAuthority($authid); |
| 80 |
my @fields = $record->field( $auth_type->auth_tag_to_report ); |
85 |
my @fields = $record->field( $auth_type->auth_tag_to_report ); |
|
Lines 98-153
if ($authid) {
Link Here
|
| 98 |
} |
103 |
} |
| 99 |
|
104 |
|
| 100 |
push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship ); |
105 |
push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship ); |
| 101 |
if (C4::Context->preference('marcflavour') eq 'UNIMARC') { |
106 |
|
| 102 |
$indicator1 = $field->indicator('1'); |
107 |
my $controlled_ind = $auth->controlled_indicators({ record => $record, biblio_tag => $tag_number }); |
| 103 |
$indicator2 = $field->indicator('2'); |
108 |
$indicator1 = $controlled_ind->{ind1} // q{}; |
| 104 |
} elsif (C4::Context->preference('marcflavour') eq 'MARC21') { |
109 |
$indicator2 = $controlled_ind->{ind2} // q{}; |
| 105 |
my $tag_from = $auth_type->auth_tag_to_report; |
110 |
if( defined $controlled_ind->{sub2} ) { |
| 106 |
my $tag_to = $index; |
111 |
my $v = $controlled_ind->{sub2}; |
| 107 |
$tag_to =~ s/^tag_(\d*)_.*$/$1/; |
112 |
push @subfield_loop, { marc_subfield => '2', marc_values => [ $v ] }; |
| 108 |
if ($tag_to =~ /^6/) { # subject heading |
|
|
| 109 |
my %thes_mapping = qw / a 0 |
| 110 |
b 1 |
| 111 |
c 2 |
| 112 |
d 3 |
| 113 |
k 5 |
| 114 |
n 4 |
| 115 |
r 7 |
| 116 |
s 7 |
| 117 |
v 6 |
| 118 |
z 7 |
| 119 |
| 4 /; |
| 120 |
my $thes_008_11 = ''; |
| 121 |
$thes_008_11 = substr($record->field('008')->data(), 11, 1) if $record->field('008')->data(); |
| 122 |
$indicator2 = defined $thes_mapping{$thes_008_11} ? $thes_mapping{$thes_008_11} : $thes_008_11; |
| 123 |
if ($indicator2 eq '7') { |
| 124 |
if ($thes_008_11 eq 'r') { |
| 125 |
push @subfield_loop, { marc_subfield => '2', marc_values => [ 'aat' ] }; |
| 126 |
} elsif ($thes_008_11 eq 's') { |
| 127 |
push @subfield_loop, { marc_subfield => '2', marc_values => [ 'sears' ] }; |
| 128 |
} |
| 129 |
} |
| 130 |
} |
| 131 |
if ($tag_from eq '130') { # unified title -- the special case |
| 132 |
if ($tag_to eq '830' || $tag_to eq '240') { |
| 133 |
$indicator2 = $field->indicator('2'); |
| 134 |
} else { |
| 135 |
$indicator1 = $field->indicator('2'); |
| 136 |
} |
| 137 |
} else { |
| 138 |
$indicator1 = $field->indicator('1'); |
| 139 |
} |
| 140 |
} |
113 |
} |
| 141 |
} |
114 |
} else { |
| 142 |
else { |
|
|
| 143 |
# authid is empty => the user want to empty the entry. |
115 |
# authid is empty => the user want to empty the entry. |
| 144 |
$template->param( "clear" => 1 ); |
116 |
$template->param( "clear" => 1 ); |
| 145 |
} |
117 |
} |
| 146 |
|
118 |
|
| 147 |
# Extract the tag number from the index |
|
|
| 148 |
my $tag_number = $index; |
| 149 |
$tag_number =~ s/^tag_(\d*)_.*$/$1/; |
| 150 |
|
| 151 |
# Remove spaces in indicators |
119 |
# Remove spaces in indicators |
| 152 |
$indicator1 =~ s/\s//g; |
120 |
$indicator1 =~ s/\s//g; |
| 153 |
$indicator2 =~ s/\s//g; |
121 |
$indicator2 =~ s/\s//g; |
|
Lines 163-166
$template->param(
Link Here
|
| 163 |
); |
131 |
); |
| 164 |
|
132 |
|
| 165 |
output_html_with_http_headers $query, $cookie, $template->output; |
133 |
output_html_with_http_headers $query, $cookie, $template->output; |
| 166 |
|
|
|