link new tax report to cust_credit_bill_pkg for credits, RT#12332
[freeside.git] / httemplate / search / cust_svc.html
index 127e7ab..a2cdc8a 100644 (file)
              'links'       => [ $link,
                                 $link,
                                 # package?
-                                ( map { $link_cust }
+                                ( map { $_ ne 'Cust. Status' ? $link_cust : '' }
                                        FS::UI::Web::cust_header()
                                  ),
                               ],
+              'align' => 'rl'. FS::UI::Web::cust_aligns(),
+              'color' => [ 
+                           '',
+                           '',
+                           FS::UI::Web::cust_colors(),
+                         ],
+              'style' => [ 
+                           '',
+                           '',
+                           FS::UI::Web::cust_styles(),
+                         ],
           )
 %>
 <%init>
 
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('List services');
+
 my $addl_from = ' LEFT JOIN part_svc  USING ( svcpart ) '.
                 ' LEFT JOIN cust_pkg  USING ( pkgnum  ) '.
                 ' LEFT JOIN cust_main USING ( custnum ) ';
@@ -76,11 +90,13 @@ if ( length( $cgi->param('search_svc') ) ) {
   push @extra_sql, "svcpart = $1";
 
 } else {
-  eidiot("No search term specified");
+  errorpage("No search term specified");
 }
 
 #here is the agent virtualization
-push @extra_sql, $FS::CurrentUser::CurrentUser->agentnums_sql;
+push @extra_sql, $FS::CurrentUser::CurrentUser->agentnums_sql( 
+                   'null_right' => 'View/link unlinked services'
+                 );
 
 my $extra_sql = ' WHERE '. join(' AND ', @extra_sql );
 
@@ -94,14 +110,15 @@ my $sql_query = {
   'table'      => 'cust_svc',
   'addl_from'  => $addl_from,
   'hashref'    => {},
-  'extra_sql'  => "$extra_sql $orderby",
+  'extra_sql'  => $extra_sql,
+  'order_by'   => $orderby,
 };
 
 my $count_query = "SELECT COUNT(*) FROM cust_svc $addl_from $extra_sql";
 
 my $link = sub {
   my $cust_svc = shift;
-  my $url = FS::UI::Web::svc_url(
+  my $url = svc_url(
     'm'        => $m,
     'action'   => 'view',
     #'part_svc' => $cust_svc->part_svc,