5 use C4
::AuthoritiesMarc
;
7 use open qw( :std :utf8 );
9 my $dbh=C4
::Context
->dbh;
10 my $datatypes_query = $dbh->prepare(<<ENDSQL);
11 SELECT authtypecode,authtypetext,auth_tag_to_report from auth_types;
13 $datatypes_query->execute;
14 my $datatypes=$datatypes_query->fetchall_arrayref({});
16 map { $authtypes{$_->{'authtypecode'}}={"tag"=> $_->{'auth_tag_to_report'}, "lib"=> $_->{'authtypetext'}};} @
$datatypes;
17 my $data_query = $dbh->prepare(<<ENDSQL);
18 SELECT authid, authtypecode from auth_header
21 my $dataauthorities=$data_query->fetchall_arrayref({});
22 foreach my $authority (@
$dataauthorities){
23 my $marcauthority=GetAuthority
($authority->{'authid'});
25 $query= "an=".$authority->{'authid'};
26 # search for biblios mapped
27 my ($err,$res,$used) = C4
::Search
::SimpleSearch
($query,0,10);
31 if ($marcauthority && $marcauthority->field($authtypes{$authority->{'authtypecode'}}->{'tag'})){
32 print qq("),$marcauthority->field($authtypes{$authority->{'authtypecode'}}->{"tag
"})->as_string(),qq(";),qq($authority->{'authid'};"),$authtypes{$authority->{'authtypecode'}}->{'lib'},qq(";$used\n);