[freeside-commits] branch master updated. 212dee7b6078fc6a9dff3469b07274da5b1e905e

Jonathan Prykop jonathan at 420.am
Fri Oct 30 23:26:40 PDT 2015


The branch, master has been updated
       via  212dee7b6078fc6a9dff3469b07274da5b1e905e (commit)
      from  b8fc5d2178e7358661e37ef97b7619f7a9080f3a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 212dee7b6078fc6a9dff3469b07274da5b1e905e
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Sat Oct 31 01:26:07 2015 -0500

    RT#38597: OQM - svc Circuit use and setup

diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index 974af67..376ef02 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -1205,9 +1205,10 @@ sub smart_search_param {
   my @or = 
       map { my $table = $_;
             my $search_sql = "FS::$table"->search_sql($string);
+            my $addl_from = "FS::$table"->search_sql_addl_from();
 
             "SELECT $table.svcnum AS svcnum, '$table' AS svcdb ".
-            "FROM $table WHERE $search_sql";
+            "FROM $table $addl_from WHERE $search_sql";
           }
       FS::part_svc->svc_tables;
 
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm
index 355c383..35415a2 100644
--- a/FS/FS/svc_Common.pm
+++ b/FS/FS/svc_Common.pm
@@ -1349,6 +1349,9 @@ sub search_sql {
   #my( $class, $string ) = @_;
   '1 = 0'; #false
 }
+sub search_sql_addl_from {
+  '';
+}
 
 =item search HASHREF
 
diff --git a/FS/FS/svc_circuit.pm b/FS/FS/svc_circuit.pm
index f705c68..408bd79 100644
--- a/FS/FS/svc_circuit.pm
+++ b/FS/FS/svc_circuit.pm
@@ -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) = \''.lc($string).'\'';
+  push @where, 'LOWER(circuit_provider.provider) = \''.lc($string).'\'';
+  push @where, 'LOWER(circuit_type.typename) = \''.lc($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
diff --git a/httemplate/elements/tr-cust_svc.html b/httemplate/elements/tr-cust_svc.html
index 03de3ba..2d1a9e6 100644
--- a/httemplate/elements/tr-cust_svc.html
+++ b/httemplate/elements/tr-cust_svc.html
@@ -38,6 +38,10 @@ Usage:
       <% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %>
 %   }
     </B>
+%   if ($part_svc->svcdb eq 'svc_circuit') {
+      <BR>Provider: <% $svc_x->circuit_provider->provider %>
+      <BR>Type: <% $svc_x->circuit_type->typename %>
+%   }
 %   if ( $opt{after_svc_callback} ) {
       <% &{ $opt{after_svc_callback} }( $cust_svc ) %>
 %   }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_svc.pm                    |    3 ++-
 FS/FS/svc_Common.pm                  |    3 +++
 FS/FS/svc_circuit.pm                 |   14 ++++++++++++++
 httemplate/elements/tr-cust_svc.html |    4 ++++
 4 files changed, 23 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list