X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_circuit.pm;h=13d84846e17aaf08b1aeff17b0a837554ccccc20;hp=f705c68f431d2cc70c3f795226ea850e132b88c7;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=1af8ff7f48f7259fc99f090c301c84b9680fdb4d diff --git a/FS/FS/svc_circuit.pm b/FS/FS/svc_circuit.pm index f705c68f4..13d84846e 100644 --- a/FS/FS/svc_circuit.pm +++ b/FS/FS/svc_circuit.pm @@ -6,7 +6,7 @@ use base qw( FS::MAC_Mixin FS::svc_Common ); -use FS::Record qw( qsearch qsearchs ); +use FS::Record qw( dbh qsearch qsearchs ); use FS::circuit_provider; use FS::circuit_type; use FS::circuit_termination; @@ -218,6 +218,20 @@ sub label { $self->get('circuit_id'); } +sub search_sql { + my ($class, $string) = @_; + my @where = (); + push @where, 'LOWER(svc_circuit.circuit_id) = LOWER(' . dbh->quote($string) . ')'; + push @where, 'LOWER(circuit_provider.provider) = LOWER(' . dbh->quote($string) . ')'; + push @where, 'LOWER(circuit_type.typename) = LOWER(' . dbh->quote($string) . ')'; + '(' . join(' OR ', @where) . ')'; +} + +sub search_sql_addl_from { + 'LEFT JOIN circuit_provider USING ( providernum ) '. + 'LEFT JOIN circuit_type USING ( typenum )'; +} + =back =head1 SEE ALSO