Lines 47-53
holds_reminder.pl - prepare reminder messages to be sent to patrons with waiting
Link Here
|
47 |
|
47 |
|
48 |
holds_reminder.pl |
48 |
holds_reminder.pl |
49 |
-lettercode <notice to send> |
49 |
-lettercode <notice to send> |
50 |
[ -n ][ -v ][ -library <branchcode> ][ -library <branchcode> ... ] |
50 |
[ -c ][ -v ][ -library <branchcode> ][ -library <branchcode> ... ] |
51 |
[ -days <number of days> ][ -mtt <transport type> ... ][ -holidays ] |
51 |
[ -days <number of days> ][ -mtt <transport type> ... ][ -holidays ] |
52 |
[ -date <YYYY-MM-DD> ] |
52 |
[ -date <YYYY-MM-DD> ] |
53 |
|
53 |
|
Lines 55-61
holds_reminder.pl
Link Here
|
55 |
-help brief help message |
55 |
-help brief help message |
56 |
-man full documentation |
56 |
-man full documentation |
57 |
-v verbose |
57 |
-v verbose |
58 |
-n No email will be sent |
58 |
-c --confirm confirm, if not set no email will be sent |
59 |
-days <days> days waiting to deal with |
59 |
-days <days> days waiting to deal with |
60 |
-lettercode <lettercode> predefined notice to use, default is HOLD_REMINDER |
60 |
-lettercode <lettercode> predefined notice to use, default is HOLD_REMINDER |
61 |
-library <branchname> only deal with holds from this library (repeatable : several libraries can be given) |
61 |
-library <branchname> only deal with holds from this library (repeatable : several libraries can be given) |
Lines 81-89
Prints the manual page and exits.
Link Here
|
81 |
|
81 |
|
82 |
Verbose. Without this flag set, only fatal errors are reported. |
82 |
Verbose. Without this flag set, only fatal errors are reported. |
83 |
|
83 |
|
84 |
=item B<-n> |
84 |
=item B<--confirm | -c> |
85 |
|
85 |
|
86 |
Do not send any email (test-mode) . If verbose a list of notices that would have been sent to |
86 |
Confirm. Unless set this script does not send any email (test-mode). |
|
|
87 |
If verbose and not confirm a list of notices that would have been sent to |
87 |
the patrons are printed to standard out. |
88 |
the patrons are printed to standard out. |
88 |
|
89 |
|
89 |
=item B<-days> |
90 |
=item B<-days> |
Lines 164-170
my $dbh = C4::Context->dbh();
Link Here
|
164 |
my $help = 0; |
165 |
my $help = 0; |
165 |
my $man = 0; |
166 |
my $man = 0; |
166 |
my $verbose = 0; |
167 |
my $verbose = 0; |
167 |
my $nomail = 0; |
168 |
my $confirm = 0; |
168 |
my $days ; |
169 |
my $days ; |
169 |
my $lettercode; |
170 |
my $lettercode; |
170 |
my @branchcodes; # Branch(es) passed as parameter |
171 |
my @branchcodes; # Branch(es) passed as parameter |
Lines 177-183
GetOptions(
Link Here
|
177 |
'help|?' => \$help, |
178 |
'help|?' => \$help, |
178 |
'man' => \$man, |
179 |
'man' => \$man, |
179 |
'v' => \$verbose, |
180 |
'v' => \$verbose, |
180 |
'n' => \$nomail, |
181 |
'c|confirm' => \$confirm, |
181 |
'days=s' => \$days, |
182 |
'days=s' => \$days, |
182 |
'lettercode=s' => \$lettercode, |
183 |
'lettercode=s' => \$lettercode, |
183 |
'library=s' => \@branchcodes, |
184 |
'library=s' => \@branchcodes, |
Lines 284-291
foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP
Link Here
|
284 |
}, |
285 |
}, |
285 |
}; |
286 |
}; |
286 |
$sending_params->{letter_params} = $letter_params; |
287 |
$sending_params->{letter_params} = $letter_params; |
287 |
$sending_params->{test_mode} = $nomail; |
288 |
$sending_params->{test_mode} = !$confirm; |
288 |
my $result_text = $nomail ? "would have been sent" : "was sent"; |
289 |
my $result_text = $confirm ? "was sent" : "would have been sent"; |
289 |
# queue_notice queues the notices, falling back to print for email or SMS, and ignores phone (they are handled by Itiva) |
290 |
# queue_notice queues the notices, falling back to print for email or SMS, and ignores phone (they are handled by Itiva) |
290 |
my $result = $patron->queue_notice( $sending_params ); |
291 |
my $result = $patron->queue_notice( $sending_params ); |
291 |
$verbose and print " borrower " . $patron->surname . ", " . $patron->firstname . " $result_text notices via: @{$result->{sent}}\n" if defined $result->{sent}; |
292 |
$verbose and print " borrower " . $patron->surname . ", " . $patron->firstname . " $result_text notices via: @{$result->{sent}}\n" if defined $result->{sent}; |
292 |
- |
|
|