add agerestriction
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 26 May 2015 16:56:59 +0000 (18:56 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 26 May 2015 16:56:59 +0000 (18:56 +0200)
mkp-marc.pl

index 7390dba..beee966 100755 (executable)
@@ -7,18 +7,20 @@ use autodie;
 use DBI;
 use Data::Dump qw/dump/;
 
-my $limit = $ENV{LIMIT} || 50;
+my $limit = $ENV{LIMIT} || 9999;
 
 my $dsn = 'DBI:mysql:dbname=koha_ffzg';
 my $sql = qq{
 select
        biblionumber,itemnumber,title,
+       agerestriction,
        marc
 from items
        join biblioitems using (biblionumber)
        join biblio using (biblionumber)
 where location = 'MKP'
        or homebranch = 'MKP'
+       or agerestriction > 0
 limit $limit
 };
 
@@ -61,5 +63,6 @@ while ( my $row = $sth->fetchrow_hashref ) {
        print $tsv_fh "$rec\n";
 }
 
+warn "# rows ", $sth->rows,"\n";
 system "ls -al $path*";
 system "rsync -v $path* 10.60.0.82:/tmp/";