Fix calendar UI

1.10.x
Julio Montoya 10 years ago
parent 22eed0ae2d
commit bab3eb1389
  1. 10
      main/inc/lib/agenda.lib.php
  2. 14
      main/template/default/agenda/month.tpl

@ -1005,15 +1005,16 @@ class Agenda
if (!empty($my_course_list) && $sessionFilterActive == false) {
foreach ($my_course_list as $course_info_item) {
$courseInfo = api_get_course_info_by_id($course_item['real_id']);
if (isset($course_id) && !empty($course_id)) {
if ($course_info_item['real_id'] == $course_id) {
$this->getCourseEvents($start, $end, $course_info_item);
$this->getCourseEvents($start, $end, $courseInfo);
}
} else {
$this->getCourseEvents(
$start,
$end,
$course_info_item
$courseInfo
);
}
}
@ -1493,8 +1494,6 @@ class Agenda
$event['allDay'] = 'false';
$event['course_id'] = $course_id;
$event['course_name'] = isset($courseInfo['name']) ? $courseInfo['name'] : '';
$event['session_name'] = isset($sessionInfo['name']) ? $sessionInfo['name'] : '';
$event['borderColor'] = $event['backgroundColor'] = $this->event_course_color;
$sessionInfo = [];
@ -1503,6 +1502,9 @@ class Agenda
$event['borderColor'] = $event['backgroundColor'] = $this->event_session_color;
}
$event['session_name'] = isset($sessionInfo['name']) ? $sessionInfo['name'] : '';
$event['course_name'] = isset($courseInfo['name']) ? $courseInfo['name'] : '';
if (isset($row['to_group_id']) && !empty($row['to_group_id'])) {
$event['borderColor'] = $event['backgroundColor'] = $this->event_group_color;
}

@ -435,19 +435,7 @@ $(document).ready(function() {
$('#simple_start_date').html(calEvent.start.format("YY-MM-DD"));
$('#simple_end_date').html(' ' + calEvent.end.format("YY-MM-DD"));
}
console.log(calEvent);
var courseInfoText = '';
$.ajax({
url: '{{ _p.web_ajax }}' + 'course.ajax.php?a=get_course_info&id=' + calEvent.course_id,
dataType: 'json',
async: false,
success: function (data) {
courseInfoText = data.title;
}
});
console.log(calEvent.course_name);
if (calEvent.course_name) {
$("#calendar_course_info").html('<h4>{{ 'Course' | get_lang }}</h4>' + calEvent.course_name);
} else {

Loading…
Cancel
Save