| 
      
            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({ frameworkcode => '' }); | 
            
            
              | 307 | 
              my %tab_for_authfield;  | 
            
            
              | 308 | 
              foreach my $ass (@ass) { | 
            
            
              | 309 | 
                  next if $ass->tab < 0;  | 
            
            
              | 310 | 
                  next if exists $tab_for_authfield{$ass->tagfield}; | 
            
            
              | 311 | 
                  $tab_for_authfield{$ass->tagfield} = $ass->tab; | 
            
            
              | 312 | 
              }  | 
            
            
              | 313 | 
               | 
            
        
          | 293 | 
          my $authsubfield_defaults = $defaults->{authsubfield}; | 
          314 | 
          my $authsubfield_defaults = $defaults->{authsubfield}; | 
        
        
          | 294 | 
          for my $authsubfield (@authsubfields) { | 
          315 | 
          for my $authsubfield (@authsubfields) { | 
        
        
          | 295 | 
              foreach my $key (keys %$authsubfield_defaults) { | 
          316 | 
              foreach my $key (keys %$authsubfield_defaults) { | 
        
  
    | 
      
            Lines 299-304
          for my $authsubfield (@authsubfields) {
      
      
        Link Here
      
     | 
  
        
          | 299 | 
              }  | 
          320 | 
              }  | 
        
        
          | 300 | 
              $authsubfield->{liblibrarian} = t($authsubfield->{liblibrarian}); | 
          321 | 
              $authsubfield->{liblibrarian} = t($authsubfield->{liblibrarian}); | 
        
        
          | 301 | 
           | 
          322 | 
           | 
        
            
               | 
               | 
              323 | 
                  # If other subfields exist in this field, use the same tab  | 
            
            
              | 324 | 
                  if (exists $tab_for_authfield{$authsubfield->{tagfield}}) { | 
            
            
              | 325 | 
                      $authsubfield->{tab} = $tab_for_authfield{$authsubfield->{tagfield}}; | 
            
            
              | 326 | 
                  }  | 
            
            
              | 327 | 
               | 
            
        
          | 302 | 
              my $ass = $auth_subfield_structure_rs->find($authsubfield->{authtypecode}, $authsubfield->{tagfield}, $authsubfield->{tagsubfield}); | 
          328 | 
              my $ass = $auth_subfield_structure_rs->find($authsubfield->{authtypecode}, $authsubfield->{tagfield}, $authsubfield->{tagsubfield}); | 
        
        
          | 303 | 
              if ($ass) { | 
          329 | 
              if ($ass) { | 
        
        
          | 304 | 
                  say sprintf('Auth subfield already exists: %s$%s (%s)', $authsubfield->{tagfield}, $authsubfield->{tagsubfield}, $authsubfield->{authtypecode}); | 
          330 | 
                  say sprintf('Auth subfield already exists: %s$%s (%s)', $authsubfield->{tagfield}, $authsubfield->{tagsubfield}, $authsubfield->{authtypecode}); | 
        
            
              | 305 | 
              -   | 
               | 
               |