employee statistics: omit common components
authorIvan Kohler <ivan@freeside.biz>
Thu, 14 Sep 2017 14:11:51 +0000 (07:11 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 14 Sep 2017 14:11:51 +0000 (07:11 -0700)
httemplate/search/access_user_log.html
httemplate/search/report_access_user_log.html

index e18ac14..75bfa13 100644 (file)
@@ -27,14 +27,37 @@ my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
 push @extra_sql, "_date >= $beginning" if $beginning;
 push @extra_sql, "_date <= $ending"    if $ending;
 
 push @extra_sql, "_date >= $beginning" if $beginning;
 push @extra_sql, "_date <= $ending"    if $ending;
 
-$hashref{usernum} = $cgi->param('usernum') if $cgi->param('usernum') =~ /^\d+$/;
+my $count_hr = '';
+if ( $cgi->param('usernum') =~ /^\d+$/ ) {
+  $hashref{usernum} = $cgi->param('usernum');
+  $count_hr = "WHERE usernum = ".$hashref{usernum}; 
+}
+
+if ( $cgi->param('skip_components') ) {
+  push @extra_sql, "path NOT IN ( '". join("','", 
+                                        map "/var/www/html/freeside/$_", qw(
+                                          view/REAL_logo.cgi
+                                          misc/jsrsServer.html
+                                          misc/xmlhttp-reason-hint.html
+                                          config/config-image.cgi
+                                          misc/xmlhttp-part_pkg_taxproduct.html
+                                          misc/progress-popup.html
+                                          misc/file-upload.html
+                                          misc/confirm-censustract.html
+                                          misc/xmlhttp-address_standardize.html
+                                          misc/confirm-address_standardize.html
+                                          misc/xmlhttp-part_pkg_usageprice.html
+                                        )
+                                      ).
+                             "' )";
+}
 
 my $extra_sql = '';
 $extra_sql .=  (keys(%hashref) ? ' AND ' : ' WHERE ' ). join(' AND ', @extra_sql)
   if @extra_sql;
 
 my $extra_sql = '';
 $extra_sql .=  (keys(%hashref) ? ' AND ' : ' WHERE ' ). join(' AND ', @extra_sql)
   if @extra_sql;
+my $count_extra = $extra_sql;
 $extra_sql .= ' GROUP BY pretty_path '
   if $cgi->param('group_by') eq 'path';
 $extra_sql .= ' GROUP BY pretty_path '
   if $cgi->param('group_by') eq 'path';
-#warn $extra_sql;
 
 my $query = {
   'select'    => join(' , ',
 
 my $query = {
   'select'    => join(' , ',
@@ -48,7 +71,6 @@ my $query = {
   'extra_sql' => $extra_sql,
 };
 
   'extra_sql' => $extra_sql,
 };
 
-#uuh, no, need dates and usernum too, but whatever for now
-my $count_query = 'SELECT COUNT(DISTINCT path) FROM access_user_log';
+my $count_query = "SELECT COUNT(DISTINCT path) FROM access_user_log $count_hr $count_extra";
 
 </%init>
 
 </%init>
index d43c742..209adfa 100644 (file)
@@ -2,20 +2,21 @@
 
 <FORM ACTION="access_user_log.html" METHOD="GET">
 
 
 <FORM ACTION="access_user_log.html" METHOD="GET">
 
-<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+<INPUT TYPE="hidden" NAME="group_by" VALUE="<% $group_by %>">
 
 
-  <INPUT TYPE="hidden" NAME="group_by" VALUE="<% $group_by %>">
-
-  <TR>
-    <TH CLASS="background" COLSPAN=2 ALIGN="left">
-      <FONT SIZE="+1">Search options</FONT>
-    </TH>
-  </TR>
+  <FONT CLASS="fsinnerbox-title"><% emt('Search options') %></FONT>
+  <TABLE CLASS="fsinnerbox">
 
   <& /elements/tr-input-beginning_ending.html &>
 
   <& /elements/tr-select-user.html &>
 
 
   <& /elements/tr-input-beginning_ending.html &>
 
   <& /elements/tr-select-user.html &>
 
+  <& /elements/tr-checkbox.html,
+       label => 'Omit components',
+       field => 'skip_components',
+       value => 'Y',
+  &>
+
 </TABLE>
 
 <BR>
 </TABLE>
 
 <BR>