28
28
use local_townsquaresupport \townsquaresupportinterface ;
29
29
30
30
global $ CFG ;
31
- require_once ($ CFG ->dirroot . '/blocks/townsquare/locallib .php ' );
31
+ require_once ($ CFG ->dirroot . '/blocks/townsquare/lib .php ' );
32
32
33
33
/**
34
34
* Class that implements the townsquaresupportinterface with the function to get the events from the plugin.
@@ -55,7 +55,6 @@ public static function get_events(): array {
55
55
$ zoomevents = self ::get_events_from_db ();
56
56
57
57
// Filter out events that the user should not see.
58
- // TODO: are the more filters needed and why?
59
58
foreach ($ zoomevents as $ key => $ event ) {
60
59
if (townsquare_filter_availability ($ event ) ||
61
60
($ event ->eventtype == "expectcompletionon " && townsquare_filter_activitycompletions ($ event ))) {
@@ -73,7 +72,6 @@ public static function get_events(): array {
73
72
* @return array
74
73
*/
75
74
private static function get_events_from_db (): array {
76
- // TODO: are the more or less parameters or conditions to implement?
77
75
global $ DB ;
78
76
79
77
// Prepare the parameter for sql query.
@@ -85,16 +83,17 @@ private static function get_events_from_db(): array {
85
83
+ $ inparamscourses ;
86
84
87
85
// Set the sql statement.
88
- $ sql = "SELECT e.id, e.name, z.name AS instancename , e.courseid, cm.id AS coursemoduleid, cm.availability AS availability, e.groupid, e.userid,
89
- e.modulename, e.instance, e.eventtype, e.timestart, e.timemodified, e.visible
86
+ $ sql = "SELECT e.id, e.name AS content, z.name AS instancename , e.courseid, cm.id AS coursemoduleid,
87
+ cm.availability AS availability, e.groupid, e.userid, e.modulename, e.instance, e.eventtype, e.timestart,
88
+ e.timemodified, e.visible
90
89
FROM {event} e
91
90
JOIN {modules} m ON e.modulename = m.name
92
91
JOIN {course_modules} cm ON (cm.course = e.courseid AND cm.module = m.id AND cm.instance = e.instance)
93
92
JOIN {zoom} z ON z.id = e.instance
94
93
WHERE (e.timestart >= :timestart OR e.timestart+e.timeduration > :timeduration)
95
94
AND e.timestart <= :timeend
96
95
AND e.courseid $ insqlcourses
97
- AND e.modulename = 'ratingallocate '
96
+ AND e.modulename = 'zoom '
98
97
AND m.visible = 1
99
98
AND (e.name NOT LIKE ' " .'0 ' . "' AND e.eventtype NOT LIKE ' " .'0 ' . "' )
100
99
AND (e.instance <> 0 AND e.visible = 1)
0 commit comments