summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhoff <khoff>2005-03-29 01:38:51 +0000
committerkhoff <khoff>2005-03-29 01:38:51 +0000
commitbdda4e1ae0e0247f0f641529b4779f8b61de809b (patch)
tree9e18aeea5bf3c7df6bbca528d2e330ab677189c4
parent02475d1203f7ad65fd46d51cda9b835c887f986f (diff)
'require' not 'use' Fax::Hylafax::Client so it's an optional requirement.
-rw-r--r--FS/FS/Misc.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm
index a7cd47176..7d7b7d061 100644
--- 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 Fax::Hylafax::Client;
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');
+ 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\'.'