summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/payment_gateway.html
diff options
context:
space:
mode:
authorcvs2git <cvs2git>2009-10-11 02:42:17 +0000
committercvs2git <cvs2git>2009-10-11 02:42:17 +0000
commita83a000a027d1272e813259d09230d701d84df64 (patch)
tree71500c957e6d7db3e1ad3d59e74ca7bbb14e44ff /httemplate/edit/process/payment_gateway.html
parent097a12385d80ef52f37d4cc2bb93bc3f81e6f8e6 (diff)
parent0b69c091543b56a45f2ae6b8718fc67f381a6686 (diff)
This commit was manufactured by cvs2svn to create branchfreeside_1_9_1
'FREESIDE_1_9_BRANCH'.
Diffstat (limited to 'httemplate/edit/process/payment_gateway.html')
-rw-r--r--httemplate/edit/process/payment_gateway.html39
1 files changed, 13 insertions, 26 deletions
diff --git a/httemplate/edit/process/payment_gateway.html b/httemplate/edit/process/payment_gateway.html
index b16bc3d..812c988 100644
--- a/httemplate/edit/process/payment_gateway.html
+++ b/httemplate/edit/process/payment_gateway.html
@@ -1,35 +1,22 @@
-%if ( $error ) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string ) %>
-%} else {
-<% $cgi->redirect(popurl(3). "browse/payment_gateway.html") %>
-%}
+<% include( 'elements/process.html',
+ 'table' => 'payment_gateway',
+ 'viewall_dir' => 'browse',
+ 'args_callback' => $args_callback,
+ )
+%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-my $gatewaynum = $cgi->param('gatewaynum');
+my $args_callback = sub {
+ my ( $cgi, $new ) = @_;
-my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;
+ my @options = split(/\r?\n/, $cgi->param('gateway_options') );
+ pop @options
+ if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
+ (@options)
+};
-my $new = new FS::payment_gateway ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('payment_gateway')
-} );
-
-my @options = split(/\r?\n/, $cgi->param('gateway_options') );
-pop @options
- if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
-my %options = @options;
-
-my $error;
-if ( $gatewaynum ) {
- $error=$new->replace($old, \%options);
-} else {
- $error=$new->insert(\%options);
- $gatewaynum=$new->getfield('gatewaynum');
-}
</%init>