diff options
author | ivan <ivan> | 2008-02-20 02:07:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-02-20 02:07:02 +0000 |
commit | 4883350ca50dba7a76ffc74b59c9d948ecc90c2f (patch) | |
tree | 74e9b7ba5a4773d0091e888e91ffcb5a384e58da /httemplate/edit/process | |
parent | 1d920e3661c29398763d05c82bbe3a493a19fbae (diff) |
retry collisions a bit, acme is getting duplicate errors... guess they're using lots and lots of prepaid cards. closes: RT#3104
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/prepay_credit.cgi | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/httemplate/edit/process/prepay_credit.cgi b/httemplate/edit/process/prepay_credit.cgi index 24ce25608..8f2eb2b25 100644 --- a/httemplate/edit/process/prepay_credit.cgi +++ b/httemplate/edit/process/prepay_credit.cgi @@ -1,41 +1,9 @@ -% -%my $hashref = {}; -% -%my $agent = ''; -%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { -% $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } ); -%} -% -%my $error = ''; -% -%my $num = 0; -%if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) { -% $num = $1; -%} else { -% $error = 'Illegal number of prepaid cards: '. $cgi->param('num'); -%} -% -%$hashref->{amount} = $cgi->param('amount'); -%$hashref->{seconds} = $cgi->param('seconds') * $cgi->param('multiplier'); -%$hashref->{upbytes} = $cgi->param('upbytes') * $cgi->param('upmultiplier'); -%$hashref->{downbytes} = $cgi->param('downbytes') * $cgi->param('downmultiplier'); -%$hashref->{totalbytes} = $cgi->param('totalbytes') * $cgi->param('totalmultiplier'); -% -%$error ||= FS::prepay_credit::generate( $num, -% scalar($cgi->param('type')), -% $hashref -% ); -% %unless ( ref($error) ) { % $cgi->param('error', $error ); -% -<% - $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string ) -%> +<% $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string ) %> % } else { - -<% include("/elements/header.html", "$num prepaid cards generated". +<% include('/elements/header.html', "$num prepaid cards generated". ( $agent ? ' for '.$agent->agent : '' ) ) %> @@ -54,14 +22,41 @@ <br> % } - </FONT> -</BODY></HTML> +<% include('/elements/footer.html') %> + % } <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $hashref = {}; + +my $agent = ''; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } ); +} + +my $error = ''; + +my $num = 0; +if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) { + $num = $1; +} else { + $error = 'Illegal number of prepaid cards: '. $cgi->param('num'); +} + +$hashref->{amount} = $cgi->param('amount'); +$hashref->{seconds} = $cgi->param('seconds') * $cgi->param('multiplier'); +$hashref->{upbytes} = $cgi->param('upbytes') * $cgi->param('upmultiplier'); +$hashref->{downbytes} = $cgi->param('downbytes') * $cgi->param('downmultiplier'); +$hashref->{totalbytes} = $cgi->param('totalbytes') * $cgi->param('totalmultiplier'); + +$error ||= FS::prepay_credit::generate( $num, + scalar($cgi->param('type')), + $hashref + ); + </%init> |