Bug 10572: Add phone to message_transport_types table for new installs
[koha.git] / C4 / SMS.pm
index 959e407..24580d6 100644 (file)
--- a/C4/SMS.pm
+++ b/C4/SMS.pm
@@ -1,5 +1,7 @@
 package C4::SMS;
 
+# Copyright 2007 Liblime
+#
 # This file is part of Koha.
 #
 # Koha is free software; you can redistribute it and/or modify it under the
@@ -11,9 +13,9 @@ package C4::SMS;
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 =head1 NAME
 
@@ -34,12 +36,11 @@ use strict;
 use warnings;
 
 use C4::Context;
-use SMS::Send;
 
 use vars qw( $VERSION );
 
 BEGIN {
-    $VERSION = 0.03;
+    $VERSION = 3.07.00.049;
 }
 
 =head1 METHODS
@@ -52,10 +53,6 @@ BEGIN {
 
 =head2 send_sms
 
-=over4
-
-=back
-
 =cut
 
 sub send_sms {
@@ -67,6 +64,12 @@ sub send_sms {
         return unless defined $params->{ $required_parameter };
     }
 
+    eval { require SMS::Send; };
+    if ( $@ ) {
+        # we apparently don't have SMS::Send. Return a failure.
+        return;
+    }
+
     # This allows the user to override the driver. See SMS::Send::Test
     my $driver = exists $params->{'driver'} ? $params->{'driver'} : $self->driver();
     return unless $driver;
@@ -89,10 +92,6 @@ sub send_sms {
 
 =head2 driver
 
-=over 4
-
-=back
-
 =cut
 
 sub driver {