Lines 51-58
BEGIN {
Link Here
|
51 |
&GetAuthority |
51 |
&GetAuthority |
52 |
&GetAuthorityXML |
52 |
&GetAuthorityXML |
53 |
|
53 |
|
54 |
&CountUsage |
|
|
55 |
&CountUsageChildren |
56 |
&SearchAuthorities |
54 |
&SearchAuthorities |
57 |
|
55 |
|
58 |
&BuildSummary |
56 |
&BuildSummary |
Lines 327-333
sub SearchAuthorities {
Link Here
|
327 |
### |
325 |
### |
328 |
if (! $skipmetadata) { |
326 |
if (! $skipmetadata) { |
329 |
for (my $z=0; $z<@finalresult; $z++){ |
327 |
for (my $z=0; $z<@finalresult; $z++){ |
330 |
my $count=CountUsage($finalresult[$z]{authid}); |
328 |
my $count = Koha::Authorities->get_usage_count({ authid => $finalresult[$z]{authid} }); |
331 |
$finalresult[$z]{used}=$count; |
329 |
$finalresult[$z]{used}=$count; |
332 |
}# all $z's |
330 |
}# all $z's |
333 |
} |
331 |
} |
Lines 340-382
sub SearchAuthorities {
Link Here
|
340 |
return (\@finalresult, $nbresults); |
338 |
return (\@finalresult, $nbresults); |
341 |
} |
339 |
} |
342 |
|
340 |
|
343 |
=head2 CountUsage |
|
|
344 |
|
345 |
$count= &CountUsage($authid) |
346 |
|
347 |
counts Usage of Authid in bibliorecords. |
348 |
|
349 |
=cut |
350 |
|
351 |
sub CountUsage { |
352 |
my ($authid) = @_; |
353 |
### ZOOM search here |
354 |
my $query; |
355 |
$query= "an:".$authid; |
356 |
# Should really be replaced with a real count call, this is a |
357 |
# bad way. |
358 |
my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); |
359 |
my ($err,$res,$result) = $searcher->simple_search_compat($query,0,1); |
360 |
if ($err) { |
361 |
warn "Error: $err from search $query"; |
362 |
$result = 0; |
363 |
} |
364 |
|
365 |
return $result; |
366 |
} |
367 |
|
368 |
=head2 CountUsageChildren |
369 |
|
370 |
$count= &CountUsageChildren($authid) |
371 |
|
372 |
counts Usage of narrower terms of Authid in bibliorecords. |
373 |
|
374 |
=cut |
375 |
|
376 |
sub CountUsageChildren { |
377 |
my ($authid) = @_; |
378 |
} |
379 |
|
380 |
=head2 GuessAuthTypeCode |
341 |
=head2 GuessAuthTypeCode |
381 |
|
342 |
|
382 |
my $authtypecode = GuessAuthTypeCode($record); |
343 |
my $authtypecode = GuessAuthTypeCode($record); |