return scalar @tab;
} else {
### ZOOM search here
- my $oConnection=C4::Context->Zconn("biblioserver",1);
my $query;
$query= "an=".$authid;
- my $oResult = $oConnection->search(new ZOOM::Query::CCL2RPN( $query, $oConnection ));
- my $result;
- while ((my $i = ZOOM::event([ $oConnection ])) != 0) {
- my $ev = $oConnection->last_event();
- if ($ev == ZOOM::Event::ZEND) {
- $result = $oResult->size();
- }
- }
+ my ($err,$res,$result) = C4::Search::SimpleSearch($query,0,10);
return ($result);
}
}
use C4::Context;
use C4::AuthoritiesMarc;
use utf8;
+use open qw( :std :utf8 );
+
my $dbh=C4::Context->dbh;
my $datatypes_query = $dbh->prepare(<<ENDSQL);
SELECT authtypecode,authtypetext,auth_tag_to_report from auth_types;
ENDSQL
$data_query->execute;
my $dataauthorities=$data_query->fetchall_arrayref({});
-print "id;authtype;heading;count usage\n";
foreach my $authority (@$dataauthorities){
my $marcauthority=GetAuthority($authority->{'authid'});
+ my $query;
+ $query= "an=".$authority->{'authid'};
+ # search for biblios mapped
+ my ($err,$res,$used) = C4::Search::SimpleSearch($query,0,10);
if ($marcauthority && $marcauthority->field($authtypes{$authority->{'authtypecode'}}->{'tag'})){
- print qq($authority->{'authid'};"),$authtypes{$authority->{'authtypecode'}}->{'lib'},qq(";"),$marcauthority->field($authtypes{$authority->{'authtypecode'}}->{"tag"})->as_string(),qq(";), CountUsage($authority->{authid}),"\n";
+ print qq("),$marcauthority->field($authtypes{$authority->{'authtypecode'}}->{"tag"})->as_string(),qq(";),qq($authority->{'authid'};"),$authtypes{$authority->{'authtypecode'}}->{'lib'},qq(";$used\n);
}
}