Get course name only in calendar and activity name in popup

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

by Amir Mustafa -
Number of replies: 0

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