View | Details | Raw Unified | Return to bug 5926
Collapse All | Expand All

(-)a/C4/AuthoritiesMarc.pm (-5 / +9 lines)
Lines 1181-1196 sub BuildUnimarcHierarchy{ Link Here
1181
  my $class = shift @_;
1181
  my $class = shift @_;
1182
  my $authid_constructed = shift @_;
1182
  my $authid_constructed = shift @_;
1183
  return undef unless ($record);
1183
  return undef unless ($record);
1184
  my $authid=$record->subfield('2..','3');
1184
  my $authid=$record->field('001')->data();
1185
  my %cell;
1185
  my %cell;
1186
  my $parents=""; my $children="";
1186
  my $parents=""; my $children="";
1187
  my (@loopparents,@loopchildren);
1187
  my (@loopparents,@loopchildren);
1188
  foreach my $field ($record->field('550')){
1188
  foreach my $field ($record->field('5..')){
1189
	my $subfauthid=_get_authid_subfield($field);
1189
    if ($field->subfield('5') && $field->subfield('a')){
1190
    if ($field->subfield('5') && $field->subfield('a')){
1190
      if ($field->subfield('5') eq 'h'){
1191
      if ($field->subfield('5') eq 'h'){
1191
        push @loopchildren, { "childauthid"=>$field->subfield('3'),"childvalue"=>$field->subfield('a')};
1192
        push @loopchildren, { "childauthid"=>$subfauthid,"childvalue"=>$field->subfield('a')};
1192
      }elsif ($field->subfield('5') eq 'g'){
1193
      }elsif ($field->subfield('5') eq 'g'){
1193
        push @loopparents, { "parentauthid"=>$field->subfield('3'),"parentvalue"=>$field->subfield('a')};
1194
        push @loopparents, { "parentauthid"=>$subfauthid,"parentvalue"=>$field->subfield('a')};
1194
      }
1195
      }
1195
          # brothers could get in there with an else
1196
          # brothers could get in there with an else
1196
    }
1197
    }
Lines 1206-1211 sub BuildUnimarcHierarchy{ Link Here
1206
  return \%cell;
1207
  return \%cell;
1207
}
1208
}
1208
1209
1210
sub _get_authid_subfield{
1211
    my ($field)=@_;
1212
    return $field->subfield('9')||$field->subfield('3');
1213
}
1209
=head2 GetHeaderAuthority
1214
=head2 GetHeaderAuthority
1210
1215
1211
  $ref= &GetHeaderAuthority( $authid)
1216
  $ref= &GetHeaderAuthority( $authid)
1212
- 

Return to bug 5926