mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-32125-master' of git://github.com/StudiUM/moodle
This commit is contained in:
commit
f0abd36e46
@ -212,6 +212,14 @@ function forum_update_instance($forum, $mform) {
|
||||
|
||||
$DB->update_record('forum', $forum);
|
||||
|
||||
$modcontext = context_module::instance($forum->coursemodule);
|
||||
if (($forum->forcesubscribe == FORUM_INITIALSUBSCRIBE) && ($oldforum->forcesubscribe <> $forum->forcesubscribe)) {
|
||||
$users = forum_get_potential_subscribers($modcontext, 0, 'u.id, u.email', '');
|
||||
foreach ($users as $user) {
|
||||
forum_subscribe($user->id, $forum->id);
|
||||
}
|
||||
}
|
||||
|
||||
forum_grade_item_update($forum);
|
||||
|
||||
return true;
|
||||
|
@ -111,6 +111,12 @@ if (!is_null($mode) and has_capability('mod/forum:managesubscriptions', $context
|
||||
redirect($returnto, get_string("everyoneisnowsubscribed", "forum"), 1);
|
||||
break;
|
||||
case FORUM_INITIALSUBSCRIBE : // 2
|
||||
if ($forum->forcesubscribe <> FORUM_INITIALSUBSCRIBE) {
|
||||
$users = forum_get_potential_subscribers($context, 0, 'u.id, u.email', '');
|
||||
foreach ($users as $user) {
|
||||
forum_subscribe($user->id, $forum->id);
|
||||
}
|
||||
}
|
||||
forum_forcesubscribe($forum->id, FORUM_INITIALSUBSCRIBE);
|
||||
redirect($returnto, get_string("everyoneisnowsubscribed", "forum"), 1);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user