address standardization part one, finally checked in from here
[freeside.git] / httemplate / misc / cdr-import.html
index 5e9e269..b466078 100644 (file)
@@ -1,11 +1,13 @@
 <% 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 (untested)</OPTION>
-<OPTION VALUE="unitel">Unitel/RSLCOM</OPTION>
-<OPTION VALUE="ams">AMS</OPTION>
-</SELECT><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>
 
@@ -14,3 +16,11 @@ Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR>
 
 <% include('/elements/footer.html') %>
 
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Import');
+
+tie my %formats, 'Tie::IxHash', FS::cdr->import_formats;
+
+</%init>