|
Lines 1-32
Link Here
|
| 1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
| 2 |
|
2 |
|
| 3 |
# Copyright 2012 BibLibre |
|
|
| 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 |
=head1 batchdeletebiblios.pl |
| 20 |
|
| 21 |
This script batch deletes biblios which contain a biblionumber present in file passed in parameter. |
| 22 |
If one biblio has items, it is not deleted. |
| 23 |
|
| 24 |
=cut |
| 25 |
|
| 26 |
use Modern::Perl; |
3 |
use Modern::Perl; |
|
|
4 |
use Getopt::Long; |
| 5 |
use Pod::Usage; |
| 6 |
use IO::File; |
| 7 |
|
| 27 |
use C4::Biblio; |
8 |
use C4::Biblio; |
| 28 |
|
9 |
|
| 29 |
use IO::File; |
10 |
my ($help, $files); |
|
|
11 |
GetOptions( |
| 12 |
'h|help' => \$help, |
| 13 |
); |
| 14 |
|
| 15 |
pod2usage(1) if $help or not @ARGV; |
| 30 |
|
16 |
|
| 31 |
for my $file ( @ARGV ) { |
17 |
for my $file ( @ARGV ) { |
| 32 |
say "Find biblionumber in file $file"; |
18 |
say "Find biblionumber in file $file"; |
|
Lines 50-52
for my $file ( @ARGV ) {
Link Here
|
| 50 |
} |
36 |
} |
| 51 |
} |
37 |
} |
| 52 |
} |
38 |
} |
| 53 |
- |
39 |
|
|
|
40 |
exit(0); |
| 41 |
|
| 42 |
__END__ |
| 43 |
|
| 44 |
=head1 NAME |
| 45 |
|
| 46 |
batchdeletebiblios.pl |
| 47 |
|
| 48 |
=head1 SYNOPSIS |
| 49 |
|
| 50 |
./batchdeletebiblio.pl file1 [file2 ... filen] |
| 51 |
|
| 52 |
This script batch deletes biblios which contain a biblionumber present in file passed in parameter. |
| 53 |
If one biblio has items, it is not deleted. |
| 54 |
|
| 55 |
=head1 OPTIONS |
| 56 |
|
| 57 |
=over 8 |
| 58 |
|
| 59 |
=item B<-h|--help> |
| 60 |
|
| 61 |
prints this help message |
| 62 |
|
| 63 |
=back |
| 64 |
|
| 65 |
=head1 AUTHOR |
| 66 |
|
| 67 |
Jonathan Druart <jonathan.druart@biblibre.com> |
| 68 |
|
| 69 |
=head1 COPYRIGHT |
| 70 |
|
| 71 |
Copyright 2012 BibLibre |
| 72 |
|
| 73 |
=head1 LICENSE |
| 74 |
|
| 75 |
This file is part of Koha. |
| 76 |
|
| 77 |
Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software |
| 78 |
Foundation; either version 2 of the License, or (at your option) any later version. |
| 79 |
|
| 80 |
You should have received a copy of the GNU General Public License along |
| 81 |
with Koha; if not, write to the Free Software Foundation, Inc., |
| 82 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 83 |
|
| 84 |
=head1 DISCLAIMER OF WARRANTY |
| 85 |
|
| 86 |
Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 87 |
A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 88 |
|
| 89 |
=cut |