summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2006-02-18 11:14:21 +0000
committerivan <ivan>2006-02-18 11:14:21 +0000
commitfadaa67e77ad8d5d966e252aba7f193e9e3840e3 (patch)
tree8f425d82a445dd5ba6ed58f316e4b7a6802ef2dc /httemplate
parent6d27649c93f3f83c14611c790281a7b667062fc0 (diff)
CDR schema and class
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/misc/cdr-import.html15
-rw-r--r--httemplate/misc/process/cdr-import.html26
-rw-r--r--httemplate/search/cdr.html20
-rw-r--r--httemplate/search/report_cdr.html7
4 files changed, 68 insertions, 0 deletions
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') %>
+<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">
+<!-- <OPTION VALUE="asterisk">Asterisk</OPTION> -->
+<OPTION VALUE="unitel">Unitel/RSLCOM</OPTION>
+</SELECT><BR><BR>
+
+Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR>
+
+<INPUT TYPE="submit" VALUE="Upload">
+</FORM>
+
+<%= 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 ) {
+ %>
+ <!-- mason kludge -->
+ <%
+ eidiot($error);
+# $cgi->param('error', $error);
+# print $cgi->redirect( "${p}cust_main-import.cgi
+ } else {
+ %>
+ <!-- mason kludge -->
+ <%= include("/elements/header.html",'Import sucessful') %>
+ <!-- XXX redirect to batch search like the payment entry... -->
+ <%= 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' ) %>
+
+<FORM ACTION="cdr.html" METHOD="GET">
+<INPUT TYPE="submit" VALUE="Search Call Detail Records">
+
+<%= include('/elements/footer.html') %>
+