Skip to content

Commit dc9aa48

Browse files
committed
Incorrect time in Thematic Advance #3008
index.php Prevent progress empty (show 0 %) introductionSection.inc.php Prevent notice of undefined index of: $thematic_advance_info -> thematic_id / start_date / content / duration $thematic_info -> title Double date setting increases the time at the scheduled course time.
1 parent c35cb23 commit dc9aa48

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

main/course_progress/index.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@
114114
</script>';
115115

116116
$htmlHeadXtra[] = '<script>
117+
$(document).ready(function () {
118+
if ($("#div_result").html() !== undefined && $("#div_result").html().length == 0) {
119+
$("#div_result").html("0");
120+
}
121+
})
117122
function datetime_by_attendance(attendance_id, thematic_advance_id) {
118123
$.ajax({
119124
contentType: "application/x-www-form-urlencoded",
@@ -248,13 +253,13 @@ function check_per_custom_date(obj) {
248253
$(function () {
249254
$('.btn-delete').on('click', function (e) {
250255
e.preventDefault();
251-
256+
252257
var id = $(this).data('id') || 0;
253-
258+
254259
if (!id) {
255260
return;
256261
}
257-
262+
258263
//$('[name=\"title[' + id + ']\"]').val('');
259264
CKEDITOR.instances['description[' + id + ']'].setData('');
260265
});

main/inc/introductionSection.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,19 @@
210210
$thematic_advance = get_lang('CourseThematicAdvance');
211211
$thematicScore = $thematic->get_total_average_of_thematic_advances().'%';
212212
$thematicUrl = api_get_path(WEB_CODE_PATH).'course_progress/index.php?action=thematic_details&'.api_get_cidreq();
213-
$thematic_info = $thematic->get_thematic_list($thematic_advance_info['thematic_id']);
214213

214+
$thematic_advance_info['thematic_id'] = isset($thematic_advance_info['thematic_id'])?$thematic_advance_info['thematic_id']:0;
215+
$thematic_advance_info['start_date'] = isset( $thematic_advance_info['start_date'])? $thematic_advance_info['start_date'] : null;
216+
$thematic_advance_info['content'] = isset($thematic_advance_info['content'])?$thematic_advance_info['content']:'';
217+
$thematic_advance_info['duration'] = isset($thematic_advance_info['duration'])?$thematic_advance_info['duration']:0;
218+
219+
$thematic_info = $thematic->get_thematic_list($thematic_advance_info['thematic_id']);
220+
$thematic_info['title'] = isset($thematic_info['title'])?$thematic_info['title']:'';
221+
/*
215222
$thematic_advance_info['start_date'] = api_get_local_time(
216223
$thematic_advance_info['start_date']
217224
);
225+
*/
218226
$thematic_advance_info['start_date'] = api_format_date(
219227
$thematic_advance_info['start_date'],
220228
DATE_TIME_FORMAT_LONG

0 commit comments

Comments
 (0)