|
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 769-774
Catch data inconsistencies in Koha database:
Link Here
|
| 769 |
--check-title Check for bibliographic records without a title |
780 |
--check-title Check for bibliographic records without a title |
| 770 |
--check-age Check for patrons with invalid age for category |
781 |
--check-age Check for patrons with invalid age for category |
| 771 |
--check-loop Check for relationships that form guarantor loops |
782 |
--check-loop Check for relationships that form guarantor loops |
|
|
783 |
--check-all Run all checks without specifying any other option |
| 772 |
--skip-branch Skip checking for items without home or holding library |
784 |
--skip-branch Skip checking for items without home or holding library |
| 773 |
--skip-auth Skip checking for authority records with invalid authority type |
785 |
--skip-auth Skip checking for authority records with invalid authority type |
| 774 |
--skip-status Skip checking for bibliographic records and items without an item type or with an invalid item type |
786 |
--skip-status Skip checking for bibliographic records and items without an item type or with an invalid item type |
|
Lines 778-783
Catch data inconsistencies in Koha database:
Link Here
|
| 778 |
--skip-loop Skip checking for relationships that form guarantor loops |
790 |
--skip-loop Skip checking for relationships that form guarantor loops |
| 779 |
--help Print usage information |
791 |
--help Print usage information |
| 780 |
|
792 |
|
| 781 |
Note: If no options are provided, all tests will be run. |
|
|
| 782 |
|
| 783 |
=cut |
793 |
=cut |
| 784 |
- |
|
|