From: C.J. Adams-Collier Date: Thu, 18 Sep 2014 18:56:02 +0000 (-0700) Subject: FS RT #30831 - passing the ISO 3166-1 alpha-2 country code to ut_phonen X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=3c036f878548a8aab8ff88911a7b238e20d68bbe FS RT #30831 - passing the ISO 3166-1 alpha-2 country code to ut_phonen --- diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 4915b96ef..51cb6dc8e 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -2649,8 +2649,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 afb4c1db3..808a5d3a9 100644 --- a/FS/FS/svc_alarm.pm +++ b/FS/FS/svc_alarm.pm @@ -197,13 +197,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')