diff options
author | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-18 11:56:02 -0700 |
---|---|---|
committer | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-18 20:14:02 -0700 |
commit | 0dd51846f6279fcdf3b4a7749b70d3b2fad8b0a5 (patch) | |
tree | 9927700fdf26af3bb2c949d5107d96736e85a6a4 | |
parent | 11813b5607aeb793535aa2e893466480923b8d05 (diff) |
FS RT #30831 - passing the ISO 3166-1 alpha-2 country code to ut_phonen
-rw-r--r-- | FS/FS/Record.pm | 4 | ||||
-rw-r--r-- | FS/FS/svc_alarm.pm | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 3e50b11a7..6e4f973df 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -2487,8 +2487,8 @@ sub ut_alpha_lower { Check/untaint phone numbers. May be null. If there is an error, returns the error, otherwise returns false. -Takes an optional two-letter ISO country code; without it or with unsupported -countries, ut_phonen simply calls ut_alphan. +Takes an optional two-letter ISO 3166-1 alpha-2 country code; without +it or with unsupported countries, ut_phonen simply calls ut_alphan. =cut diff --git a/FS/FS/svc_alarm.pm b/FS/FS/svc_alarm.pm index bb9338c7f..bfdb6bda1 100644 --- a/FS/FS/svc_alarm.pm +++ b/FS/FS/svc_alarm.pm @@ -198,13 +198,15 @@ sub check { my $x = $self->setfixed; return $x unless ref $x; + my $iso3166 = $self->cust_main->ship_location->country(); + my $error = $self->ut_numbern('svcnum') || $self->ut_text('acctnum') || $self->ut_alphan('_password') || $self->ut_textn('location') || $self->ut_numbern('cs_receiver') - || $self->ut_phonen('cs_phonenum') + || $self->ut_phonen('cs_phonenum', $iso3166) || $self->ut_alphan('serialnum') || $self->ut_foreign_key('alarmsystemnum', 'alarm_system', 'systemnum') || $self->ut_foreign_key('alarmtypenum', 'alarm_type', 'typenum') |