Minor - format code, avoid querying with id = 0

pull/3023/head
Julio Montoya 6 years ago
parent 7342a11ff7
commit 7de2976292
  1. 7
      main/inc/introductionSection.inc.php
  2. 5
      main/inc/lib/thematic.lib.php

@ -184,14 +184,12 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$class1 = '';
if ($displayMode == '1') {
// Show only the current course progress step
// $information_title = get_lang('InfoAboutLastDoneAdvance');
$last_done_advance = $thematic->get_last_done_thematic_advance();
$thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
$subTitle1 = get_lang('CurrentTopic');
$class1 = ' current';
} elseif ($displayMode == '2') {
// Show only the two next course progress steps
// $information_title = get_lang('InfoAboutNextAdvanceNotDone');
$last_done_advance = $thematic->get_next_thematic_advance_not_done();
$next_advance_not_done = $thematic->get_next_thematic_advance_not_done(2);
$thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
@ -199,7 +197,6 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$subTitle1 = $subTitle2 = get_lang('NextTopic');
} elseif ($displayMode == '3') {
// Show the current and next course progress steps
// $information_title = get_lang('InfoAboutLastDoneAdvanceAndNextAdvanceNotDone');
$last_done_advance = $thematic->get_last_done_thematic_advance();
$next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
$thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
@ -213,9 +210,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$thematic_advance = get_lang('CourseThematicAdvance');
$thematicScore = $thematic->get_total_average_of_thematic_advances().'%';
$thematicUrl = api_get_path(WEB_CODE_PATH).'course_progress/index.php?action=thematic_details&'.api_get_cidreq();
$thematic_info = $thematic->get_thematic_list(
$thematic_advance_info['thematic_id']
);
$thematic_info = $thematic->get_thematic_list($thematic_advance_info['thematic_id']);
$thematic_advance_info['start_date'] = api_get_local_time(
$thematic_advance_info['start_date']

@ -716,8 +716,9 @@ class Thematic
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
$data = [];
$condition = '';
if (isset($thematic_advance_id)) {
$thematic_advance_id = intval($thematic_advance_id);
$thematic_advance_id = (int) $thematic_advance_id;
if (!empty($thematic_advance_id)) {
$condition = " AND a.id = $thematic_advance_id ";
}

Loading…
Cancel
Save