freeside/FS/FS Misc.pm,1.6,1.7

Kristian Hoffmann khoff at pouncequick.420.am
Mon Mar 28 17:38:54 PST 2005


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv6017

Modified Files:
	Misc.pm 
Log Message:
'require' not 'use' Fax::Hylafax::Client so it's an optional requirement.


Index: Misc.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Misc.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Misc.pm	21 Mar 2005 22:13:36 -0000	1.6
+++ Misc.pm	29 Mar 2005 01:38:51 -0000	1.7
@@ -50,7 +50,6 @@
 use Mail::Header;
 use Mail::Internet 1.44;
 use MIME::Entity;
-use Fax::Hylafax::Client;
 use FS::UID;
 
 FS::UID->install_callback( sub {
@@ -135,6 +134,18 @@
 
   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');
 




More information about the freeside-commits mailing list