- my $report = {
- library => {
- id => C4::Context->preference('UsageStatsID') || 0,
- name => C4::Context->preference('UsageStatsLibraryName') || q||,
- url => C4::Context->preference('UsageStatsLibraryUrl') || q||,
- type => C4::Context->preference('UsageStatsLibraryType') || q||,
- country => C4::Context->preference('UsageStatsCountry') || q||,
+ my $report;
+ my @libraries;
+ if( C4::Context->preference('UsageStatsLibrariesInfo') ) {
+ my $libraries = Koha::Libraries->search;
+ while ( my $library = $libraries->next ) {
+ push @libraries, { name => $library->branchname, url => $library->branchurl, country => $library->branchcountry, geolocation => $library->geolocation, };
+ }
+ }
+ $report = {
+ installation => {
+ koha_id => C4::Context->preference('UsageStatsID') || 0,
+ name => C4::Context->preference('UsageStatsLibraryName') || q||,
+ url => C4::Context->preference('UsageStatsLibraryUrl') || q||,
+ type => C4::Context->preference('UsageStatsLibraryType') || q||,
+ country => C4::Context->preference('UsageStatsCountry') || q||,
+ geolocation => C4::Context->preference('UsageStatsGeolocation') || q||,