projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
02475d1
)
'require' not 'use' Fax::Hylafax::Client so it's an optional requirement.
author
khoff
<khoff>
Tue, 29 Mar 2005 01:38:51 +0000
(
01:38
+0000)
committer
khoff
<khoff>
Tue, 29 Mar 2005 01:38:51 +0000
(
01:38
+0000)
FS/FS/Misc.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Misc.pm
b/FS/FS/Misc.pm
index
a7cd471
..
7d7b7d0
100644
(file)
--- a/
FS/FS/Misc.pm
+++ b/
FS/FS/Misc.pm
@@
-50,7
+50,6
@@
use Date::Format;
use Mail::Header;
use Mail::Internet 1.44;
use MIME::Entity;
use Mail::Header;
use Mail::Internet 1.44;
use MIME::Entity;
-use Fax::Hylafax::Client;
use FS::UID;
FS::UID->install_callback( sub {
use FS::UID;
FS::UID->install_callback( sub {
@@
-136,6
+135,18
@@
sub send_fax {
die 'HylaFAX support has not been configured.'
unless $conf->exists('hylafax');
die 'HylaFAX support has not been configured.'
unless $conf->exists('hylafax');
+ eval {
+ require Fax::Hylafax::Client;
+ };
+
+ if ($@) {
+ if ($@ =~ /^Can't locate Fax.*/) {
+ die "You must have Fax::Hylafax::Client installed to use invoice faxing."
+ } else {
+ die $@;
+ }
+ }
+
my %hylafax_opts = map { split /\s+/ } $conf->config('hylafax');
die 'Called send_fax without a \'dialstring\'.'
my %hylafax_opts = map { split /\s+/ } $conf->config('hylafax');
die 'Called send_fax without a \'dialstring\'.'