its all about control
[freeside.git] / httemplate / browse / agent.cgi
index 001e6ba..063f259 100755 (executable)
@@ -1,17 +1,3 @@
-%
-%
-%  my %search;
-%  if ( $cgi->param('showdisabled')
-%       || !dbdef->table('agent')->column('disabled') ) {
-%    %search = ();
-%  } else {
-%    %search = ( 'disabled' => '' );
-%  }
-%
-%  my $conf = new FS::Conf;
-%
-%
-
 <% include("/elements/header.html",'Agent Listing', menubar(
   'Main Menu'   => $p,
   'Agent Types' => $p. 'browse/agent_type.cgi',
@@ -332,8 +318,8 @@ Unused
 % } 
 
 
-        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-          <TABLE CELLSPACING=0 CELLPADDING=0>
+        <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
+          <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0>
 % foreach my $override (
 %                 # sort { }  want taxclass-full stuff first?  and default cards (empty cardtype)
 %                 qsearch('agent_payment_gateway', { 'agentnum' => $agent->agentnum } )
@@ -347,7 +333,7 @@ Unused
                         ? ' for '. $override->taxclass. ' only'
                         : ''
                   %>
-                  <FONT SIZE=-1><A HREF="<%$p%>misc/delete-agent_payment_gateway.cgi?<% 'XXXoverridenum' %>">(delete)</A></FONT>
+                  <FONT SIZE=-1><A HREF="<%$p%>misc/delete-agent_payment_gateway.cgi?<% $override->agentgatewaynum %>">(delete)</A></FONT>
                 </TD>
               </TR>
 % } 
@@ -370,3 +356,19 @@ Unused
     </TABLE>
   </BODY>
 </HTML>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my %search;
+if ( $cgi->param('showdisabled')
+     || !dbdef->table('agent')->column('disabled') ) {
+  %search = ();
+} else {
+  %search = ( 'disabled' => '' );
+}
+
+my $conf = new FS::Conf;
+
+</%init>