1 <& elements/search.html,
2 'title' => 'Access Log',
5 'count_query' => $count_query,
11 'fields' => [ sub { shift->pretty_path },
12 sub { shift->num_entries },
13 sub { shift->avg_render_seconds },
15 'sort_fields' => [qw( pretty_path num_entries avg_render_seconds )],
21 unless $FS::CurrentUser::CurrentUser->access_right('Employee Reports');
26 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
27 push @extra_sql, "_date >= $beginning" if $beginning;
28 push @extra_sql, "_date <= $ending" if $ending;
31 if ( $cgi->param('usernum') =~ /^\d+$/ ) {
32 $hashref{usernum} = $cgi->param('usernum');
33 $count_hr = "WHERE usernum = ".$hashref{usernum};
36 if ( $cgi->param('skip_components') ) {
37 push @extra_sql, "path NOT IN ( '". join("','",
38 map "/var/www/html/freeside/$_", qw(
41 misc/xmlhttp-reason-hint.html
42 config/config-image.cgi
43 misc/xmlhttp-part_pkg_taxproduct.html
44 misc/progress-popup.html
46 misc/confirm-censustract.html
47 misc/xmlhttp-address_standardize.html
48 misc/confirm-address_standardize.html
49 misc/xmlhttp-part_pkg_usageprice.html
56 $extra_sql .= (keys(%hashref) ? ' AND ' : ' WHERE ' ). join(' AND ', @extra_sql)
58 my $count_extra = $extra_sql;
59 $extra_sql .= ' GROUP BY pretty_path '
60 if $cgi->param('group_by') eq 'path';
63 'select' => join(' , ',
64 "regexp_replace(path, '^/var/www/(html/)?freeside/', '') as pretty_path",
65 'COUNT(*) AS num_entries',
66 'ROUND(AVG(COALESCE(render_seconds,0)),1) '.
67 ' AS avg_render_seconds',
69 'table' => 'access_user_log',
70 'hashref' => \%hashref,
71 'extra_sql' => $extra_sql,
74 my $count_query = "SELECT COUNT(DISTINCT path) FROM access_user_log $count_hr $count_extra";