Merge branch 'MDL-32125-master' of git://github.com/StudiUM/moodle

This commit is contained in:
Sam Hemelryk 2013-03-04 10:37:51 +13:00
commit f0abd36e46
2 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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;