| 
      
            Lines 63-68
          BEGIN {
      
      
        Link Here
      
     | 
  
        
          | 63 | 
              	&FindDuplicateAuthority  | 
          63 | 
              	&FindDuplicateAuthority  | 
        
        
          | 64 | 
           | 
          64 | 
           | 
        
        
          | 65 | 
                  &GuessAuthTypeCode  | 
          65 | 
                  &GuessAuthTypeCode  | 
        
            
               | 
               | 
              66 | 
                      &RetrieveAuthTypeFromAuthority008  | 
            
        
          | 66 | 
                  &GuessAuthId  | 
          67 | 
                  &GuessAuthId  | 
        
        
          | 67 | 
           	);  | 
          68 | 
           	);  | 
        
        
          | 68 | 
          }  | 
          69 | 
          }  | 
        
  
    | 
      
            Lines 331-337
          Get the record and tries to guess the adequate authtypecode from its content.
      
      
        Link Here
      
     | 
  
        
          | 331 | 
          sub GuessAuthTypeCode { | 
          332 | 
          sub GuessAuthTypeCode { | 
        
        
          | 332 | 
              my ($record, $heading_fields) = @_;  | 
          333 | 
              my ($record, $heading_fields) = @_;  | 
        
        
          | 333 | 
              return unless defined $record;  | 
          334 | 
              return unless defined $record;  | 
        
          
            
              | 334 | 
                  return '' if C4::Preferences('UseAuthority008AsAuthType'); | 
              335 | 
                  return '' if C4::Context->preference('UseAuthority008AsAuthType'); | 
            
        
          | 335 | 
              $heading_fields //= { | 
          336 | 
              $heading_fields //= { | 
        
        
          | 336 | 
              "MARC21"=>{ | 
          337 | 
              "MARC21"=>{ | 
        
        
          | 337 | 
                  '100'=>{authtypecode=>'PERSO_NAME'}, | 
          338 | 
                  '100'=>{authtypecode=>'PERSO_NAME'}, | 
        
  
    | 
      
            Lines 396-401
          sub GuessAuthTypeCode {
      
      
        Link Here
      
     | 
  
        
          | 396 | 
              return;  | 
          397 | 
              return;  | 
        
        
          | 397 | 
          }  | 
          398 | 
          }  | 
        
        
          | 398 | 
           | 
          399 | 
           | 
        
            
               | 
               | 
              400 | 
              =head2 RetrieveAuthTypeFromAuthority008  | 
            
            
              | 401 | 
               | 
            
            
              | 402 | 
                 my $type = RetrieveAuthTypeFromAuthority008  | 
            
            
              | 403 | 
               | 
            
            
              | 404 | 
              If the UseAuthority008AsAuthType syspref is enabled then retrieve the multiple authority types from the authority 008 positions 14-16  | 
            
            
              | 405 | 
               | 
            
            
              | 406 | 
              =cut  | 
            
            
              | 407 | 
               | 
            
            
              | 408 | 
              sub RetrieveAuthTypeFromAuthority008 { | 
            
            
              | 409 | 
               | 
            
            
              | 410 | 
                  my ($record) = @_;  | 
            
            
              | 411 | 
                  return unless ($record && $record->field('008')); | 
            
            
              | 412 | 
               | 
            
            
              | 413 | 
                  my $name = 0;  | 
            
            
              | 414 | 
                  my $subject= 0;  | 
            
            
              | 415 | 
                  my $series = 0;  | 
            
            
              | 416 | 
                  my $pos14 = substr($record->field('008')->data, 14, 1); | 
            
            
              | 417 | 
                  my $pos15 = substr($record->field('008')->data, 15, 1); | 
            
            
              | 418 | 
                  my $pos16 = substr($record->field('008')->data, 16, 1); | 
            
            
              | 419 | 
               | 
            
            
              | 420 | 
                  $name = 1 if $pos14 eq 'a';  | 
            
            
              | 421 | 
                  $subject= 1 if $pos15 eq 'a';  | 
            
            
              | 422 | 
                  $series = 1 if $pos16 eq 'a';  | 
            
            
              | 423 | 
               | 
            
            
              | 424 | 
                  my %authtypes = ( 'name' => $name, 'subject' => $subject, 'series' => $series);  | 
            
            
              | 425 | 
                  return \%authtypes;  | 
            
            
              | 426 | 
              }  | 
            
            
              | 427 | 
               | 
            
        
          | 399 | 
          =head2 GuessAuthId  | 
          428 | 
          =head2 GuessAuthId  | 
        
        
          | 400 | 
           | 
          429 | 
           | 
        
        
          | 401 | 
            my $authtid = GuessAuthId($record);  | 
          430 | 
            my $authtid = GuessAuthId($record);  |