View | Details | Raw Unified | Return to bug 37613
Collapse All | Expand All

(-)a/misc/cronjobs/longoverdue.pl (-13 / +12 lines)
Lines 70-77 GetOptions( Link Here
70
    'category=s'        => $borrower_category,
70
    'category=s'        => $borrower_category,
71
    'skip-category=s'   => $skip_borrower_category,
71
    'skip-category=s'   => $skip_borrower_category,
72
    'list-categories'   => \$list_categories,
72
    'list-categories'   => \$list_categories,
73
    'branch=s'          => \@branches,
73
    'library=s'          => \@branches,
74
    'skip-branch=s'     => \@skip_branches,
74
    'skip-library=s'     => \@skip_branches,
75
    'itemtype=s'        => $itemtype,
75
    'itemtype=s'        => $itemtype,
76
    'skip-itemtype=s'   => $skip_itemtype,
76
    'skip-itemtype=s'   => $skip_itemtype,
77
    'list-itemtypes'    => \$list_itemtypes,
77
    'list-itemtypes'    => \$list_itemtypes,
Lines 101-107 if ( scalar @$borrower_category && scalar @$skip_borrower_category) { Link Here
101
if ( scalar @branches && scalar @skip_branches ) {
101
if ( scalar @branches && scalar @skip_branches ) {
102
    pod2usage(
102
    pod2usage(
103
        -verbose => 1,
103
        -verbose => 1,
104
        -message => "The options --branch and --skip-branch are mutually exclusive.\n" . "Use one or the other.",
104
        -message => "The options --library and --skip-library are mutually exclusive.\n" . "Use one or the other.",
105
        -exitval => 1
105
        -exitval => 1
106
    );
106
    );
107
}
107
}
Lines 133-139 if ( $list_itemtypes ) { Link Here
133
   longoverdue.pl --lost | -l DAYS=LOST_CODE [ --charge | -c CHARGE_CODE ] [ --verbose | -v ] [ --quiet ]
133
   longoverdue.pl --lost | -l DAYS=LOST_CODE [ --charge | -c CHARGE_CODE ] [ --verbose | -v ] [ --quiet ]
134
                  [ --maxdays MAX_DAYS ] [ --mark-returned ] [ --category BORROWER_CATEGORY ] ...
134
                  [ --maxdays MAX_DAYS ] [ --mark-returned ] [ --category BORROWER_CATEGORY ] ...
135
                  [ --skip-category BORROWER_CATEGORY ] ...
135
                  [ --skip-category BORROWER_CATEGORY ] ...
136
                  [ --branch BRANCH_CODE ] [ --skip-branch BRANCH_CODE ] ...
136
                  [ --library LIBRARY_CODE ] [ --skip-library LIBRARY_CODE ] ...
137
                  [ --skip-lost-value LOST_VALUE [ --skip-lost-value LOST_VALUE ] ]
137
                  [ --skip-lost-value LOST_VALUE [ --skip-lost-value LOST_VALUE ] ]
138
                  [ --commit ]
138
                  [ --commit ]
139
139
Lines 200-214 If not provided, the value of the system preference 'DefaultLongOverdueSkipPatro Link Here
200
List borrower categories available for use by B<--category> or
200
List borrower categories available for use by B<--category> or
201
B<--skip-category>, and exit.
201
B<--skip-category>, and exit.
202
202
203
=item B<--branch>
203
=item B<--library>
204
204
205
Act on the listed branch codes.  Exclude all others.  This may be specified multiple times to include multiple branches.  Which branches are selected follows the CircControl system preference.
205
Act on the listed library codes.  Exclude all others.  This may be specified multiple times to include multiple libraries.  Which libraries are selected follows the CircControl system preference.
206
May not be used with B<--skip-branch>
206
May not be used with B<--skip-library>
207
207
208
=item B<--skip-branch>
208
=item B<--skip-library>
209
209
210
Act on all branch codes except the ones listed.  This may be specified multiple times to exclude multiple branches.  Which branches are excluded follows the CircControl system preference.
210
Act on all library codes except the ones listed.  This may be specified multiple times to exclude multiple libraries.  Which libraries are excluded follows the CircControl system preference.
211
May not be used with B<--branch>
211
May not be used with B<--library>
212
212
213
=item B<--itemtype>
213
=item B<--itemtype>
214
214
Lines 387-393 my $filter_borrower_categories = ( scalar @$borrower_category || scalar @$skip_b Link Here
387
387
388
my @available_branches = Koha::Libraries->search()->get_column('branchcode');
388
my @available_branches = Koha::Libraries->search()->get_column('branchcode');
389
my %branches_to_process;
389
my %branches_to_process;
390
# If --branch was used, validate any branchcode passed in and mark them as branches to use
390
# If --library was used, validate any branchcode passed in and mark them as branches to use
391
for my $lib (@branches) {
391
for my $lib (@branches) {
392
    unless ( grep { $_ eq $lib } @available_branches ) {
392
    unless ( grep { $_ eq $lib } @available_branches ) {
393
        pod2usage(
393
        pod2usage(
Lines 397-403 for my $lib (@branches) { Link Here
397
    }
397
    }
398
    $branches_to_process{$lib} = 1;
398
    $branches_to_process{$lib} = 1;
399
}
399
}
400
# If --skip-branch was used, validate any branchcode passed in and mark them as branches to *not* use
400
# If --skip-library was used, validate any branchcode passed in and mark them as branches to *not* use
401
if (@skip_branches) {
401
if (@skip_branches) {
402
    for my $lib (@skip_branches) {
402
    for my $lib (@skip_branches) {
403
        unless ( grep { $_ eq $lib } @available_branches ) {
403
        unless ( grep { $_ eq $lib } @available_branches ) {
404
- 

Return to bug 37613