projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5027e0e
)
employee access stats: fix dates and remove web path
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 14 Sep 2017 13:41:13 +0000
(06:41 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 14 Sep 2017 13:41:13 +0000
(06:41 -0700)
httemplate/search/access_user_log.html
patch
|
blob
|
history
diff --git
a/httemplate/search/access_user_log.html
b/httemplate/search/access_user_log.html
index
529ae86
..
e18ac14
100644
(file)
--- a/
httemplate/search/access_user_log.html
+++ b/
httemplate/search/access_user_log.html
@@
-8,22
+8,22
@@
'#',
'Avg time',
],
'#',
'Avg time',
],
- 'fields' => [ sub { shift->path },
+ 'fields' => [ sub { shift->p
retty_p
ath },
sub { shift->num_entries },
sub { shift->avg_render_seconds },
],
sub { shift->num_entries },
sub { shift->avg_render_seconds },
],
- 'sort_fields' => [qw( path num_entries avg_render_seconds )],
+ 'sort_fields' => [qw( p
retty_p
ath num_entries avg_render_seconds )],
&>
<%init>
die "access denied"
&>
<%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 %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;
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;
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 p
retty_p
ath '
if $cgi->param('group_by') eq 'path';
if $cgi->param('group_by') eq 'path';
-warn $extra_sql;
+
#
warn $extra_sql;
my $query = {
'select' => join(' , ',
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',
'COUNT(*) AS num_entries',
'ROUND(AVG(COALESCE(render_seconds,0)),1) '.
' AS avg_render_seconds',