|
Lines 1-6
Link Here
|
| 1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
| 2 |
# |
2 |
# |
| 3 |
# Copyright 2008 Liblime |
3 |
# Copyright 2008 Liblime |
|
|
4 |
# Copyright 2014 Foundations Bible College, Inc. |
| 4 |
# |
5 |
# |
| 5 |
# This file is part of Koha. |
6 |
# This file is part of Koha. |
| 6 |
# |
7 |
# |
|
Lines 89-94
Current options are text, html, csv, and tsv. At the moment, text and tsv both p
Link Here
|
| 89 |
|
90 |
|
| 90 |
Whether to use e-mail (implied by --to or --from). |
91 |
Whether to use e-mail (implied by --to or --from). |
| 91 |
|
92 |
|
|
|
93 |
=item B<-username> |
| 94 |
|
| 95 |
Username to pass to the SMTP server for authentication |
| 96 |
|
| 97 |
=item B<-password> |
| 98 |
|
| 99 |
Password to pass to the SMTP server for authentication |
| 100 |
|
| 101 |
=item B<-method> |
| 102 |
|
| 103 |
Method is the type of authentication. Ie. LOGIN, DIGEST-MD5, etc. |
| 104 |
|
| 92 |
=item B<-to> |
105 |
=item B<-to> |
| 93 |
|
106 |
|
| 94 |
E-mail address to send report to. Defaults to KohaAdminEmailAddress. |
107 |
E-mail address to send report to. Defaults to KohaAdminEmailAddress. |
|
Lines 150-164
my $subject = 'Koha Saved Report';
Link Here
|
| 150 |
my $separator = ','; |
163 |
my $separator = ','; |
| 151 |
my $quote = '"'; |
164 |
my $quote = '"'; |
| 152 |
|
165 |
|
|
|
166 |
my $username = undef; |
| 167 |
my $password = undef; |
| 168 |
my $method = 'LOGIN'; |
| 169 |
|
| 153 |
GetOptions( |
170 |
GetOptions( |
| 154 |
'help|?' => \$help, |
171 |
'help|?' => \$help, |
| 155 |
'man' => \$man, |
172 |
'man' => \$man, |
| 156 |
'verbose' => \$verbose, |
173 |
'verbose' => \$verbose, |
| 157 |
'format=s' => \$format, |
174 |
'format=s' => \$format, |
| 158 |
'to=s' => \$to, |
175 |
'to=s' => \$to, |
| 159 |
'from=s' => \$from, |
176 |
'from=s' => \$from, |
| 160 |
'subject=s' => \$subject, |
177 |
'subject=s' => \$subject, |
| 161 |
'email' => \$email, |
178 |
'email' => \$email, |
|
|
179 |
'username:s' => \$username, |
| 180 |
'password:s' => \$password, |
| 181 |
'method:s' => \$method, |
| 182 |
|
| 162 |
) or pod2usage(2); |
183 |
) or pod2usage(2); |
| 163 |
pod2usage( -verbose => 2 ) if ($man); |
184 |
pod2usage( -verbose => 2 ) if ($man); |
| 164 |
pod2usage( -verbose => 2 ) if ($help and $verbose); |
185 |
pod2usage( -verbose => 2 ) if ($help and $verbose); |
|
Lines 260-265
foreach my $report_id (@ARGV) {
Link Here
|
| 260 |
Message => encode('utf8', $message ) |
281 |
Message => encode('utf8', $message ) |
| 261 |
); |
282 |
); |
| 262 |
} |
283 |
} |
|
|
284 |
$mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username; |
| 263 |
sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; |
285 |
sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; |
| 264 |
} else { |
286 |
} else { |
| 265 |
print $message; |
287 |
print $message; |
| 266 |
- |
|
|