modules/Trackers/TrackerReporter.php

Show: inherited
Table of Contents

\TrackerReporter

Package:

Properties

Propertyprivate  $default_queries= 'array( 'all' => array( "ShowLastModifiedRecords" => "", //See function below "ShowActiveUsers" => "SELECT distinct u.user_name as user_name, u.first_name, u.last_name, ts.date_end as last_action from users u, tracker_sessions ts where u.id = ts.user_id and ts.active = 1 and ts.date_end > {0} order by ts.date_end desc", "ShowLoggedInUserCount" => "select count(distinct user_id) as active_users from tracker_sessions where active = 1 and date_end > {0}", "ShowTopUser" => "", //See function below "ShowMyWeeklyActivities" => "", //See function below "ShowMyModuleUsage" => "select module_name, count(module_name) as total_count from tracker where user_id = '{0}' and module_name != 'UserPreferences' group by module_name order by total_count desc", "ShowTop3ModulesUsed" => "", //See function below "ShowMyCumulativeLoggedInTime" => "select sum(seconds) as total_login_time from tracker_sessions where user_id = '{0}' and date_start > {1}", "ShowUsersCumulativeLoggedInTime" => "select u.user_name as user_name, sum(t.seconds) as total_login_time from tracker_sessions t, users u where t.user_id = u.id and t.date_start > {0} group by u.user_name" ), )'
Default valuearray( 'all' => array( "ShowLastModifiedRecords" => "", //See function below "ShowActiveUsers" => "SELECT distinct u.user_name as user_name, u.first_name, u.last_name, ts.date_end as last_action from users u, tracker_sessions ts where u.id = ts.user_id and ts.active = 1 and ts.date_end > {0} order by ts.date_end desc", "ShowLoggedInUserCount" => "select count(distinct user_id) as active_users from tracker_sessions where active = 1 and date_end > {0}", "ShowTopUser" => "", //See function below "ShowMyWeeklyActivities" => "", //See function below "ShowMyModuleUsage" => "select module_name, count(module_name) as total_count from tracker where user_id = '{0}' and module_name != 'UserPreferences' group by module_name order by total_count desc", "ShowTop3ModulesUsed" => "", //See function below "ShowMyCumulativeLoggedInTime" => "select sum(seconds) as total_login_time from tracker_sessions where user_id = '{0}' and date_start > {1}", "ShowUsersCumulativeLoggedInTime" => "select u.user_name as user_name, sum(t.seconds) as total_login_time from tracker_sessions t, users u where t.user_id = u.id and t.date_start > {0} group by u.user_name" ), )Details
Type
n/a
Propertyprivate  $included_methods= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $queries= ''
Details
Type
n/a
Propertypublic  $sort_types= 'array( "ShowMyModuleUsage"=>array("total_count"=>"asInt"), "ShowTop3ModulesUsed"=>array("total_count"=>"asInt") )'
Default valuearray( "ShowMyModuleUsage"=>array("total_count"=>"asInt"), "ShowTop3ModulesUsed"=>array("total_count"=>"asInt") )Details
Type
n/a

Methods

methodpublicShowActiveUsers(  $date_selected = null ) : array

Show currently active users.

Parameters
Name Type Description
$date_selected
Returns
Type Description
array - dataset
methodpublicShowLastModifiedRecords( ) : array

Show last 10 modified records in the system

Returns
Type Description
array - dataset
methodpublicShowLoggedInUserCount(  $date_selected = null ) : array

Show number of logged in users.

Parameters
Name Type Description
$date_selected
Returns
Type Description
array - dataset
methodpublicShowMyCumulativeLoggedInTime( \$data_selected $date_selected = null ) : Array

ShowMyCumulativeLoggedInTime

Returns a time formmated display of total time logged in for current user from the given date interval

Parameters
Name Type Description
$date_selected \$data_selected
  • Optional date filter value (default is one week from today)
Returns
Type Description
Array - dataset
methodpublicShowMyModuleUsage( ) : array

Show module usage for currently logged in user.

Returns
Type Description
array - dataset
methodpublicShowMyWeeklyActivities(  $date_selected = null ) : array

Show what the current user has done this week.

Parameters
Name Type Description
$date_selected
Returns
Type Description
array - dataset
methodpublicShowTop3ModulesUsed( ) : array

Show the top 3 modules used for current user

Returns
Type Description
array - dataset
methodpublicShowTopUser( ) : array

Show top user as determined by total tracker entry count

Returns
Type Description
array - dataset
methodpublicShowUsersCumulativeLoggedInTime( \$data_selected $date_selected = null ) : Array

ShowUsersCumulativeLoggedInTime

Returns a time formmated display of total time logged in for all users from the given date interval

Parameters
Name Type Description
$date_selected \$data_selected
  • Optional date filter value (default is one week from today)
Returns
Type Description
Array - dataset
methodpublic__call(  $method,  $args ) : void

Parameters
Name Type Description
$method
$args
methodpublic__construct( ) : void

methodprotected_getTranslatedModuleName( string $moduleName ) : string

Translate the given module name into the current language

Parameters
Name Type Description
$moduleName string
Returns
Type Description
string translated module name
methodprivateconvertSecondsToTime(  $seconds = 0,  $padHours = false ) : void

Parameters
Name Type Description
$seconds
$padHours
methodprivateexecute( string $query ) : array

Execute a given query and return the data set.

Parameters
Name Type Description
$query string
  • the query to execute
Returns
Type Description
array - rows of data.
methodpublicgetComboData( ) : array

Returns array of name/value pairs for the query methods where name is the localzied String label to display and value is the method to call

Returns
Type Description
array - array of name/value pairs for the query methods where name is the localzied String label to display and value is the method to call
methodpublicgetDateDependentQueries( ) : array

getDateSelectionQueries

Returns an array of functions which support the date picker on th the dashlet. This is important because we do not want to show the Date Picker when it is not necessary, although even if it is shown it will not affect functionality. It may only lead to user confustion.

Returns
Type Description
array - array of query/function names which require the date picker to be active.
methodprivategetFileMethods( string $file ) : array

Return list of functions defined in file.

Parameters
Name Type Description
$file string
Returns
Type Description
array - an array of functions defined in the file.
methodprivategetQueries( ) : array

Return a list of queries for the dashlet

Returns
Type Description
array - array of queries that can be run.
methodprivatesetup( string $query, array $args ) : string

Given a query(method_name) and some arguments attempt to build the query

Parameters
Name Type Description
$query string
  • the query to index
$args array
Returns
Type Description
string - the query to execute
Documentation was generated by DocBlox 0.18.1.