diff options
Diffstat (limited to 'httemplate/misc')
-rwxr-xr-x | httemplate/misc/bill.cgi | 36 | ||||
-rw-r--r-- | httemplate/misc/cdr-post.cgi | 58 | ||||
-rw-r--r-- | httemplate/misc/cdr-post.html | 11 | ||||
-rw-r--r-- | httemplate/misc/clone-cgp_rule.html | 27 | ||||
-rw-r--r-- | httemplate/misc/delete-cgp_rule.html | 2 | ||||
-rwxr-xr-x | httemplate/misc/delete-rate_detail.html | 20 | ||||
-rw-r--r-- | httemplate/misc/inventory_item-import.html | 5 | ||||
-rw-r--r-- | httemplate/misc/maestro-customer_status-test.html | 34 | ||||
-rw-r--r-- | httemplate/misc/maestro-customer_status.cgi | 16 | ||||
-rw-r--r-- | httemplate/misc/maestro-customer_status.html | 16 | ||||
-rw-r--r-- | httemplate/misc/process/bill_batch-print.html | 5 | ||||
-rw-r--r-- | httemplate/misc/process/payment.cgi | 4 | ||||
-rwxr-xr-x | httemplate/misc/process/recharge_svc.html | 1 | ||||
-rw-r--r-- | httemplate/misc/upload-batch.cgi | 32 | ||||
-rw-r--r-- | httemplate/misc/xmlrpc.cgi | 32 |
15 files changed, 82 insertions, 217 deletions
diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index 2bc43d7b3..6151dce51 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -1,8 +1,38 @@ -<% $server->process %> +%if ( $error ) { +% errorpage($error); +%} else { +<% $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum") %> +%} <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Bill customer now'); -my $server = FS::UI::Web::JSRPC->new('FS::cust_main::process_bill_and_collect', $cgi); -</%init> +#untaint custnum +my($query) = $cgi->keywords; +$query =~ /^(\d*)$/; +my $custnum = $1; +my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); +die "Can't find customer!\n" unless $cust_main; + +my $conf = new FS::Conf; + +my $error = $cust_main->bill_and_collect( 'fatal' => 'return', + 'retry' => 'yes', + ); + + #'invoice-time'=>$time, + #'batch_card'=> 'yes', + #'batch_card'=> 'no', + #'report_badcard'=> 'yes', + #'retry_card' => 'yes', + + #this is used only by cust_main::batch_card + #need to pick & create an actual config + #value if we're going to turn this on + #("realtime-backend" doesn't exist, + # "backend-realtime" is for something + # entirely different) + #'realtime' => $conf->exists('realtime-backend'), + +</%init> diff --git a/httemplate/misc/cdr-post.cgi b/httemplate/misc/cdr-post.cgi deleted file mode 100644 index 541dac3e3..000000000 --- a/httemplate/misc/cdr-post.cgi +++ /dev/null @@ -1,58 +0,0 @@ -% if ( $error ) { -0,"<% $error %>",, -% } else { -1,"CDR import successful",<% $cdr_batch->cdrbatchnum %>,"<% $cdrbatch %>" -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -my $error = ''; -my $cdr_batch; -my $cdrbatch = ''; - -{ - - my $filename = $cgi->param('cdr_file'); - unless ( $filename ) { - $error = "No cdr_file filename"; - last; - } - - my $fh = $cgi->upload('cdr_file'); - unless ( defined($fh) ) { - $error = 'No cdr_file file'; - last; - } - - #i should probably be transactionalized. - - my $csv = new Text::CSV_XS or die Text::CSV->error_diag; - - $cdrbatch = time2str('post-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); - $cdr_batch = new FS::cdr_batch { 'cdrbatch' => $cdrbatch }; - $error = $cdr_batch->insert and last; - - chomp(my $hline = scalar(<$fh>)); - $csv->parse($hline); - my @header = $csv->fields; - - #while ( my $row = $csv->getline($fh) ) { - while (<$fh>) { - - $csv->parse($_); - my @row = $csv->fields; - - my $cdr = new FS::cdr { 'cdrbatchnum' => $cdr_batch->cdrbatchnum }; - $cdr->set( lc($_) => shift(@row) ) foreach @header; - - $error = $cdr->insert and last; - - } - -} - -$error =~ s/"/""/g; #CSV - -</%init> diff --git a/httemplate/misc/cdr-post.html b/httemplate/misc/cdr-post.html deleted file mode 100644 index 5d34272f7..000000000 --- a/httemplate/misc/cdr-post.html +++ /dev/null @@ -1,11 +0,0 @@ -<% include("/elements/header.html",'Call Detail Record - POST Import') %> - -<FORM METHOD="POST" ACTION="cdr-post.cgi" enctype="multipart/form-data"> - - cdr_file: <INPUT TYPE="file" NAME="cdr_file"><BR><BR> - - <INPUT TYPE="submit" VALUE="upload"> - -</FORM> - -<% include("/elements/footer.html") %> diff --git a/httemplate/misc/clone-cgp_rule.html b/httemplate/misc/clone-cgp_rule.html deleted file mode 100644 index d821a2dff..000000000 --- a/httemplate/misc/clone-cgp_rule.html +++ /dev/null @@ -1,27 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "browse/cgp_rule.html?svcnum=". $svcnum) %> -% } -<%init> - -# :/ needs agent-virt so you can't futz with arbitrary rules - -#die "access denied" -# unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); - -#untaint svcnum and clone -$cgi->param('svcnum') =~ /^(\d+)$/ || die "Illegal svcnum"; -my $svcnum = $1; -$cgi->param('clone') =~ /^(\d+)$/ || die "Illegal clone"; -my $clone = $1; - -my @cgp_rule = qsearch('cgp_rule', { 'svcnum' => $clone } ); - -my $error = ''; -foreach my $cgp_rule ( @cgp_rule ) { - $error = $cgp_rule->clone( $svcnum ); - last if $error; -} - -</%init> diff --git a/httemplate/misc/delete-cgp_rule.html b/httemplate/misc/delete-cgp_rule.html index 0415bc9dd..a2ba2dbc9 100644 --- a/httemplate/misc/delete-cgp_rule.html +++ b/httemplate/misc/delete-cgp_rule.html @@ -10,7 +10,7 @@ #die "access denied" # unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); -#untaint rulenum +#untaint devicenum my($query) = $cgi->keywords; $query =~ /^(\d+)$/ || die "Illegal rulenum"; my $rulenum = $1; diff --git a/httemplate/misc/delete-rate_detail.html b/httemplate/misc/delete-rate_detail.html deleted file mode 100755 index 30856a73a..000000000 --- a/httemplate/misc/delete-rate_detail.html +++ /dev/null @@ -1,20 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% header('Rate deleted') %> - <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); - </SCRIPT> - </BODY></HTML> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/ or die "Illegal ratedetailnum"; -my $rate_detail = FS::rate_detail->by_key($1); -my $error = $rate_detail->delete; - -</%init> diff --git a/httemplate/misc/inventory_item-import.html b/httemplate/misc/inventory_item-import.html index d264bafc5..990c14ffc 100644 --- a/httemplate/misc/inventory_item-import.html +++ b/httemplate/misc/inventory_item-import.html @@ -24,10 +24,7 @@ Import a file containing <% PL($inventory_class->classname) %>, one per line. %# <INPUT TYPE="hidden" NAME="itembatch" VALUE="<% $itembatch %>"> - <% include('/elements/tr-select-agent.html', - 'viewall_right' => 'None', - ) - %> + <% include('/elements/tr-select-agent.html') %> <% include( '/elements/file-upload.html', 'field' => 'file', diff --git a/httemplate/misc/maestro-customer_status-test.html b/httemplate/misc/maestro-customer_status-test.html deleted file mode 100644 index 006492919..000000000 --- a/httemplate/misc/maestro-customer_status-test.html +++ /dev/null @@ -1,34 +0,0 @@ -<% include('/elements/header.html', { - 'title' => "Customer $custnum status", - }) %> - -<% include('/elements/small_custview.html', $custnum, '', 1) %> -<BR> - -<table style="border:1px solid #000000"> -% foreach my $key (keys %$return) { -% my $value = $return->{$key}; -% $value = join(', ', @$value) if ref($value) eq 'ARRAY'; - <TR> - <TD ALIGN="right"><% $key %>:</TD> - <TD><B><% $value %></B></TD> - </TR> -% } -</table> - -<% include('/elements/footer.html') %> -<%init> - -my $return; - -my($custnum, $svcnum) = $cgi->keywords; -if ( $custnum =~ /^(\d+)$/ ) { - - use FS::Maestro; - $return = FS::Maestro::customer_status($1, $svcnum); - -} else { - $return = { 'error' => 'No custnum' }; -} - -</%init> diff --git a/httemplate/misc/maestro-customer_status.cgi b/httemplate/misc/maestro-customer_status.cgi deleted file mode 100644 index ffeb53c91..000000000 --- a/httemplate/misc/maestro-customer_status.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% $uri->query %> -<%init> - -my $uri = new URI; - -my($custnum, $svcnum) = $cgi->keywords; -if ( $custnum =~ /^(\d+)$/ ) { - - use FS::Maestro; - $uri->query_form( FS::Maestro::customer_status($1) ); - -} else { - $uri->query_form( { 'error' => 'No custnum' } ); -} - -</%init> diff --git a/httemplate/misc/maestro-customer_status.html b/httemplate/misc/maestro-customer_status.html deleted file mode 100644 index 8acae2b2a..000000000 --- a/httemplate/misc/maestro-customer_status.html +++ /dev/null @@ -1,16 +0,0 @@ -<% objToJson( $return ) %> -<%init> - -my $return; - -my($custnum, $svcnum) = $cgi->keywords; -if ( $custnum =~ /^(\d+)$/ ) { - - use FS::Maestro; - $return = FS::Maestro::customer_status($1, $svcnum); - -} else { - $return = { 'error' => 'No custnum' }; -} - -</%init> diff --git a/httemplate/misc/process/bill_batch-print.html b/httemplate/misc/process/bill_batch-print.html deleted file mode 100644 index 54d639eeb..000000000 --- a/httemplate/misc/process/bill_batch-print.html +++ /dev/null @@ -1,5 +0,0 @@ -% die "access denied" -% unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); -% my $server = FS::UI::Web::JSRPC->new('FS::bill_batch::process_print_pdf', $cgi); -<% $server->process %> -<%init></%init> diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 665001ea9..906c99663 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -96,10 +96,8 @@ if ( $payby eq 'CHEK' ) { $payinfo = $1; validate($payinfo) or errorpage(gettext('invalid_card')); # . ": ". $self->payinfo; - errorpage(gettext('unknown_card_type')) - if $payinfo !~ /^99\d{14}$/ #token - && cardtype($payinfo) eq "Unknown"; + if $payinfo !~ /^99\d{14}$/ && cardtype($payinfo) eq "Unknown"; if ( defined $cust_main->dbdef_table->column('paycvv') ) { if ( length($cgi->param('paycvv') ) ) { diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html index b56f8a282..5f68bf151 100755 --- a/httemplate/misc/process/recharge_svc.html +++ b/httemplate/misc/process/recharge_svc.html @@ -62,7 +62,6 @@ unless ($error) { $error = $cust_main->charge($amount, "Recharge " . $svc_acct->label, $description, $part_pkg->taxclass); - $error ||= "invalid $_" foreach grep { $rhash{$_} !~ /^\d*$/ } keys %rhash; if ($part_pkg->option('recharge_reset', 1)) { $error ||= $svc_acct->set_usage(\%rhash, 'null' => 1); }else{ diff --git a/httemplate/misc/upload-batch.cgi b/httemplate/misc/upload-batch.cgi index be80b1ff7..d1a84fd02 100644 --- a/httemplate/misc/upload-batch.cgi +++ b/httemplate/misc/upload-batch.cgi @@ -1,10 +1,36 @@ -<% $server->process %> +% if ( $error ) { +% errorpage($error); +% } else { + <% include('/elements/header.html','Batch results upload successful') %> + <% include('/elements/footer.html') %> +% } <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Process batches'); -my $server = - new FS::UI::Web::JSRPC 'FS::pay_batch::process_import_results', $cgi; +my $error; + +my $fh = $cgi->upload('batch_results'); +$error = 'No file uploaded' unless defined($fh); + +unless ( $error ) { + + $cgi->param('batchnum') =~ /^(\d+)$/; + my $batchnum = $1; + + my $pay_batch = qsearchs( 'pay_batch', { 'batchnum' => $batchnum } ); + if ( ! $pay_batch ) { + $error = "batchnum $batchnum not found"; + } elsif ( $pay_batch->status ne 'I' ) { + $error = "batch $batchnum is not in transit"; + } else { + $error = $pay_batch->import_results( + 'filehandle' => $fh, + 'format' => $cgi->param('format'), + ); + } + +} </%init> diff --git a/httemplate/misc/xmlrpc.cgi b/httemplate/misc/xmlrpc.cgi index 14bf9ef92..1d0383f2a 100644 --- a/httemplate/misc/xmlrpc.cgi +++ b/httemplate/misc/xmlrpc.cgi @@ -1,16 +1,18 @@ -<% $response_xml %>\ -<%init> +% +% +% my $request_xml = $cgi->param('POSTDATA'); +% +% #$r->log_error($request_xml); +% +% my $fsxmlrpc = new FS::XMLRPC; +% my ($error, $response_xml) = $fsxmlrpc->serve($request_xml); +% +% #$r->log_error($error) if $error; +% +% http_header('Content-Type' => 'text/xml', +% 'Content-Length' => length($response_xml)); +% +% print $response_xml; +% +% -my $request_xml = $cgi->param('POSTDATA'); - -#warn $request_xml; - -my $fsxmlrpc = new FS::XMLRPC; -my ($error, $response_xml) = $fsxmlrpc->serve($request_xml); - -#warn $error; - -http_header('Content-Type' => 'text/xml', - 'Content-Length' => length($response_xml)); - -</%init> |