Skip to content

Commit

Permalink
show any activity belongs to course #158
Browse files Browse the repository at this point in the history
  • Loading branch information
isuru89 committed Jan 12, 2024
1 parent 186682e commit 5cf2ceb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

define('REMINDERS_DAYIN_SECONDS', 24 * 3600);

define('REMINDERS_FIRST_CRON_CYCLE_CUTOFF_DAYS', 1);
define('REMINDERS_FIRST_CRON_CYCLE_CUTOFF_DAYS', 7);

define('REMINDERS_7DAYSBEFORE_INSECONDS', 7 * 24 * 3600);
define('REMINDERS_3DAYSBEFORE_INSECONDS', 3 * 24 * 3600);
Expand Down
9 changes: 6 additions & 3 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@
function get_upcoming_events_for_course($courseid, $currtime) {
global $DB, $CFG;

$statuses = ['due', 'close', 'course', 'expectcompletionon', 'gradingdue', 'meeting_start', 'zoom'];
// we default exclude these kind of event types
$excludedstatuses = ['site', 'user', 'open'];

// When activity openings separation is enabled in global settings, we will retrieve those events too.
if (isset($CFG->local_reminders_separateactivityopenings) && $CFG->local_reminders_separateactivityopenings) {
array_push($statuses, 'open');
$excludedstatuses = array_filter($excludedstatuses, function ($it) {
return $it != 'open';
});
}
list($insql, $inparams) = $DB->get_in_or_equal($statuses);
list($insql, $inparams) = $DB->get_in_or_equal($excludedstatuses, SQL_PARAMS_QM, 'param', false);

return $DB->get_records_sql("SELECT *
FROM {event}
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023110400;
$plugin->version = 2024011200;
$plugin->requires = 2018051700; // Require moodle 3.5 or higher.
$plugin->release = '2.7.1';
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit 5cf2ceb

Please sign in to comment.