[freeside-commits] branch FREESIDE_4_BRANCH updated. ab6854dadab66cebcf43e15af560afaf381dacbf

Ivan ivan at 420.am
Thu Sep 14 07:11:53 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  ab6854dadab66cebcf43e15af560afaf381dacbf (commit)
       via  f803f2d527fc31a989d9f8d3bfccd49508b6edec (commit)
       via  3f92b437f4c97bfcb4c932ee06923b27d542cfab (commit)
      from  7ec949f0738b27d5445ddde765f7f0d3e69918ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ab6854dadab66cebcf43e15af560afaf381dacbf
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Sep 14 07:11:53 2017 -0700

    employee statistics: omit common components

diff --git a/httemplate/search/access_user_log.html b/httemplate/search/access_user_log.html
index e18ac14..75bfa13 100644
--- a/httemplate/search/access_user_log.html
+++ b/httemplate/search/access_user_log.html
@@ -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;
 
-$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 $count_extra = $extra_sql;
 $extra_sql .= ' GROUP BY pretty_path '
   if $cgi->param('group_by') eq 'path';
-#warn $extra_sql;
 
 my $query = {
   'select'    => join(' , ',
@@ -48,7 +71,6 @@ my $query = {
   '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>
diff --git a/httemplate/search/report_access_user_log.html b/httemplate/search/report_access_user_log.html
index 0c8acb3..1be6627 100644
--- a/httemplate/search/report_access_user_log.html
+++ b/httemplate/search/report_access_user_log.html
@@ -2,20 +2,21 @@
 
 <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-checkbox.html,
+       label => 'Omit components',
+       field => 'skip_components',
+       value => 'Y',
+  &>
+
 </TABLE>
 
 <BR>

commit f803f2d527fc31a989d9f8d3bfccd49508b6edec
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Sep 14 06:41:18 2017 -0700

    employee access stats: fix dates and remove web path

diff --git a/httemplate/search/access_user_log.html b/httemplate/search/access_user_log.html
index 529ae86..e18ac14 100644
--- a/httemplate/search/access_user_log.html
+++ b/httemplate/search/access_user_log.html
@@ -8,22 +8,22 @@
                                     '#',
                                     'Avg time',
                                   ],
-                 'fields'      => [ sub { shift->path },
+                 'fields'      => [ sub { shift->pretty_path },
                                     sub { shift->num_entries },
                                     sub { shift->avg_render_seconds },
                                   ],
-                 'sort_fields' => [qw( path num_entries avg_render_seconds )],
+                 'sort_fields' => [qw( pretty_path num_entries avg_render_seconds )],
              
 &>
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+  unless $FS::CurrentUser::CurrentUser->access_right('Employee Reports');
 
 my %hashref = ();
 my @extra_sql = ();
 
-my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, '_date');
+my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
 push @extra_sql, "_date >= $beginning" if $beginning;
 push @extra_sql, "_date <= $ending"    if $ending;
 
@@ -32,13 +32,13 @@ $hashref{usernum} = $cgi->param('usernum') if $cgi->param('usernum') =~ /^\d+$/;
 my $extra_sql = '';
 $extra_sql .=  (keys(%hashref) ? ' AND ' : ' WHERE ' ). join(' AND ', @extra_sql)
   if @extra_sql;
-$extra_sql .= ' GROUP BY path '
+$extra_sql .= ' GROUP BY pretty_path '
   if $cgi->param('group_by') eq 'path';
-warn $extra_sql;
+#warn $extra_sql;
 
 my $query = {
   'select'    => join(' , ',
-                   'path',
+                   "regexp_replace(path, '^/var/www/(html/)?freeside/', '') as pretty_path",
                    'COUNT(*) AS num_entries',
                    'ROUND(AVG(COALESCE(render_seconds,0)),1) '.
                            ' AS avg_render_seconds',

commit 3f92b437f4c97bfcb4c932ee06923b27d542cfab
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Sep 13 17:40:42 2017 -0700

    Revert "remove conflicts on libparams-classify-perl so we can install the version from our stretch repo"
    
    This reverts commit 9d6472ecb151bb37896ca7077c5426fcbc8323ff.

diff --git a/debian/control b/debian/control
index 17e8454..b24a1ed 100644
--- a/debian/control
+++ b/debian/control
@@ -102,6 +102,7 @@ Depends: aspell-en,gnupg,ghostscript,gsfonts,gzip,latex-xcolor,
  libgeo-streetaddress-us-perl, libbusiness-onlinepayment-perl,
  libnet-vitelity-perl (>= 0.05), libnet-sslglue-perl, libexpect-perl,
  libspreadsheet-parsexlsx-perl
+Conflicts: libparams-classify-perl (>= 0.013-6)
 Replaces: freeside (<<4)
 Breaks: freeside (<<4)
 Description: Libraries for Freeside billing and trouble ticketing

-----------------------------------------------------------------------

Summary of changes:
 debian/control                                |    1 +
 httemplate/search/access_user_log.html        |   42 +++++++++++++++++++------
 httemplate/search/report_access_user_log.html |   17 +++++-----
 3 files changed, 42 insertions(+), 18 deletions(-)




More information about the freeside-commits mailing list