X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fpayment_gateway.html;h=812c988c58c825ba04a41bb63a474c994c525e76;hb=75e11f1d1a5ced24496b5732e290f7762403feb8;hp=b9e4d47da102d6a548b9ad28300834b6121d80c9;hpb=452dc46f00628a3628f839b1af70e0f9295246e7;p=freeside.git diff --git a/httemplate/edit/process/payment_gateway.html b/httemplate/edit/process/payment_gateway.html index b9e4d47da..812c988c5 100644 --- a/httemplate/edit/process/payment_gateway.html +++ b/httemplate/edit/process/payment_gateway.html @@ -1,33 +1,22 @@ -<% - -my $gatewaynum = $cgi->param('gatewaynum'); - -my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum; +<% include( 'elements/process.html', + 'table' => 'payment_gateway', + 'viewall_dir' => 'browse', + 'args_callback' => $args_callback, + ) +%> +<%init> -my $new = new FS::payment_gateway ( { - map { - $_, scalar($cgi->param($_)); - } fields('payment_gateway') -} ); +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -my @options = split(/\r?\n/, $cgi->param('gateway_options') ); -pop @options - if scalar(@options) % 2 && $options[-1] =~ /^\s*$/; -my %options = @options; +my $args_callback = sub { + my ( $cgi, $new ) = @_; -my $error; -if ( $gatewaynum ) { - $error=$new->replace($old); -} else { - $error=$new->insert(\%options); - $gatewaynum=$new->getfield('gatewaynum'); -} + my @options = split(/\r?\n/, $cgi->param('gateway_options') ); + pop @options + if scalar(@options) % 2 && $options[-1] =~ /^\s*$/; + (@options) +}; -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/payment_gateway.html"); -} -%> +