[freeside-commits] branch FREESIDE_4_BRANCH updated. f1d59659244a34b2ee9c6380babff464639e2927

Jonathan Prykop jonathan at 420.am
Mon Aug 29 17:37:31 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  f1d59659244a34b2ee9c6380babff464639e2927 (commit)
      from  c1822833ea22d3d32d2f67412b834d48bfdef7fb (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 f1d59659244a34b2ee9c6380babff464639e2927
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Aug 4 21:07:24 2016 -0500

    RT#71930: Package fields are not showing up in...Advanced wireless broadband report

diff --git a/httemplate/search/svc_broadband.cgi b/httemplate/search/svc_broadband.cgi
index 8cdf29d..0e52d5f 100755
--- a/httemplate/search/svc_broadband.cgi
+++ b/httemplate/search/svc_broadband.cgi
@@ -10,6 +10,7 @@
                                  'Router',
                                  @tower_header,
                                  'IP Address',
+                                 @header_pkg,
                                  emt('Pkg. Status'),
                                  FS::UI::Web::cust_header($cgi->param('cust_fields')),
                                ],
@@ -21,6 +22,7 @@
                                  },
                                  @tower_fields,
                                  'ip_addr',
+                                 @fields_pkg,
                                  sub {
                                    $cust_pkg_cache{$_[0]->svcnum} ||= $_[0]->cust_svc->cust_pkg;
                                    return '' unless $cust_pkg_cache{$_[0]->svcnum};
@@ -32,20 +34,25 @@
                                  $link,
                                  '', #$link_router,
                                  (map '', @tower_fields),
-                                 $link,
+                                 $link, # ip_addr
+                                 @blank_pkg,
                                  '', # pkg status
                                  ( map { $_ ne 'Cust. Status' ? $link_cust : '' }
                                        FS::UI::Web::cust_header($cgi->param('cust_fields'))
                                  ),
                                ],
-              'align'       => 'rll'.('r' x @tower_fields).'rr'.
+              'align'       => 'rll'.('r' x @tower_fields).
+                                'r'. # ip_addr
+                                $align_pkg.
+                                'r'. # pkg status
                                 FS::UI::Web::cust_aligns(),
               'color'       => [ 
                                  '',
                                  '',
                                  '',
                                  (map '', @tower_fields),
-                                 '',
+                                 '', # ip_addr
+                                 @blank_pkg,
                                  sub {
                                    $cust_pkg_cache{$_[0]->svcnum} ||= $_[0]->cust_svc->cust_pkg;
                                    return '' unless $cust_pkg_cache{$_[0]->svcnum};
@@ -59,8 +66,9 @@
                                  '',
                                  '',
                                  (map '', @tower_fields),
-                                 '',
-                                 'b',
+                                 '',  # ip_addr
+                                 @blank_pkg,
+                                 'b', # pkg status
                                  FS::UI::Web::cust_styles(),
                                ],
           
@@ -129,4 +137,25 @@ $html_init .= ' | ' .
   $fsurl . 'search/svc_broadband-map.html?' . $cgi->query_string .
   '">' . emt('View a map of these services') . '</a>';
 
+my (@header_pkg, at fields_pkg, at blank_pkg);
+my $align_pkg = '';
+#false laziness with search/svc_acct.cgi
+$cgi->param('cust_pkg_fields') =~ /^([\w\,]*)$/ or die "bad cust_pkg_fields";
+my @pkg_fields = split(',', $1);
+foreach my $pkg_field ( @pkg_fields ) {
+  ( my $header = ucfirst($pkg_field) ) =~ s/_/ /; #:/
+  push @header_pkg, $header;
+
+  #not the most efficient to do it every field, but this is of niche use. so far
+  push @fields_pkg, sub { my $svc_x = shift;
+                          my $cust_pkg = $svc_x->cust_svc->cust_pkg or return '';
+                          my $value = $cust_pkg->get($pkg_field);#closures help alot
+                          $value ? time2str('%b %d %Y', $value ) : '';
+                        };
+
+  push @blank_pkg, '';
+  $align_pkg .= 'c';
+}
+
+
 </%init>

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

Summary of changes:
 httemplate/search/svc_broadband.cgi |   39 ++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list