Get course name only in calendar and activity name in popup

Get course name only in calendar and activity name in popup

by Amir Mustafa -
Number of replies: 1
Hello Developers,

In the calendar it shows different event keys:

In my case in course event I am getting the course name + activity event names:

Eg: In my case in Feb 8 I have:

Demo course (course name) + course lesson opens (event name) + course lesson closes (event name)

On clicking the course name a pop up opens where there is a link to the

course name (حقوق الانسان)

I need to show this course name in the calendar rather than this  course lesson opens. I am not able to find the code which contains the view part of the calendar.

Please guide me I am stuck in this for 3 days. sad

Attachment 1.png
Attachment 2.png
Average of ratings: -
In reply to Amir Mustafa

Re: Get course name only in calendar and activity name in popup

by Amir Mustafa -

I have found the SQL query from where I am getting the data but not able to find the place which brings the view part of the calendar.

path - moodle/calendar/classes/local/event/strategies/raw_event_retrieval_strategy.php

// Build the main query.   (approx line 260)

$sql = "SELECT e.*, c.fullname AS coursefullname
FROM {event} e
INNER JOIN ($subquery) fe
ON e.modulename = fe.modulename
AND e.instance = fe.instance
AND e.eventtype = fe.eventtype
AND (e.priority = fe.priority OR (e.priority IS NULL AND fe.priority IS NULL))
LEFT JOIN {modules} m
ON e.modulename = m.name
LEFT JOIN {course} c
ON c.id = e.courseid
WHERE (m.visible = 1 OR m.visible IS NULL) AND $whereclause
ORDER BY " . ($ordersql ? $ordersql : "e.timestart");

I am not able to get the code to put conditions in the calendar moodle.
I have added this line in the query :
LEFT JOIN {course} c ON c.id = e.courseid - and fetching course fullname - c.fullname



Attachment 3.png