X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=misc%2Fcronjobs%2Fbuild_browser_and_cloud.pl;h=46551ca041aae5e4eac13b8c9abe2ef0315a9cdc;hb=9d6d641d1f8b77271800f43bc027b651f9aea52b;hp=e1873c816f5858d94e6aef7c7af6b1e42d92c3ed;hpb=3b3a406c272aef77a9c630404fa09d963941d887;p=srvgit diff --git a/misc/cronjobs/build_browser_and_cloud.pl b/misc/cronjobs/build_browser_and_cloud.pl index e1873c816f..46551ca041 100755 --- a/misc/cronjobs/build_browser_and_cloud.pl +++ b/misc/cronjobs/build_browser_and_cloud.pl @@ -2,6 +2,7 @@ # small script that builds the tag cloud use strict; +#use warnings; FIXME - Bug 2505 BEGIN { # find Koha's Perl modules # test carefully before changing this @@ -9,16 +10,19 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Script -cron; use C4::Koha; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use Date::Calc; use Time::HiRes qw(gettimeofday); use ZOOM; use MARC::File::USMARC; use Getopt::Long; +use C4::Log; + my ( $input_marc_file, $number) = ('',0); -my ($version, $confirm,$test_parameter,$field,$batch,$max_digits,$cloud_tag); +my ($version, $confirm,$field,$batch,$max_digits,$cloud_tag); GetOptions( 'c' => \$confirm, 'h' => \$version, @@ -59,6 +63,8 @@ my $browser_subfield = $2; warn "browser : $browser_tag / $browser_subfield" unless $batch; die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag; +cronlogaction(); + my $dbh = C4::Context->dbh; my $i=0; @@ -86,7 +92,7 @@ while ((my ($biblionumber)= $sth->fetchrow)) { #now, parse the record, extract the item fields, and store them in somewhere else. my $Koharecord; eval{ - $Koharecord = GetMarcBiblio($biblionumber); + $Koharecord = GetMarcBiblio({ biblionumber => $biblionumber }); }; if($@){ warn 'pb when getting biblio '.$i.' : '.$@; @@ -129,7 +135,7 @@ if ($browser_tag) { print "inserting datas in browser table\n" unless $batch; # read existing classification table is possible my $classification; - if (C4::Context->preference('opaclanguages') =~ m/^fr/i && $browser_tag eq '676' & $browser_subfield eq 'a') { + if (C4::Context->preference('OPACLanguages') =~ m/^fr/i && $browser_tag eq '676' & $browser_subfield eq 'a') { $classification = dewey_french(); }