add back raw SQL query (it had an appropriate ACL)
authorivan <ivan>
Thu, 27 Mar 2008 20:40:43 +0000 (20:40 +0000)
committerivan <ivan>
Thu, 27 Mar 2008 20:40:43 +0000 (20:40 +0000)
httemplate/elements/menu.html
httemplate/search/report_sql.html [new file with mode: 0644]

index 0c74746..047671a 100644 (file)
@@ -213,6 +213,8 @@ $report_menu{'Billing events'} =  [ \%report_bill_event, 'Billing events' ]
   if $curuser->access_right('Billing event reports');
 $report_menu{'Financial'}  = [ \%report_financial, 'Financial reports' ]
   if $curuser->access_right('Financial reports');
+$report_menu{'SQL Query'}  = [ $fsurl.'search/report_sql.html', 'SQL Query' ]
+  if $curuser->access_right('Raw SQL');
 
 tie my %tools_importing, 'Tie::IxHash',
   'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ],
diff --git a/httemplate/search/report_sql.html b/httemplate/search/report_sql.html
new file mode 100644 (file)
index 0000000..9953308
--- /dev/null
@@ -0,0 +1,23 @@
+<% include('/elements/header.html', 'SQL Query' ) %>
+
+<FORM ACTION="sql.html" METHOD="GET">
+
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+  <TR>
+    <TD ALIGN="right" VALIGN="top">SELECT </TD>
+    <TD><TEXTAREA NAME="sql"></TEXTAREA></TD>
+  </TR>
+</TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="Query">
+
+</FORM>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Raw SQL');
+
+</%init>