use FS::svc_Common;
use FS::part_svc;
use FS::phone_device;
+use FS::svc_pbx;
@ISA = qw( FS::svc_Common );
=item phone_name
+=item pbxsvc
+
+Optional svcnum from svc_pbx
+
=back
=head1 METHODS
},
'sip_password' => 'SIP password',
'phone_name' => 'Name',
+ 'pbxsvc' => { label => 'PBX',
+ type => 'select-svc_pbx.html',
+ disable_inventory => 1,
+ disable_select => 1, #UI wonky, pry works otherwise
+ },
},
};
}
sub search_sql {
my( $class, $string ) = @_;
+
+ if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
+ $string =~ s/\W//g;
+ } else {
+ $string =~ s/\D//g;
+ }
+
+ my $conf = new FS::Conf;
+ my $ccode = ( $conf->exists('default_phone_countrycode')
+ && $conf->config('default_phone_countrycode')
+ )
+ ? $conf->config('default_phone_countrycode')
+ : '1';
+
+ $string =~ s/^$ccode//;
+
$class->search_sql_field('phonenum', $string );
}
|| $self->ut_anything('sip_password')
|| $self->ut_numbern('pin')
|| $self->ut_textn('phone_name')
+ || $self->ut_foreign_keyn('pbxsvc', 'svc_pbx', 'svcnum' )
;
return $error if $error;