Lines 122-128
Return a list of identifiers of the authors which are in 024$2$a
Link Here
|
122 |
=cut |
122 |
=cut |
123 |
|
123 |
|
124 |
sub get_identifiers { |
124 |
sub get_identifiers { |
125 |
my ( $self, $params ) = @_; |
125 |
my ( $self ) = @_; |
126 |
|
126 |
|
127 |
my $record = $self->record; |
127 |
my $record = $self->record; |
128 |
|
128 |
|
Lines 137-142
sub get_identifiers {
Link Here
|
137 |
return \@identifiers; |
137 |
return \@identifiers; |
138 |
} |
138 |
} |
139 |
|
139 |
|
|
|
140 |
=head3 get_information |
141 |
|
142 |
my $information = $author->get_information; |
143 |
|
144 |
Return a list of information of the authors (syspref OPACAuthorInformation) |
145 |
|
146 |
=cut |
147 |
|
148 |
sub get_information { |
149 |
my ($self) = @_; |
150 |
|
151 |
my $record = $self->record; |
152 |
|
153 |
# FIXME UNIMARC not supported yet. |
154 |
return if C4::Context->preference('marcflavour') eq 'UNIMARC'; |
155 |
|
156 |
my $information; |
157 |
for my $info ( split ',', C4::Context->preference('OPACAuthorInformation') ) { |
158 |
if ( $info eq 'activity' ) { |
159 |
|
160 |
# activity: Activity (372$a$s$t) |
161 |
for my $field ( $record->field('372') ) { |
162 |
my $sf_a = $field->subfield('a'); |
163 |
my $sf_s = $field->subfield('s'); |
164 |
my $sf_t = $field->subfield('t'); |
165 |
push @{ $information->{activity} }, |
166 |
{ field_of_activity => $sf_a, start_period => $sf_s, end_period => $sf_t, }; |
167 |
} |
168 |
} elsif ( $info eq 'address' ) { |
169 |
|
170 |
# address: Address (371$a$b$d$e) |
171 |
for my $field ( $record->field('371') ) { |
172 |
my $sf_a = $field->subfield('a'); |
173 |
my $sf_b = $field->subfield('b'); |
174 |
my $sf_d = $field->subfield('d'); |
175 |
my $sf_e = $field->subfield('e'); |
176 |
push @{ $information->{address} }, |
177 |
{ address => $sf_a, city => $sf_b, country => $sf_d, postal_code => $sf_e, }; |
178 |
} |
179 |
} elsif ( $info eq 'associated_group' ) { |
180 |
|
181 |
# associated_group: Associated group (373$a$s$t$u$v$0) |
182 |
for my $field ( $record->field('373') ) { |
183 |
my $sf_a = $field->subfield('a'); |
184 |
my $sf_s = $field->subfield('s'); |
185 |
my $sf_t = $field->subfield('t'); |
186 |
my $sf_u = $field->subfield('u'); |
187 |
my $sf_v = $field->subfield('v'); |
188 |
my $sf_0 = $field->subfield('0'); |
189 |
push @{ $information->{associated_group} }, |
190 |
{ |
191 |
associated_group => $sf_a, start_period => $sf_s, end_period => $sf_t, uri => $sf_u, |
192 |
source_of_information => $sf_v, authority_record_number => $sf_0, |
193 |
}; |
194 |
} |
195 |
} elsif ( $info eq 'email_address' ) { |
196 |
|
197 |
# email_address: Electronic mail address (371$m) |
198 |
for my $field ( $record->field('371') ) { |
199 |
my $sf_m = $field->subfield('m'); |
200 |
push @{ $information->{email_address} }, { email_address => $sf_m, }; |
201 |
} |
202 |
} elsif ( $info eq 'occupation' ) { |
203 |
|
204 |
# occupation: Occupation (374$a$s$t$u$v$0) |
205 |
for my $field ( $record->field('374') ) { |
206 |
my $sf_a = $field->subfield('a'); |
207 |
my $sf_s = $field->subfield('s'); |
208 |
my $sf_t = $field->subfield('t'); |
209 |
my $sf_u = $field->subfield('u'); |
210 |
my $sf_v = $field->subfield('v'); |
211 |
my $sf_0 = $field->subfield('0'); |
212 |
push @{ $information->{occupation} }, |
213 |
{ |
214 |
occupation => $sf_a, start_period => $sf_s, end_period => $sf_t, uri => $sf_u, |
215 |
source_of_information => $sf_v, authority_record_number => $sf_0, |
216 |
}; |
217 |
} |
218 |
} elsif ( $info eq 'place_of_birth' ) { |
219 |
|
220 |
# place_of_birth: Place of birth (370$a) |
221 |
for my $field ( $record->field('370') ) { |
222 |
my $sf_a = $field->subfield('a'); |
223 |
push @{ $information->{place_of_birth} }, { place_of_birth => $sf_a, }; |
224 |
} |
225 |
} elsif ( $info eq 'place_of_death' ) { |
226 |
|
227 |
# place_of_death: Place of death (370$b) |
228 |
for my $field ( $record->field('370') ) { |
229 |
my $sf_b = $field->subfield('b'); |
230 |
push @{ $information->{place_of_death} }, { place_of_death => $sf_b, }; |
231 |
} |
232 |
} elsif ( $info eq 'uri' ) { |
233 |
|
234 |
# uri: URI (371$u) |
235 |
for my $field ( $record->field('371') ) { |
236 |
my $sf_u = $field->subfield('u'); |
237 |
push @{ $information->{uri} }, { uri => $sf_u, }; |
238 |
} |
239 |
} |
240 |
} |
241 |
|
242 |
return $information; |
243 |
} |
244 |
|
245 |
|
140 |
=head3 record |
246 |
=head3 record |
141 |
|
247 |
|
142 |
my $record = $authority->record() |
248 |
my $record = $authority->record() |