Some fixes in the dashboard due the recent changes in the single database see #3910

skala
Julio Montoya 14 years ago
parent afcf7c8da8
commit bb9f780de7
  1. 3
      main/attendance/attendance_calendar.php
  2. 8
      main/inc/lib/thematic.lib.php
  3. 1
      plugin/dashboard/block_course/block_course.class.php
  4. 4
      plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php

@ -56,7 +56,8 @@ if (isset($action) && $action == 'calendar_add') {
$form->addElement('html','<br /><br />');
$form->addElement('html', '<div id="repeat_check">&nbsp;'. get_lang('RepeatDate').'<input type="checkbox" name="repeat" '.($repeat?'checked="checked"':'').' onclick="javascript: if(this.checked){document.getElementById(\'repeat-date-attendance\').style.display=\'block\';}else{document.getElementById(\'repeat-date-attendance\').style.display=\'none\';}"/>');
$form->addElement('html', '<div id="repeat_check"><input id="repeat_id" type="checkbox" name="repeat" '.($repeat?'checked="checked"':'').' onclick="javascript: if(this.checked){document.getElementById(\'repeat-date-attendance\').style.display=\'block\';}else{document.getElementById(\'repeat-date-attendance\').style.display=\'none\';}"/> <label for="repeat_id">'. get_lang('RepeatDate').'</label>');
if ($repeat) {
$form->addElement('html', '<div id="repeat-date-attendance" style="display:block">');
} else {

@ -1068,11 +1068,13 @@ class Thematic
* @return float Average of thematic advances
*/
public function get_total_average_of_thematic_advances($course_code = null, $session_id = null) {
if (empty($course_code)) {
$course_code = api_get_course_id();
}
if (api_get_session_id()) {
$thematic_data = $this->get_thematic_list(null, api_get_course_id());
$thematic_data = $this->get_thematic_list(null, $course_code );
} else {
$thematic_data = $this->get_thematic_list(null, api_get_course_id(), 0);
$thematic_data = $this->get_thematic_list(null, $course_code, 0);
}
$new_thematic_data = array();
if (!empty($thematic_data)) {

@ -177,6 +177,7 @@ class BlockCourse extends Block {
}
$tematic_advance_progress = 0;
$tematic_advance = $thematic->get_total_average_of_thematic_advances($course_code, 0);
if (!empty($tematic_advance)) {

@ -139,7 +139,7 @@ class BlockEvaluationGraph extends Block {
$courses_code = array_keys($this->courses);
foreach ($courses_code as $course_code) {
$cats = Category::load(null, null, $course_code, null, null, null, false);
if (isset($cats)) {
if (isset($cats) && isset($cats[0])) {
$alleval = $cats[0]->get_evaluations(null, true, $course_code);
$alllinks = $cats[0]->get_links(null, true);
$users = get_all_users($alleval, $alllinks);
@ -228,7 +228,7 @@ class BlockEvaluationGraph extends Block {
$courses_graph = array();
foreach ($courses_code as $course_code) {
$cats = Category::load(null, null, $course_code, null, null, $session_id);
if (isset($cats)) {
if (isset($cats) && isset($cats[0])) {
$alleval = $cats[0]->get_evaluations(null, true, $course_code);
$alllinks = $cats[0]->get_links(null, true);
$users = get_all_users($alleval, $alllinks);

Loading…
Cancel
Save