diff options
author | ivan <ivan> | 2008-12-31 03:28:57 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-12-31 03:28:57 +0000 |
commit | 1cf39475a4ba90ed0aa49ed983542077e4609c22 (patch) | |
tree | 29d150917928596940a7f388f118be11c6ece5d9 /httemplate/misc | |
parent | 1bed9c8b081558e4b25adae1048d3faf898e2100 (diff) |
bell west CDR format, RT#4403
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/cdr-import.html | 55 | ||||
-rw-r--r-- | httemplate/misc/process/cdr-import.html | 18 |
2 files changed, 45 insertions, 28 deletions
diff --git a/httemplate/misc/cdr-import.html b/httemplate/misc/cdr-import.html index 62e38b29b..7af6c521f 100644 --- a/httemplate/misc/cdr-import.html +++ b/httemplate/misc/cdr-import.html @@ -1,19 +1,50 @@ <% include("/elements/header.html",'Call Detail Record Import') %> -<FORM ACTION="process/cdr-import.html" METHOD="POST" ENCTYPE="multipart/form-data"> -Import a CSV file containing Call Detail Records (CDRs).<BR><BR> -CDR Format: -<SELECT NAME="format"> -% foreach my $format ( keys %formats ) { - <OPTION VALUE="<% $format %>"><% $formats{$format} %></OPTION> -% } -</SELECT> -<BR><BR> - -Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR> + +<% include( '/elements/form-file_upload.html', + 'name' => 'CDRImportForm', + 'action' => 'process/cdr-import.html', + 'num_files' => 1, + 'fields' => [ 'format', 'cdrbatch', ], + 'message' => 'CDR import successful', + 'url' => $p."search/cdr.html?cdrbatch=$cdrbatch", + ) +%> + +Import a file containing Call Detail Records (CDRs).<BR><BR> <INPUT TYPE="hidden" NAME="cdrbatch" VALUE="<% $cdrbatch %>"%> -<INPUT TYPE="submit" VALUE="Upload"> +<% ntable('#cccccc', 2) %> + + <TR> + <TD>CDR Format</TD> + <TD> + <SELECT NAME="format"> +% foreach my $format ( keys %formats ) { + <OPTION VALUE="<% $format %>"><% $formats{$format} %></OPTION> +% } + </SELECT> + </TD> + </TR> + + <% include( '/elements/file-upload.html', + 'field' => 'file', + 'label' => 'Filename', + ) + %> + + <TR> + <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"> + <INPUT TYPE = "submit" + ID = "submit" + VALUE = "Import file" + onClick = "document.InventoryItemImportForm.submit.disabled=true;" + > + </TD> + </TR> + +</TABLE> + </FORM> <% include('/elements/footer.html') %> diff --git a/httemplate/misc/process/cdr-import.html b/httemplate/misc/process/cdr-import.html index 7c4bf2b59..edc441e35 100644 --- a/httemplate/misc/process/cdr-import.html +++ b/httemplate/misc/process/cdr-import.html @@ -1,23 +1,9 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include("/elements/header.html",'Import successful') %> - <!-- XXX redirect to batch search like the payment entry... --> - <% include("/elements/footer.html",'Import successful') %> -% } +<% $server->process %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Import'); -my $fh = $cgi->upload('csvfile'); - -my $error = defined($fh) - ? FS::cdr::batch_import( { - 'filehandle' => $fh, - 'format' => scalar($cgi->param('format')), - 'cdrbatch' => scalar($cgi->param('cdrbatch')), - } ) - : 'No file'; +my $server = new FS::UI::Web::JSRPC 'FS::cdr::process_batch_import', $cgi; </%init> |