Skip to content

Commit 164fc9c

Browse files
authored
Merge pull request #3401 from carlangas159/chamilo-lms-3008
Course Progress: Incorrect time in Thematic Advance - see #3008
2 parents 973edaa + a8f8788 commit 164fc9c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
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+
$(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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,20 @@
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+
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+
213219
$thematic_info = $thematic->get_thematic_list($thematic_advance_info['thematic_id']);
220+
$thematic_info['title'] = isset($thematic_info['title']) ? $thematic_info['title'] : '';
214221

222+
/*
215223
$thematic_advance_info['start_date'] = api_get_local_time(
216224
$thematic_advance_info['start_date']
217225
);
226+
*/
218227
$thematic_advance_info['start_date'] = api_format_date(
219228
$thematic_advance_info['start_date'],
220229
DATE_TIME_FORMAT_LONG

0 commit comments

Comments
 (0)