Bug 2720 - Overdues which debar automatically should undebar automatically when returned
[koha.git] / misc / mod_zebraqueue.pl
1 #!/usr/bin/perl
2
3 # Copyright 2012 Kyle M Hall
4 # This file is part of Koha.
5 #
6 # Koha is free software; you can redistribute it and/or modify it under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2 of the License, or (at your option) any later
9 # version.
10 #
11 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along with
16 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
17 # Suite 330, Boston, MA  02111-1307 USA
18
19 # script to add records to the zebraqueue from the commandline.
20
21 use Modern::Perl;
22
23 use Getopt::Long;
24 use Pod::Usage;
25
26 use C4::Biblio;
27
28 my @biblios;
29 my @authorities;
30 my $help;
31 my $verbose;
32
33 GetOptions(
34     "b|biblio|biblionumber=s"       => \@biblios,
35     "a|authority|authoritynumber=s" => \@authorities,
36     'h|?|help'                      => \$help,
37     'v|verbose'                     => \$verbose,
38 );
39
40 pod2usage( -exitval => 0 ) if ( $help || !( @biblios || @authorities ) );
41
42 foreach my $biblionumber (@biblios) {
43     print "Adding bibliographic record $biblionumber to Zebra queue\n" if ($verbose);
44     ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
45 }
46
47 foreach my $authority (@authorities) {
48     print "Adding authority record $authority to Zebra queue\n" if ($verbose);
49     ModZebra( $authority, 'specialUpdate', "authorityserver" );
50 }
51
52 __END__
53
54 =head1 NAME
55
56 mod_zebraqueue.pl - Mark bibliographic and/or authority records for updating via the zebraqueue.
57
58 =head1 SYNOPSIS
59
60 mod_zebraqueue.pl -v -b $bib1 -b $bib2 -a $authority1 -a $authority2
61
62 =head1 OPTIONS
63
64 =over 8
65
66 =item B<-b, --biblio, --biblionumber>
67
68 The biblionumber of a record to be updated, repeatable.
69
70 =item B<-a, --authority, --authoritynumber>
71
72 The authoritynumber of the record to be updated, repeatable.
73
74 =item B<-h, -?, --help>
75
76 Prints this help message and exits.
77
78 =item B<-v, --verbose>
79
80 Be verbose
81
82 =back
83
84 =cut