9 use Koha
::Script
-cron
;
14 my ( $verbose, $help, $confirm );
15 my $result = GetOptions
(
17 'v|verbose' => \
$verbose,
18 'c|confirm' => \
$confirm,
21 pod2usage
(1) if $help;
22 $verbose = 1 unless $confirm;
24 # Load configuration from the syspref
25 my $syspref_content = C4
::Context
->preference('automatic_item_modification_by_age_configuration');
26 my $rules = eval { JSON
::from_json
( $syspref_content ) };
27 pod2usage
({ -message
=> "Unable to load the configuration : $@", -exitval
=> 1 })
30 my $report = C4
::Items
::ToggleNewStatus
( { rules
=> $rules, report_only
=> not $confirm } );
34 say "Item to modify:";
35 while ( my ( $itemnumber, $substitutions ) = each %$report ) {
36 for my $substitution ( @
$substitutions ) {
37 if ( defined $substitution->{value
} and $substitution->{value
} ne q
|| ) {
38 say "\titemnumber $itemnumber: $substitution->{field}=$substitution->{value}";
40 say "\titemnumber $itemnumber: field $substitution->{field} to delete";
45 say "There is no item to modify";
55 automatic_item_modification_by_age.pl
59 ./automatic_item_modification_by_age.pl -h
61 Toggle recent acquisitions status.
62 Use this script to delete "new" status for items.
70 Prints this help message.
78 The script will modify the items.
84 Jonathan Druart <jonathan.druart@biblibre.com>
88 Copyright 2013 BibLibre
92 This file is part of Koha.
94 Koha is free software; you can redistribute it and/or modify it
95 under the terms of the GNU General Public License as published by
96 the Free Software Foundation; either version 3 of the License, or
97 (at your option) any later version.
99 Koha is distributed in the hope that it will be useful, but
100 WITHOUT ANY WARRANTY; without even the implied warranty of
101 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102 GNU General Public License for more details.
104 You should have received a copy of the GNU General Public License
105 along with Koha; if not, see <http://www.gnu.org/licenses>.