X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_circuit.pm;h=8ec0dadced90a16e882a0fafff44e2c46eff79cf;hb=b527fe6618343b4e973955c295d761127b06859e;hp=06015bf756247c43828bd560b31af3796139e323;hpb=10614457fd7db63cbcc0bf9bfeebbbb99258eaa3;p=freeside.git diff --git a/FS/FS/svc_circuit.pm b/FS/FS/svc_circuit.pm index 06015bf75..8ec0dadce 100644 --- a/FS/FS/svc_circuit.pm +++ b/FS/FS/svc_circuit.pm @@ -6,7 +6,7 @@ use base qw( FS::svc_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) = ' . dbh->quote($string); + push @where, 'LOWER(circuit_provider.provider) = ' . dbh->quote($string); + push @where, 'LOWER(circuit_type.typename) = ' . 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