[freeside-commits] freeside/FS/FS Conf.pm, 1.324.2.7, 1.324.2.8 cust_main_invoice.pm, 1.20, 1.20.4.1

Ivan,,, ivan at wavetail.420.am
Thu Nov 5 17:51:23 PST 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv27770

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	Conf.pm cust_main_invoice.pm 
Log Message:
add emailinvoice-apostrophe config option to allow apostrophies in invoice email addresses, RT#6464

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.324.2.7
retrieving revision 1.324.2.8
diff -u -d -r1.324.2.7 -r1.324.2.8
--- Conf.pm	3 Nov 2009 03:13:13 -0000	1.324.2.7
+++ Conf.pm	6 Nov 2009 01:51:20 -0000	1.324.2.8
@@ -809,35 +809,42 @@
     'key'         => 'editreferrals',
     'section'     => 'UI',
     'description' => 'Enable advertising source modification for existing customers',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
     'key'         => 'emailinvoiceonly',
     'section'     => 'billing',
     'description' => 'Disables postal mail invoices',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
     'key'         => 'disablepostalinvoicedefault',
     'section'     => 'billing',
     'description' => 'Disables postal mail invoices as the default option in the UI.  Be careful not to setup customers which are not sent invoices.  See <a href ="#emailinvoiceauto">emailinvoiceauto</a>.',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
     'key'         => 'emailinvoiceauto',
     'section'     => 'billing',
     'description' => 'Automatically adds new accounts to the email invoice list',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
     'key'         => 'emailinvoiceautoalways',
     'section'     => 'billing',
     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'emailinvoice-apostrophe',
+    'section'     => 'billing',
+    'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
+    'type'        => 'checkbox',
   },
 
   {
@@ -1122,17 +1129,17 @@
   },
 
   {
-    'key' => 'password-noampersand',
-    'section' => 'password',
+    'key'         => 'password-noampersand',
+    'section'     => 'password',
     'description' => 'Disallow ampersands in passwords',
-    'type' => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
-    'key' => 'password-noexclamation',
-    'section' => 'password',
+    'key'         => 'password-noexclamation',
+    'section'     => 'password',
     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
-    'type' => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
@@ -2597,14 +2604,14 @@
     'key'         => 'disable_setup_suspended_pkgs',
     'section'     => 'billing',
     'description' => 'Disables charging of setup fees for suspended packages.',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
-    'key' => 'password-generated-allcaps',
-    'section' => 'password',
+    'key'         => 'password-generated-allcaps',
+    'section'     => 'password',
     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
-    'type' => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {
@@ -3040,7 +3047,7 @@
     'key'         => 'cust_pkg-show_autosuspend',
     'section'     => 'UI',
     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
-    'type'       => 'checkbox',
+    'type'        => 'checkbox',
   },
 
   {

Index: cust_main_invoice.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main_invoice.pm,v
retrieving revision 1.20
retrieving revision 1.20.4.1
diff -u -d -r1.20 -r1.20.4.1
--- cust_main_invoice.pm	14 Sep 2008 20:24:53 -0000	1.20
+++ cust_main_invoice.pm	6 Nov 2009 01:51:20 -0000	1.20.4.1
@@ -1,7 +1,7 @@
 package FS::cust_main_invoice;
 
 use strict;
-use vars qw(@ISA $conf);
+use vars qw(@ISA);
 use Exporter;
 use FS::Record qw( qsearchs );
 use FS::Conf;
@@ -127,12 +127,16 @@
   my $error = $self->ut_text('dest');
   return $error if $error;
 
+  my $conf = new FS::Conf;
+
   if ( $self->dest =~ /^(POST|FAX)$/ ) {
     #contemplate our navel
   } elsif ( $self->dest =~ /^(\d+)$/ ) {
     return "Unknown local account (specified by svcnum: ". $self->dest. ")"
       unless qsearchs( 'svc_acct', { 'svcnum' => $self->dest } );
-  } elsif ( $self->dest =~ /^\s*([\w\.\-\&\+]+)\@(([\w\.\-]+\.)+\w+)\s*$/ ) {
+  } elsif ( $conf->exists('emailinvoice-apostrophe')
+              ? $self->dest =~ /^\s*([\w\.\-\&\+\']+)\@(([\w\.\-]+\.)+\w+)\s*$/
+              : $self->dest =~ /^\s*([\w\.\-\&\+]+)\@(([\w\.\-]+\.)+\w+)\s*$/ ){
     my($user, $domain) = ($1, $2);
     $self->dest("$1\@$2");
   } else {



More information about the freeside-commits mailing list