Skip to content
Snippets Groups Projects
Commit ff3da1b2 authored by Thomas Fradet's avatar Thomas Fradet
Browse files

bugs divers

parent 21663f52
No related branches found
No related tags found
No related merge requests found
...@@ -177,6 +177,61 @@ Commenté : sert à rien et la property n'existe pas. Pas présent dans le code ...@@ -177,6 +177,61 @@ Commenté : sert à rien et la property n'existe pas. Pas présent dans le code
[x] Solved. [x] Solved.
## 7
Notice: Undefined property: stdClass::$sectionposition in /Applications/MAMP/htdocs/moodle37/course/format/iena/renderer.php on line 836
Property sectionposition non définie dans une condition qui de plus requiert isset d'une variable non instanciée (code commenté). Dans le test d'une condition pour echo justement cette variable non instanciée (=== NULL).
La condition et l'echo qu'elle contient sont commentés.
[x] Solved.
## 8
Notice: Undefined variable: completion_total in /Applications/MAMP/htdocs/moodle37/course/format/iena/view/view_course_header.php on line 13
Instantiation d'une propriété de la classe view_course_header d'après une variable n'existant pas en paramètre du constructeur. Cette propriété n'est plus utilisée (code commenté).
La création de la propriété devenue inutile est commentée.
[x] Solved.
## 9
Notice: Undefined variable: USER in /Applications/MAMP/htdocs/moodle37/course/format/iena/view/view_course_header.php on line 370
Ajout de la global $USER dans la méthode.
[x] Solved.
## 10
Notice: Undefined variable: view in /Applications/MAMP/htdocs/moodle37/course/format/iena/renderer.php on line 413
Instanciation de la variable $view = "";
[x] Solved.
## 11
Notice: Trying to get property 'presence' of non-object in /Applications/MAMP/htdocs/moodle37/course/format/iena/renderer.php on line 511
ET
Idem pour date_rendu juste en dessous.
Ajout d'une condition que la variable contenant l'objet ne soit pas === false dans le cas où aucun paramètre n'a été réglé pour la section (date, modalité, notifications). Sinon ce n'est pas un objet, mais false.
[x] Solved.
## 12
Notice: Undefined variable: date in /Applications/MAMP/htdocs/moodle37/course/format/iena/renderer.php on line 622
Après le correctif #11, une variable instanciée uniquement dans la condition où $param_section n'est pas false ne l'est plus quand il n'y a aucun paramétrage existant pour la section.
Ajout d'un else à la condition pour que $date soit toujours instancié.
[x] Solved.
...@@ -405,6 +405,8 @@ ...@@ -405,6 +405,8 @@
// nouvelle génération du header // nouvelle génération du header
$view = "";
require_once($CFG->dirroot . '/course/format/iena/entity/course_format_iena_completion.php'); require_once($CFG->dirroot . '/course/format/iena/entity/course_format_iena_completion.php');
$cpl = course_format_iena_completion::get_completion_by_section($nameSection, $idSection); $cpl = course_format_iena_completion::get_completion_by_section($nameSection, $idSection);
...@@ -506,20 +508,25 @@ foreach ($htmlsection as $section) { ...@@ -506,20 +508,25 @@ foreach ($htmlsection as $section) {
continue; continue;
} }
$param_section = $section_entity->get_section_settings_by_id_section($idSection[$i]); $param_section = $section_entity->get_section_settings_by_id_section($idSection[$i]);
if ($param_section->presence && $i != 0) { // dates, modality and notification section parameters : false if not set.
if ($param_section->presence == 1) { if ($param_section !== false) {
$presence = "En présence"; if ($param_section->presence && $i != 0) {
} else if ($param_section->presence == 2) { if ($param_section->presence == 1) {
$presence = "A distance"; $presence = "En présence";
} else if ($param_section->presence == 2) {
$presence = "A distance";
}
} }
}
if ($param_section->date_rendu) { if ($param_section->date_rendu) {
$dateUp = date_create($param_section->date_rendu); $dateUp = date_create($param_section->date_rendu);
$date = $dateUp->format("j/m H:i"); $date = $dateUp->format("j/m H:i");
$date_jour = $dateUp->format("j/m"); $date_jour = $dateUp->format("j/m");
$date_heure = $dateUp->format("H:i"); $date_heure = $dateUp->format("H:i");
$dateUp = $dateUp->getTimestamp(); $dateUp = $dateUp->getTimestamp();
} else {
$date = "";
}
} else { } else {
$date = ""; $date = "";
} }
...@@ -831,11 +838,11 @@ public function print_iena_section_pages($course) ...@@ -831,11 +838,11 @@ public function print_iena_section_pages($course)
echo $this->start_section_list(); echo $this->start_section_list();
} }
if ($course->sectionposition == 0 and isset($htmlsection0)) { // if ($course->sectionposition == 0 and isset($htmlsection0)) {
if ($PAGE->user_is_editing()){ // if ($PAGE->user_is_editing()){
echo html_writer::tag('span', $htmlsection0, ['class' => 'above']); // echo html_writer::tag('span', $htmlsection0, ['class' => 'above']);
} // }
} // }
//echo $this->get_button_section($course, $sectionvisible); //echo $this->get_button_section($course, $sectionvisible);
//here all activities are displayed //here all activities are displayed
//If we are in etition mode then we display the "BASE" page Otherwise our model //If we are in etition mode then we display the "BASE" page Otherwise our model
......
...@@ -10,7 +10,7 @@ class view_course_header { ...@@ -10,7 +10,7 @@ class view_course_header {
$this->section_names = $section_names; $this->section_names = $section_names;
$this->idSection = $idSection; $this->idSection = $idSection;
$this->completion_total = $completion_total; // $this->completion_total = $completion_total;
$this->course = $course; $this->course = $course;
$this->create_view($progress); $this->create_view($progress);
} }
...@@ -338,7 +338,7 @@ class view_course_header { ...@@ -338,7 +338,7 @@ class view_course_header {
private function set_html($infos) { private function set_html($infos) {
global $CFG, $COURSE; global $CFG, $COURSE, $USER;
// $css = file_get_contents( $CFG->wwwroot.'/course/format/iena/course-header.css' ); // $css = file_get_contents( $CFG->wwwroot.'/course/format/iena/course-header.css' );
// $this->_content .= '<style>'.$css.'</style>'; // $this->_content .= '<style>'.$css.'</style>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment