This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / httemplate / edit / process / agent_payment_gateway.html
1 <% $cgi->redirect(popurl(3). "browse/agent.cgi") %>
2 <%init>
3
4 die "access denied"
5   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
6
7 $cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum";
8 my $agent = qsearchs('agent', { 'agentnum' => $1 } );
9 die "agentnum $1 not found" unless $agent;
10
11 #my $old
12
13 my @new = map {
14                 my $cardtype = $_;
15                 new FS::agent_payment_gateway {
16                   ( map { $_ => scalar($cgi->param($_)) }
17                                     fields('agent_payment_gateway')
18                   ),
19                   'cardtype' => $cardtype,
20                 };
21               }
22               $cgi->param('cardtype');
23
24 foreach my $new (@new) {
25   my $error = $new->insert;
26   die $error if $error;
27 }
28
29 </%init>