Lines 38-43
our %options = (
Link Here
|
38 |
'check-title' => 0, |
38 |
'check-title' => 0, |
39 |
'check-age' => 0, |
39 |
'check-age' => 0, |
40 |
'check-loop' => 0, |
40 |
'check-loop' => 0, |
|
|
41 |
'check-all' => 0, |
41 |
'skip-branch' => 0, |
42 |
'skip-branch' => 0, |
42 |
'skip-auth' => 0, |
43 |
'skip-auth' => 0, |
43 |
'skip-status' => 0, |
44 |
'skip-status' => 0, |
Lines 57-62
GetOptions(
Link Here
|
57 |
'check-title' => sub { $options{'check-title'} = 1 }, |
58 |
'check-title' => sub { $options{'check-title'} = 1 }, |
58 |
'check-age' => sub { $options{'check-age'} = 1 }, |
59 |
'check-age' => sub { $options{'check-age'} = 1 }, |
59 |
'check-loop' => sub { $options{'check-loop'} = 1 }, |
60 |
'check-loop' => sub { $options{'check-loop'} = 1 }, |
|
|
61 |
'check-all' => sub { $options{'check-all'} = 1 }, |
60 |
'skip-branch' => sub { $options{'skip-branch'} = 1 }, |
62 |
'skip-branch' => sub { $options{'skip-branch'} = 1 }, |
61 |
'skip-auth' => sub { $options{'skip-auth'} = 1 }, |
63 |
'skip-auth' => sub { $options{'skip-auth'} = 1 }, |
62 |
'skip-status' => sub { $options{'skip-status'} = 1 }, |
64 |
'skip-status' => sub { $options{'skip-status'} = 1 }, |
Lines 126-134
sub set_skip_options {
Link Here
|
126 |
|
128 |
|
127 |
# Set all check options to 1 if none are provided, considering skip options |
129 |
# Set all check options to 1 if none are provided, considering skip options |
128 |
sub set_all_check_options_if_none_provided { |
130 |
sub set_all_check_options_if_none_provided { |
129 |
my $any_check_option_provided = grep { $options{$_} } grep { /^check-/ } keys %options; |
131 |
my $check_all_option_provided = grep { $options{$_} && $_ eq "check-all" } grep { /^check-/ } keys %options; |
|
|
132 |
if ($check_all_option_provided) { |
133 |
foreach my $key ( keys %options ) { |
134 |
if ( $key =~ /^check-/ ) { |
135 |
my $skip_key = $key; |
136 |
$skip_key =~ s/^check-/skip-/; |
130 |
|
137 |
|
131 |
if ( !$any_check_option_provided ) { |
138 |
# Set check option to 1 unless the corresponding skip option indicated |
|
|
139 |
$options{$key} = 1 unless $options{$skip_key}; |
140 |
} |
141 |
} |
142 |
} elsif ( 0 == grep { $options{$_} && $_ ne "check-all" } grep { /^check-/ } keys %options ) { |
132 |
handle_invalid_options("No options selected"); |
143 |
handle_invalid_options("No options selected"); |
133 |
die; |
144 |
die; |
134 |
} |
145 |
} |
Lines 743-748
Catch data inconsistencies in Koha database:
Link Here
|
743 |
--check-title Check for bibliographic records without a title |
754 |
--check-title Check for bibliographic records without a title |
744 |
--check-age Check for patrons with invalid age for category |
755 |
--check-age Check for patrons with invalid age for category |
745 |
--check-loop Check for relationships that form guarantor loops |
756 |
--check-loop Check for relationships that form guarantor loops |
|
|
757 |
--check-all Run all checks without specifying any other option |
746 |
--skip-branch Skip checking for items without home or holding library |
758 |
--skip-branch Skip checking for items without home or holding library |
747 |
--skip-auth Skip checking for authority records with invalid authority type |
759 |
--skip-auth Skip checking for authority records with invalid authority type |
748 |
--skip-status Skip checking for bibliographic records and items without an item type or with an invalid item type |
760 |
--skip-status Skip checking for bibliographic records and items without an item type or with an invalid item type |
Lines 752-757
Catch data inconsistencies in Koha database:
Link Here
|
752 |
--skip-loop Skip checking for relationships that form guarantor loops |
764 |
--skip-loop Skip checking for relationships that form guarantor loops |
753 |
--help Print usage information |
765 |
--help Print usage information |
754 |
|
766 |
|
755 |
Note: If no options are provided, all tests will be run. |
|
|
756 |
|
757 |
=cut |
767 |
=cut |
758 |
- |
|
|