Skip to content

Commit

Permalink
Thematic advance: Show correct time into Temporalization of the didac…
Browse files Browse the repository at this point in the history
…tic unit - refs #3008
  • Loading branch information
carlangas159 committed Aug 11, 2020
1 parent 16f291e commit 84b59b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main/course_progress/thematic_controller.php
Expand Up @@ -366,7 +366,7 @@ function ($plan) {
$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);
Expand Down
7 changes: 6 additions & 1 deletion main/inc/lib/thematic.lib.php
Expand Up @@ -702,13 +702,15 @@ public function get_thematic_plan_array($data)
* @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);
Expand Down Expand Up @@ -746,6 +748,9 @@ public function get_thematic_advance_list(
// 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) {
Expand Down

0 comments on commit 84b59b9

Please sign in to comment.