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