Merge branch '1.10.x' of github.com:chamilo/chamilo-lms into 1.10.x

1.10.x
Yannick Warnier 11 years ago
commit aa6d535e42
  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; break;
case 'users': case 'users':
// total amount of users // total amount of users
$teachers = $students = array();
$countInvisible = isset($_GET['count_invisible_courses']) ? intval($_GET['count_invisible_courses']) : null;
Statistics::printStats( Statistics::printStats(
get_lang('NumberOfUsers'), get_lang('NumberOfUsers'),
array( array(
get_lang('Teachers') => Statistics::countUsers(1, null, $_GET['count_invisible_courses']), get_lang('Teachers') => Statistics::countUsers(COURSEMANAGER, null, $countInvisible),
get_lang('Students') => Statistics::countUsers(5, null, $_GET['count_invisible_courses']) 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) { foreach ($course_categories as $code => $name) {
$name = str_replace(get_lang('Department'), "", $name); $name = str_replace(get_lang('Department'), "", $name);
$teachers[$name] = Statistics::countUsers(1, $code, $countInvisible); $teachers[$name] = Statistics::countUsers(COURSEMANAGER, $code, $countInvisible);
$students[$name] = Statistics::countUsers(5, $code, $countInvisible); $students[$name] = Statistics::countUsers(STUDENT, $code, $countInvisible);
} }
// docents for each course category // docents for each course category
Statistics::printStats(get_lang('Teachers'), $teachers); Statistics::printStats(get_lang('Teachers'), $teachers);

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

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

Loading…
Cancel
Save