[freeside-commits] freeside/FS/FS svc_phone.pm, 1.12, 1.13 Conf.pm, 1.250, 1.251
Ivan,,,
ivan at wavetail.420.am
Fri Oct 24 17:37:04 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv14027
Modified Files:
svc_phone.pm Conf.pm
Log Message:
add a switch to allow letters in phone numbers, RT#4195
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.250
retrieving revision 1.251
diff -u -d -r1.250 -r1.251
--- Conf.pm 24 Oct 2008 01:19:46 -0000 1.250
+++ Conf.pm 25 Oct 2008 00:37:02 -0000 1.251
@@ -2498,6 +2498,13 @@
'type' => 'text',
},
+ {
+ 'key' => 'svc_phone-allow_alpha_phonenum',
+ 'section' => '',
+ 'description' => 'Allow letters in phone numbers.',
+ 'type' => 'checkbox',
+ },
+
);
1;
Index: svc_phone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_phone.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- svc_phone.pm 24 Oct 2008 01:45:24 -0000 1.12
+++ svc_phone.pm 25 Oct 2008 00:37:02 -0000 1.13
@@ -179,8 +179,14 @@
sub check {
my $self = shift;
+ my $conf = new FS::Conf;
+
my $phonenum = $self->phonenum;
- $phonenum =~ s/\D//g;
+ if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
+ $phonenum =~ s/\W//g;
+ } else {
+ $phonenum =~ s/\D//g;
+ }
$self->phonenum($phonenum);
my $error =
More information about the freeside-commits
mailing list