Lines 222-227
for my $tag (@tags) {
Link Here
|
222 |
$marc_tag_structure_rs->create($tag); |
222 |
$marc_tag_structure_rs->create($tag); |
223 |
} |
223 |
} |
224 |
|
224 |
|
|
|
225 |
my @mss = $marc_subfield_structure_rs->search({ frameworkcode => '' }); |
226 |
my %tab_for_field; |
227 |
foreach my $mss (@mss) { |
228 |
next if $mss->tab < 0; |
229 |
next if exists $tab_for_field{$mss->tagfield}; |
230 |
$tab_for_field{$mss->tagfield} = $mss->tab; |
231 |
} |
232 |
|
225 |
my $subfield_defaults = $defaults->{subfield}; |
233 |
my $subfield_defaults = $defaults->{subfield}; |
226 |
for my $subfield (@subfields) { |
234 |
for my $subfield (@subfields) { |
227 |
foreach my $key (keys %$subfield_defaults) { |
235 |
foreach my $key (keys %$subfield_defaults) { |
Lines 231-236
for my $subfield (@subfields) {
Link Here
|
231 |
} |
239 |
} |
232 |
$subfield->{liblibrarian} = t($subfield->{liblibrarian}); |
240 |
$subfield->{liblibrarian} = t($subfield->{liblibrarian}); |
233 |
|
241 |
|
|
|
242 |
# If other subfields exist in this field, use the same tab |
243 |
if (exists $tab_for_field{$subfield->{tagfield}}) { |
244 |
$subfield->{tab} = $tab_for_field{$subfield->{tagfield}}; |
245 |
} |
246 |
|
234 |
my $mss = $marc_subfield_structure_rs->find('', $subfield->{tagfield}, $subfield->{tagsubfield}); |
247 |
my $mss = $marc_subfield_structure_rs->find('', $subfield->{tagfield}, $subfield->{tagsubfield}); |
235 |
if ($mss) { |
248 |
if ($mss) { |
236 |
say sprintf('Subfield already exists: %s$%s', $subfield->{tagfield}, $subfield->{tagsubfield}); |
249 |
say sprintf('Subfield already exists: %s$%s', $subfield->{tagfield}, $subfield->{tagsubfield}); |
Lines 290-295
for my $authtag (@authtags) {
Link Here
|
290 |
$auth_tag_structure_rs->create($authtag); |
303 |
$auth_tag_structure_rs->create($authtag); |
291 |
} |
304 |
} |
292 |
|
305 |
|
|
|
306 |
my @ass = $auth_subfield_structure_rs->search(); |
307 |
my %tab_for_authfield; |
308 |
foreach my $ass (@ass) { |
309 |
my $authtypecode = $ass->get_column('authtypecode'); |
310 |
$tab_for_authfield{$authtypecode} //= {}; |
311 |
|
312 |
next if $ass->tab < 0; |
313 |
next if exists $tab_for_authfield{$authtypecode}->{$ass->tagfield}; |
314 |
|
315 |
$tab_for_authfield{$authtypecode}->{$ass->tagfield} = $ass->tab; |
316 |
} |
317 |
|
293 |
my $authsubfield_defaults = $defaults->{authsubfield}; |
318 |
my $authsubfield_defaults = $defaults->{authsubfield}; |
294 |
for my $authsubfield (@authsubfields) { |
319 |
for my $authsubfield (@authsubfields) { |
295 |
foreach my $key (keys %$authsubfield_defaults) { |
320 |
foreach my $key (keys %$authsubfield_defaults) { |
Lines 299-304
for my $authsubfield (@authsubfields) {
Link Here
|
299 |
} |
324 |
} |
300 |
$authsubfield->{liblibrarian} = t($authsubfield->{liblibrarian}); |
325 |
$authsubfield->{liblibrarian} = t($authsubfield->{liblibrarian}); |
301 |
|
326 |
|
|
|
327 |
# If other subfields exist in this field, use the same tab |
328 |
if (exists $tab_for_authfield{$authsubfield->{authtypecode}}->{$authsubfield->{tagfield}}) { |
329 |
$authsubfield->{tab} = $tab_for_authfield{$authsubfield->{authtypecode}}->{$authsubfield->{tagfield}}; |
330 |
} |
331 |
|
302 |
my $ass = $auth_subfield_structure_rs->find($authsubfield->{authtypecode}, $authsubfield->{tagfield}, $authsubfield->{tagsubfield}); |
332 |
my $ass = $auth_subfield_structure_rs->find($authsubfield->{authtypecode}, $authsubfield->{tagfield}, $authsubfield->{tagsubfield}); |
303 |
if ($ass) { |
333 |
if ($ass) { |
304 |
say sprintf('Auth subfield already exists: %s$%s (%s)', $authsubfield->{tagfield}, $authsubfield->{tagsubfield}, $authsubfield->{authtypecode}); |
334 |
say sprintf('Auth subfield already exists: %s$%s (%s)', $authsubfield->{tagfield}, $authsubfield->{tagsubfield}, $authsubfield->{authtypecode}); |
305 |
- |
|
|