fix broadband reporting with giant query URLs (large numbers of package defs, etc...
[freeside.git] / httemplate / search / svc_broadband.cgi
index 0e52d5f..53a0aa0 100755 (executable)
@@ -82,6 +82,8 @@ my %cust_pkg_cache;
 
 my $conf = new FS::Conf;
 
+$m->comp('/elements/handle_uri_query');
+
 my %search_hash;
 if ( $cgi->param('magic') eq 'unlinked' ) {
   %search_hash = ( 'unlinked' => 1 );
@@ -132,9 +134,12 @@ my $html_init = include('/elements/email-link.html',
                   'search_hash' => \%search_hash,
                   'table' => 'svc_broadband' 
                 );
+
+my $query = $m->scomp('/elements/create_uri_query');
+
 $html_init .= ' | ' .
   '<a href="' .
-  $fsurl . 'search/svc_broadband-map.html?' . $cgi->query_string .
+  $fsurl . 'search/svc_broadband-map.html?' . $query .
   '">' . emt('View a map of these services') . '</a>';
 
 my (@header_pkg,@fields_pkg,@blank_pkg);
@@ -149,8 +154,15 @@ foreach my $pkg_field ( @pkg_fields ) {
   #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 ) : '';
+                          my $value;
+                          if ($pkg_field eq 'package') {
+                            $value = $cust_pkg->part_pkg->pkg;
+                            #$value = $cust_pkg->pkg_label;
+                          }
+                          else {
+                            $value = $cust_pkg->get($pkg_field);#closures help alot 
+                            $value ? time2str('%b %d %Y', $value ) : '';
+                          }
                         };
 
   push @blank_pkg, '';