[freeside-commits] branch FREESIDE_3_BRANCH updated. ed817ff4b918df398fa89835909723c7d8f311f8

Jonathan Prykop jonathan at 420.am
Tue Nov 10 21:52:04 PST 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  ed817ff4b918df398fa89835909723c7d8f311f8 (commit)
       via  b527fe6618343b4e973955c295d761127b06859e (commit)
       via  afd8bcfd6fbbc40f7fa72df58166afc6e42ddf6d (commit)
      from  4d5a5d18c44bcd5b6b7d970434d6d271503e5442 (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 ed817ff4b918df398fa89835909723c7d8f311f8
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Nov 10 23:51:17 2015 -0600

    RT#38597: OQM - svc Circuit use and setup [v3 only]

diff --git a/httemplate/elements/tr-cust_svc.html b/httemplate/elements/tr-cust_svc.html
index 2d1a9e6..de9751b 100644
--- a/httemplate/elements/tr-cust_svc.html
+++ b/httemplate/elements/tr-cust_svc.html
@@ -39,8 +39,14 @@ Usage:
 %   }
     </B>
 %   if ($part_svc->svcdb eq 'svc_circuit') {
-      <BR>Provider: <% $svc_x->circuit_provider->provider %>
-      <BR>Type: <% $svc_x->circuit_type->typename %>
+%     my $provider = qsearchs('circuit_provider', { 'providernum' => $svc_x->providernum });
+%     my $ctype    = qsearchs('circuit_type', { 'typenum' => $svc_x->typenum });
+%     if ($provider) {
+      <BR>Provider: <% $provider->provider %>
+%     }
+%     if ($ctype) {
+      <BR>Type: <% $ctype->typename %>
+%     }
 %   }
 %   if ( $opt{after_svc_callback} ) {
       <% &{ $opt{after_svc_callback} }( $cust_svc ) %>

commit b527fe6618343b4e973955c295d761127b06859e
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Nov 10 23:20:55 2015 -0600

    RT#38597: OQM - svc Circuit use and setup [fixed sql quoting]

diff --git a/FS/FS/svc_circuit.pm b/FS/FS/svc_circuit.pm
index 520e881..8ec0dad 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;
@@ -221,9 +221,9 @@ sub label {
 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).'\'';
+  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) . ')';
 }
 

commit afd8bcfd6fbbc40f7fa72df58166afc6e42ddf6d
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 ff05fb9..9d7eb7a 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -1072,9 +1072,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 d70209a..faae79d 100644
--- a/FS/FS/svc_Common.pm
+++ b/FS/FS/svc_Common.pm
@@ -1358,6 +1358,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 06015bf..520e881 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                 |   16 +++++++++++++++-
 httemplate/elements/tr-cust_svc.html |   10 ++++++++++
 4 files changed, 30 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list