Skip to content

Commit 3865c2f

Browse files
authored
Merge pull request #2 from learnweb/improve/sqlquery
Improve/sqlquery
2 parents 7ae852a + 318ccce commit 3865c2f

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

.github/workflows/moodle-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
5151
- name: Initialise moodle-plugin-ci
5252
run: |
53-
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
53+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci 4.5.4
5454
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
5555
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
5656
sudo locale-gen en_AU.UTF-8
@@ -179,7 +179,7 @@ jobs:
179179
180180
- name: Initialise moodle-plugin-ci
181181
run: |
182-
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
182+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci 4.5.4
183183
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
184184
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
185185
sudo locale-gen en_AU.UTF-8

classes/zoom.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
use local_townsquaresupport\townsquaresupportinterface;
2929

3030
global $CFG;
31-
require_once($CFG->dirroot . '/blocks/townsquare/locallib.php');
31+
require_once($CFG->dirroot . '/blocks/townsquare/lib.php');
3232

3333
/**
3434
* 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 {
5555
$zoomevents = self::get_events_from_db();
5656

5757
// Filter out events that the user should not see.
58-
// TODO: are the more filters needed and why?
5958
foreach ($zoomevents as $key => $event) {
6059
if (townsquare_filter_availability($event) ||
6160
($event->eventtype == "expectcompletionon" && townsquare_filter_activitycompletions($event))) {
@@ -73,7 +72,6 @@ public static function get_events(): array {
7372
* @return array
7473
*/
7574
private static function get_events_from_db(): array {
76-
// TODO: are the more or less parameters or conditions to implement?
7775
global $DB;
7876

7977
// Prepare the parameter for sql query.
@@ -85,16 +83,17 @@ private static function get_events_from_db(): array {
8583
+ $inparamscourses;
8684

8785
// 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
9089
FROM {event} e
9190
JOIN {modules} m ON e.modulename = m.name
9291
JOIN {course_modules} cm ON (cm.course = e.courseid AND cm.module = m.id AND cm.instance = e.instance)
9392
JOIN {zoom} z ON z.id = e.instance
9493
WHERE (e.timestart >= :timestart OR e.timestart+e.timeduration > :timeduration)
9594
AND e.timestart <= :timeend
9695
AND e.courseid $insqlcourses
97-
AND e.modulename = 'ratingallocate'
96+
AND e.modulename = 'zoom'
9897
AND m.visible = 1
9998
AND (e.name NOT LIKE '" .'0'. "' AND e.eventtype NOT LIKE '" .'0'. "' )
10099
AND (e.instance <> 0 AND e.visible = 1)

lang/en/townsquareexpansion_zoom.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2424
*/
2525
$string['pluginname'] = 'Townsquare subplugin for mod_zoom';
26-
$string['pluginname'] = 'Zoom support for townsquare block';
26+
$string['pluginname_help'] = 'This subplugin allows the townsquare block to show events from zoom.';
2727
$string['pluginnameadding'] = "Adding a zoom support subplugin";
2828
$string['pluginnameediting'] = "Editing a zoom support subplugin";
2929
$string['pluginnamesummary'] = "This subplugin allows the townsquare block to show events from zoom.";
30-
$string['pluginname_help'] = 'This subplugin allows the townsquare block to show events from zoom.';
30+
$string['plugintitle'] = 'Zoom support for townsquare block';

version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
/**
1818
* Plugin version and other meta-data are defined here.
1919
*
20-
* @package townsquareexpansion_moodleoverflow
20+
* @package townsquareexpansion_zoom
2121
* @copyright 2024 Tamaro Walter
2222
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

2525
defined('MOODLE_INTERNAL') || die();
2626
$plugin->component = 'townsquareexpansion_zoom';
27-
$plugin->dependencies = ['local_townsquaresupport' => ANY_VERSION];
27+
$plugin->dependencies = ['local_townsquaresupport' => ANY_VERSION, 'mod_zoom' => ANY_VERSION];
2828
$plugin->release = '0.1.0';
2929
$plugin->version = 2024051400;
3030
$plugin->requires = 2022041900;

0 commit comments

Comments
 (0)