Merge pull request #661 from ilosada/remove_statistics_issues-1.10.x

Remove statistics issues 1.10.x
1.10.x
Yannick Warnier 10 years ago
commit 1f29fd68b6
  1. 12
      main/admin/statistics/index.php
  2. 6
      main/inc/lib/statistics.lib.php
  3. 9
      main/inc/lib/zombie/zombie_report.class.php

@ -81,19 +81,19 @@ switch ($_REQUEST['report']) {
break;
case 'users':
// total amount of users
$teachers = $students = array();
$countInvisible = isset($_GET['count_invisible_courses']) ? intval($_GET['count_invisible_courses']) : null;
Statistics::printStats(
get_lang('NumberOfUsers'),
array(
get_lang('Teachers') => Statistics::countUsers(1, null, $_GET['count_invisible_courses']),
get_lang('Students') => Statistics::countUsers(5, null, $_GET['count_invisible_courses'])
get_lang('Teachers') => Statistics::countUsers(COURSEMANAGER, null, $countInvisible),
get_lang('Students') => Statistics::countUsers(STUDENT, null, $countInvisible)
)
);
$teachers = $students = array();
$countInvisible = isset($_GET['count_invisible_courses']) ? $_GET['count_invisible_courses'] : null;
foreach ($course_categories as $code => $name) {
$name = str_replace(get_lang('Department'), "", $name);
$teachers[$name] = Statistics::countUsers(1, $code, $countInvisible);
$students[$name] = Statistics::countUsers(5, $code, $countInvisible);
$teachers[$name] = Statistics::countUsers(COURSEMANAGER, $code, $countInvisible);
$students[$name] = Statistics::countUsers(STUDENT, $code, $countInvisible);
}
// docents for each course category
Statistics::printStats(get_lang('Teachers'), $teachers);

@ -247,7 +247,7 @@ class Statistics
$row[2] = $row[2];
} else {
if (!empty($row[2])) {
$originalData = $row[2];
$originalData = str_replace('\\', '', $row[2]);
$row[2] = unserialize($originalData);
if (is_array($row[2]) && !empty($row[2])) {
$row[2] = implode_with_key(', ', $row[2]);
@ -596,8 +596,8 @@ class Statistics
$table = new SortableTable(
'activities',
array('Statistics', 'get_number_of_activities'),
array('Statistics','get_activities_data'),
array('Statistics', 'getNumberOfActivities'),
array('Statistics','getActivitiesData'),
5,
50,
'DESC'

@ -40,8 +40,8 @@ class ZombieReport implements Countable
array(
'name' => 'ceiling',
'label' => get_lang('LastAccess'),
'type' => 'datepickerdate',
'default' => $this->get_ceiling(),
'type' => 'date_picker',
'default' => $this->get_ceiling('Y-m-d'),
'rules' => array(
// array(
// 'type' => 'required',
@ -121,7 +121,7 @@ class ZombieReport implements Countable
return $form->isSubmitted() == false || $form->validate();
}
function get_ceiling()
function get_ceiling($format = null)
{
$result = Request::get('ceiling');
$result = $result ? $result : ZombieManager::last_year();
@ -130,6 +130,9 @@ class ZombieReport implements Countable
$result = is_array($result) ? mktime(0, 0, 0, $result['F'], $result['d'], $result['Y']) : $result;
$result = is_numeric($result) ? (int) $result : $result;
$result = is_string($result) ? strtotime($result) : $result;
if ($format) {
$result = date($format, $result);
}
return $result;
}

Loading…
Cancel
Save