Thematic advance: Show correct time into Temporalization of the didactic unit - refs #3008

pull/3442/head
carlos alvarado 5 years ago
parent 16f291e42b
commit 84b59b97c5
  1. 2
      main/course_progress/thematic_controller.php
  2. 7
      main/inc/lib/thematic.lib.php

@ -366,7 +366,7 @@ class ThematicController
$thematic_plan_data = $thematic->get_thematic_plan_data();
// Third column
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true, true);
$data['thematic_plan_div'] = $thematic->get_thematic_plan_array($thematic_plan_data);
$data['thematic_advance_div'] = $thematic->get_thematic_advance_div($thematic_advance_data);

@ -702,13 +702,15 @@ class Thematic
* @param int $thematic_advance_id Thematic advance id (optional), get data by thematic advance list
* @param string $course_code Course code (optional)
* @param bool $force_session_id Force to have a session id
* @param bool $withLocalTime Force start_date to local time
*
* @return array $data
*/
public function get_thematic_advance_list(
$thematic_advance_id = null,
$course_code = null,
$force_session_id = false
$force_session_id = false,
$withLocalTime = false
) {
$course_info = api_get_course_info($course_code);
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
@ -746,6 +748,9 @@ class Thematic
// group all data group by thematic id
$tmp = [];
while ($row = Database::fetch_array($res, 'ASSOC')) {
if($withLocalTime == true) {
$row['start_date'] = api_get_local_time($row['start_date']);
}
$tmp[] = $row['thematic_id'];
if (in_array($row['thematic_id'], $tmp)) {
if ($force_session_id) {

Loading…
Cancel
Save