From bdda4e1ae0e0247f0f641529b4779f8b61de809b Mon Sep 17 00:00:00 2001 From: khoff Date: Tue, 29 Mar 2005 01:38:51 +0000 Subject: [PATCH] 'require' not 'use' Fax::Hylafax::Client so it's an optional requirement. --- FS/FS/Misc.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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\'.' -- 2.11.0