optimize customer list, RT#30173
[freeside.git] / httemplate / search / svc_broadband.cgi
index e56ec39..6bf4f08 100755 (executable)
@@ -1,4 +1,4 @@
-<& elements/search.html,
+<& elements/svc_Common.html,
               'title'       => 'Broadband Search Results',
               'name'        => 'broadband services',
               'html_init'   => $html_init,
@@ -61,9 +61,8 @@ my $conf = new FS::Conf;
 my %search_hash;
 if ( $cgi->param('magic') eq 'unlinked' ) {
   %search_hash = ( 'unlinked' => 1 );
-}
-else {
-  foreach (qw(custnum agentnum svcpart)) {
+} else {
+  foreach (qw( custnum agentnum svcpart cust_fields )) {
     $search_hash{$_} = $cgi->param($_) if $cgi->param($_);
   }
   foreach (qw(pkgpart routernum towernum sectornum)) {
@@ -72,7 +71,7 @@ else {
 }
 
 if ( $cgi->param('sortby') =~ /^(\w+)$/ ) {
-  $search_hash{'order_by'} = $1;
+  $search_hash{'order_by'} = "ORDER BY $1";
 }
 
 my $sql_query = FS::svc_broadband->search(\%search_hash);
@@ -106,5 +105,9 @@ my $html_init = include('/elements/email-link.html',
                   'search_hash' => \%search_hash,
                   'table' => 'svc_broadband' 
                 );
+$html_init .= ' | ' .
+  '<a href="' .
+  $fsurl . 'search/svc_broadband-map.html?' . $cgi->query_string .
+  '">' . emt('View a map of these services') . '</a>';
 
 </%init>