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