X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_phone.pm;h=36d57a596cb0230011b3e57655ed48c0d648d739;hb=013646e6629fc94b4cda03c495aa56677f2de381;hp=887f7bed37bc02ee0de417e9255a6224af8fa045;hpb=8cc50a2ad12ec3d5bd3f31db741290664064ef06;p=freeside.git diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index 887f7bed3..36d57a596 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -1,7 +1,7 @@ package FS::svc_phone; +use base qw( FS::svc_Domain_Mixin FS::location_Mixin FS::svc_Common ); use strict; -use base qw( FS::svc_Domain_Mixin FS::location_Mixin FS::svc_Common ); use vars qw( $DEBUG $me @pw_set $conf $phone_name_max $passwordmin $passwordmax ); @@ -13,7 +13,6 @@ use FS::Record qw( qsearch qsearchs dbh ); use FS::PagedSearch qw( psearch ); use FS::Msgcat qw(gettext); use FS::part_svc; -use FS::phone_device; use FS::svc_pbx; use FS::svc_domain; use FS::cust_location; @@ -239,7 +238,7 @@ Class method which returns an SQL fragment to search for the given string. sub search_sql { my( $class, $string ) = @_; - my $conf = new FS::Conf; + #my $conf = new FS::Conf; if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) { $string =~ s/\W//g; @@ -464,7 +463,11 @@ and replace methods. sub check { my $self = shift; - my $conf = new FS::Conf; + #my $conf = new FS::Conf; + + my $x = $self->setfixed; + return $x unless ref($x); + my $part_svc = $x; my $phonenum = $self->phonenum; my $phonenum_check_method; @@ -546,8 +549,9 @@ sub check { return "SIP password must be shorter than $passwordmax characters" if length($self->sip_password) > $passwordmax; - } else { # option for this? + } elsif ( $part_svc->part_svc_column('sip_password')->columnflag ne 'F' ) { + # option for this? $self->sip_password( join('', map $pw_set[ int(rand $#pw_set) ], (1..min($passwordmax,16)) ) ); @@ -648,7 +652,7 @@ sub radius_check { my $self = shift; my %check = (); - my $conf = new FS::Conf; + #my $conf = new FS::Conf; my $password; if ( $conf->config('svc_phone-radius-password') eq 'countrycode_phonenum' ) { @@ -691,11 +695,6 @@ Returns any FS::phone_device records associated with this service. =cut -sub phone_device { - my $self = shift; - qsearch('phone_device', { 'svcnum' => $self->svcnum } ); -} - #override location_Mixin version cause we want to try the cust_pkg location #in between us and cust_main # XXX what to do in the unlinked case??? return a pseudo-object that returns