X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpayment_gateway.html;h=a06e5cf7cc456dae9481c181079a30e02162db0b;hb=12f4cc4b100b849de3584d5d1a2376cebcd8729f;hp=671f7118cc26c6425f8256f90ef08aeebc5c097c;hpb=d8c81a25cb29cf0ca5d7cdeb8160f79d4fbb0bc6;p=freeside.git
diff --git a/httemplate/browse/payment_gateway.html b/httemplate/browse/payment_gateway.html
index 671f7118c..a06e5cf7c 100644
--- a/httemplate/browse/payment_gateway.html
+++ b/httemplate/browse/payment_gateway.html
@@ -1,79 +1,98 @@
-<% include("/elements/header.html",'Payment gateways', menubar(
- 'Agents' => $p. 'browse/agent.cgi',
-)) %>
+<% include( 'elements/browse.html',
+ 'title' => 'Payment gateways',
+ 'menubar' => [ 'Agents' => $p.'browse/agent.cgi', ],
+ 'html_init' => $html_init,
+ 'name' => 'payment gateways',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 1,
+ 'query' => { 'table' => 'payment_gateway',
+ 'hashref' => {},
+ },
+ 'count_query' => $count_query,
+ 'header' => [ '#',
+ 'Type',
+ 'Gateway',
+ 'Username',
+ 'Password',
+ 'Action',
+ 'URL',
+ 'Options',
+ ],
+ 'fields' => [ 'gatewaynum',
+ 'namespace_description',
+ $gateway_sub,
+ 'gateway_username',
+ sub { ' - '; },
+ 'gateway_action',
+ 'gateway_callback_url',
+ $options_sub,
+ ],
+ )
+%>
-Add a new payment gateway
+
-<% $cgi->param('showdisabled')
- ? do { $cgi->param('showdisabled', 0);
- '( hide disabled gateways )'; }
- : do { $cgi->param('showdisabled', 1);
- '( show disabled gateways )'; }
-%>
+<% include('/elements/footer.html') %>
+<%once>
-<% table() %>
-
- param('showdisabled') ? 1 : 2 %>># |
- Gateway |
- Username |
- Password |
- Action |
- Options |
-
-% foreach my $payment_gateway ( qsearch( 'payment_gateway', \%search ) ) {
-
-
-
- <% $payment_gateway->gatewaynum %> |
-% if ( !$cgi->param('showdisabled') ) {
-
- <% $payment_gateway->disabled ? 'DISABLED' : '' %> |
-% }
-
- <% $payment_gateway->gateway_module %>
-
- (edit)
- <% !$payment_gateway->disabled
- ? '(disable)'
- : ''
- %>
-
- |
- <% $payment_gateway->gateway_username %> |
- - |
- <% $payment_gateway->gateway_action %> |
-
-
-% my %options = $payment_gateway->options;
-% foreach my $option ( keys %options ) {
-%
-
-
- <% $option %>: |
- <% $options{$option} %> |
-
-% }
-
-
- |
-
-% }
+my $html_init = qq!
+ Add a new payment gateway
+
+
-
+!;
-<% include('/elements/footer.html') %>
+my $gateway_sub = sub {
+ my($payment_gateway) = @_;
+
+ my $gatewaynum = $payment_gateway->gatewaynum;
+
+ my $html = $payment_gateway->gateway_module. ' '. qq!
+
+ (edit)
+ !;
+
+ unless ( $payment_gateway->disabled ) {
+ $html .= qq!
+ (disable)
+ !;
+ }
+
+ $html .= '';
+ $html;
+
+};
+
+my $options_sub = sub {
+ my($payment_gateway) = @_;
+
+ #should return a structure instead of this manual formatting...
+
+ my $html = '';
+
+ my %options = $payment_gateway->options;
+ foreach my $option ( keys %options ) {
+ $html .= ''. $option. ': | '.
+ ''. $options{$option}. ' |
';
+ }
+ $html .= '
';
+
+ $html;
+};
+
+my $count_query = 'SELECT COUNT(*) FROM payment_gateway';
+
+%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-my %search;
-if ( $cgi->param('showdisabled') ) {
- %search = ();
-} else {
- %search = ( 'disabled' => '' );
-}
-
%init>