modules/Trackers/TrackerReporter.php
\TrackerReporter
Properties
$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"
),
)'
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"
),
)
Details- Type
- n/a
Methods
ShowActiveUsers(
$date_selected
=
null
)
:
array
Show currently active users.
Name | Type | Description |
---|---|---|
$date_selected |
Type | Description |
---|---|
array | - dataset |
ShowLastModifiedRecords(
)
:
array
Show last 10 modified records in the system
Type | Description |
---|---|
array | - dataset |
ShowLoggedInUserCount(
$date_selected
=
null
)
:
array
Show number of logged in users.
Name | Type | Description |
---|---|---|
$date_selected |
Type | Description |
---|---|
array | - dataset |
ShowMyCumulativeLoggedInTime(
\$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
Name | Type | Description |
---|---|---|
$date_selected | \$data_selected |
|
Type | Description |
---|---|
Array | - dataset |
ShowMyModuleUsage(
)
:
array
Show module usage for currently logged in user.
Type | Description |
---|---|
array | - dataset |
ShowMyWeeklyActivities(
$date_selected
=
null
)
:
array
Show what the current user has done this week.
Name | Type | Description |
---|---|---|
$date_selected |
Type | Description |
---|---|
array | - dataset |
ShowTop3ModulesUsed(
)
:
array
Show the top 3 modules used for current user
Type | Description |
---|---|
array | - dataset |
ShowTopUser(
)
:
array
Show top user as determined by total tracker entry count
Type | Description |
---|---|
array | - dataset |
ShowUsersCumulativeLoggedInTime(
\$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
Name | Type | Description |
---|---|---|
$date_selected | \$data_selected |
|
Type | Description |
---|---|
Array | - dataset |
_getTranslatedModuleName(
string $moduleName
)
:
string
Translate the given module name into the current language
Name | Type | Description |
---|---|---|
$moduleName | string |
Type | Description |
---|---|
string | translated module name |
convertSecondsToTime(
$seconds
=
0, $padHours
=
false
)
:
void
Name | Type | Description |
---|---|---|
$seconds | ||
$padHours |
execute(
string $query
)
:
array
Execute a given query and return the data set.
Name | Type | Description |
---|---|---|
$query | string |
|
Type | Description |
---|---|
array | - rows of data. |
getComboData(
)
:
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
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 |
getDateDependentQueries(
)
:
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.
Type | Description |
---|---|
array | - array of query/function names which require the date picker to be active. |
getFileMethods(
string $file
)
:
array
Return list of functions defined in file.
Name | Type | Description |
---|---|---|
$file | string |
Type | Description |
---|---|
array | - an array of functions defined in the file. |
getQueries(
)
:
array
Return a list of queries for the dashlet
Type | Description |
---|---|
array | - array of queries that can be run. |