From: khoff Date: Tue, 29 Mar 2005 01:38:51 +0000 (+0000) Subject: 'require' not 'use' Fax::Hylafax::Client so it's an optional requirement. X-Git-Tag: BEFORE_FINAL_MASONIZE~626 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=bdda4e1ae0e0247f0f641529b4779f8b61de809b 'require' not 'use' Fax::Hylafax::Client so it's an optional requirement. --- 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\'.'