From 78098f19be92dbe293b74d54686b3b0de59ce221 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 18 Nov 2014 17:06:42 +0100 Subject: [PATCH] Fixing course id. --- main/inc/lib/thematic.lib.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/main/inc/lib/thematic.lib.php b/main/inc/lib/thematic.lib.php index 25476ae841..c5762d8203 100755 --- a/main/inc/lib/thematic.lib.php +++ b/main/inc/lib/thematic.lib.php @@ -904,6 +904,7 @@ class Thematic $thematic_id = intval($thematic_id); $description_type = intval($description_type); $user_id = api_get_user_id(); + $course_info = api_get_course_info(); $course_id = $course_info['real_id']; // get thematic plan id @@ -939,13 +940,14 @@ class Thematic // protect data $thematic_id = intval($thematic_id); - $description_type = intval($description_type); - $next_description_type = 0; - $course_id = api_get_course_int_id(); - $sql = "SELECT MAX(description_type) as max FROM $tbl_thematic_plan - WHERE c_id = $course_id AND thematic_id = $thematic_id AND description_type >= ".ADD_THEMATIC_PLAN." "; + $sql = "SELECT MAX(description_type) as max + FROM $tbl_thematic_plan + WHERE + c_id = $course_id AND + thematic_id = $thematic_id AND + description_type >= ".ADD_THEMATIC_PLAN." "; $rs = Database::query($sql); $row = Database::fetch_array($rs); $last_description_type = $row['max']; @@ -1294,7 +1296,8 @@ class Thematic * Get questions by default for help * @return array */ - public function get_default_question() { + public function get_default_question() + { $question = array(); $question[1]= get_lang('ObjectivesQuestions'); $question[2]= get_lang('SkillToAcquireQuestions'); @@ -1309,7 +1312,8 @@ class Thematic * @param array array containing data e.g: $array('Y'=>'2010', 'F' => '02', 'd' => '10', 'H' => '12', 'i' => '30') * @return string date and time e.g: '2010-02-10 12:30:00' */ - public function build_datetime_from_array($array) { + public function build_datetime_from_array($array) + { return return_datetime_from_array($array); } }