From fadaa67e77ad8d5d966e252aba7f193e9e3840e3 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 18 Feb 2006 11:14:21 +0000 Subject: CDR schema and class --- httemplate/misc/cdr-import.html | 15 +++++++++++++++ httemplate/misc/process/cdr-import.html | 26 ++++++++++++++++++++++++++ httemplate/search/cdr.html | 20 ++++++++++++++++++++ httemplate/search/report_cdr.html | 7 +++++++ 4 files changed, 68 insertions(+) create mode 100644 httemplate/misc/cdr-import.html create mode 100644 httemplate/misc/process/cdr-import.html create mode 100644 httemplate/search/cdr.html create mode 100644 httemplate/search/report_cdr.html (limited to 'httemplate') diff --git a/httemplate/misc/cdr-import.html b/httemplate/misc/cdr-import.html new file mode 100644 index 000000000..dc1733249 --- /dev/null +++ b/httemplate/misc/cdr-import.html @@ -0,0 +1,15 @@ +<%= include("/elements/header.html",'Call Detail Record Import') %> +
+Import a CSV file containing Call Detail Records (CDRs).

+CDR Format:

+ +Filename:

+ + +
+ +<%= include('/elements/footer.html') %> + diff --git a/httemplate/misc/process/cdr-import.html b/httemplate/misc/process/cdr-import.html new file mode 100644 index 000000000..381b07820 --- /dev/null +++ b/httemplate/misc/process/cdr-import.html @@ -0,0 +1,26 @@ +<% + + my $fh = $cgi->upload('csvfile'); + + my $error = defined($fh) + ? FS::cdr::batch_import( { + 'filehandle' => $fh, + 'format' => $cgi->param('format'), + } ) + : 'No file'; + + if ( $error ) { + %> + + <% + eidiot($error); +# $cgi->param('error', $error); +# print $cgi->redirect( "${p}cust_main-import.cgi + } else { + %> + + <%= include("/elements/header.html",'Import sucessful') %> + + <%= include("/elements/footer.html",'Import sucessful') %> <% + } +%> diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html new file mode 100644 index 000000000..75049b443 --- /dev/null +++ b/httemplate/search/cdr.html @@ -0,0 +1,20 @@ +<% + +my $hashref = {}; +#process params for CDR search, populate $hashref... + +my $count_query = 'SELECT COUNT(*) FROM cdr'; +# and fixup $count_query + +%><%= include( 'elements/search.html', + 'title' => 'Call Detail Records', + 'name' => 'call detail records', + 'query' => { 'table' => 'cdr', + 'hashref' => $hashref + }, + 'count_query' => $count_query, + 'header' => [ fields('cdr') ], #XXX fill in some nice names + 'fields' => [ fields('cdr') ], #XXX fill in some pretty-print + # processing, etc. + ) +%> diff --git a/httemplate/search/report_cdr.html b/httemplate/search/report_cdr.html new file mode 100644 index 000000000..b9ad55e10 --- /dev/null +++ b/httemplate/search/report_cdr.html @@ -0,0 +1,7 @@ +<%= include('/elements/header.html', 'Call Detail Record Search' ) %> + +
+ + +<%= include('/elements/footer.html') %> + -- cgit v1.2.1