summaryrefslogtreecommitdiff
path: root/httemplate/search/cdr.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search/cdr.html')
-rw-r--r--httemplate/search/cdr.html55
1 files changed, 29 insertions, 26 deletions
diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html
index 827a50895..54c804c1a 100644
--- a/httemplate/search/cdr.html
+++ b/httemplate/search/cdr.html
@@ -1,29 +1,3 @@
-%
-%
-%my $title = 'Call Detail Records';
-%my $hashref = {};
-%my $count_query = 'SELECT COUNT(*) FROM cdr';
-%
-%#process params for CDR search, populate $hashref...
-%# and fixup $count_query
-%
-%if ( $cgi->param('freesidestatus') eq 'NULL' ) {
-%
-% my $title = "Unprocessed $title";
-% $hashref->{'freesidestatus'} = ''; # Record.pm will take care of it
-% #$count_query .= " AND ( freesidestatus IS NULL OR freesidestatus = '' )";
-% $count_query .= " WHERE ( freesidestatus IS NULL OR freesidestatus = '' )";
-%
-%} elsif ( $cgi->param('freesidestatus') =~ /^([\w ]+)$/ ) {
-%
-% my $title = "Processed $title";
-% $hashref->{'freesidestatus'} = $1;
-% #$count_query .= " AND freesidestatus = '$1'";
-% $count_query .= " WHERE freesidestatus = '$1'";
-%
-%}
-%
-%
<% include( 'elements/search.html',
'title' => $title,
'name' => 'call detail records',
@@ -36,3 +10,32 @@
# processing, etc.
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
+
+my $title = 'Call Detail Records';
+my $hashref = {};
+my $count_query = 'SELECT COUNT(*) FROM cdr';
+
+#process params for CDR search, populate $hashref...
+# and fixup $count_query
+
+if ( $cgi->param('freesidestatus') eq 'NULL' ) {
+
+ my $title = "Unprocessed $title";
+ $hashref->{'freesidestatus'} = ''; # Record.pm will take care of it
+ #$count_query .= " AND ( freesidestatus IS NULL OR freesidestatus = '' )";
+ $count_query .= " WHERE ( freesidestatus IS NULL OR freesidestatus = '' )";
+
+} elsif ( $cgi->param('freesidestatus') =~ /^([\w ]+)$/ ) {
+
+ my $title = "Processed $title";
+ $hashref->{'freesidestatus'} = $1;
+ #$count_query .= " AND freesidestatus = '$1'";
+ $count_query .= " WHERE freesidestatus = '$1'";
+
+}
+
+</%init>