diff --git a/admin/settings/courses.php b/admin/settings/courses.php index 90424358432..b373da098ee 100644 --- a/admin/settings/courses.php +++ b/admin/settings/courses.php @@ -17,7 +17,7 @@ if ($hassiteconfig $temp = new admin_settingpage('courserequest', get_string('courserequest')); $temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0)); $temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1)); - $temp->add(new admin_setting_configtext('courserequestnotify', get_string('courserequestnotify', 'admin'), get_string('configcourserequestnotify', 'admin'), '')); + $temp->add(new admin_setting_users_with_capability('courserequestnotify', get_string('courserequestnotify', 'admin'), get_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse')); $ADMIN->add('courses', $temp); // Pending course requests. diff --git a/course/request.php b/course/request.php index 192b64eb32e..22c45194419 100644 --- a/course/request.php +++ b/course/request.php @@ -68,7 +68,8 @@ /// Notify the admin if required. if ($CFG->courserequestnotify) { - if ($user = get_record('user', 'username', $CFG->courserequestnotify, 'mnethostid', $CFG->mnet_localhost_id)) { + $users = get_users_from_config($CFG->courserequestnotify, 'moodle/site:approvecourse'); + foreach ($users as $user) { $subject = get_string('courserequest'); $a = new object(); $a->link = "$CFG->wwwroot/course/pending.php"; diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index abe8ff03b42..5e81a75050a 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -81,6 +81,7 @@ $string['configcookiesecure'] = 'If server is accepting only https connections i $string['configcountry'] = 'If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.'; $string['configcoursemanager'] = 'This setting allows you to control who appears on the course description. Users need to have at least one of these roles in a course to be shown on the course description for that course.'; $string['configcourserequestnotify'] = 'Type username of user to be notified when new course requested.'; +$string['configcourserequestnotify2'] = 'Users who will be notified when a course is requested. Only users who can approve course requests are listed here.'; $string['configcoursesperpage'] = 'Enter the number of courses to be display per page in a course listing.'; $string['configcreatornewroleid'] = 'This role is automatically assigned to creators in new courses they created. This role is not assigned if creator already has needed capabilities in parent context.'; $string['configdbsessions'] = 'If enabled, this setting will use the database to store information about current sessions. This is especially useful for large/busy sites or sites built on cluster of servers. For most sites this should probably be left disabled so that the server disk is used instead. Note that changing this setting now will log out all current users (including you). If you are using MySQL please make sure that \'max_allowed_packet\' in my.cnf (or my.ini) is at least 4M.'; @@ -367,6 +368,7 @@ $string['environmentxmlerror'] = 'Error reading environment data ($a->error_code $string['errors'] = 'Errors'; $string['errorsetting'] = 'Could not save setting:'; $string['errorwithsettings'] = 'Some settings were not changed due to an error.'; +$string['everyonewhocan'] = 'Everyone who can \'$a\''; $string['experimental'] = 'Experimental'; $string['extendedusernamechars'] = 'Allow extended characters in usernames'; $string['filecreated'] = 'New file created'; diff --git a/lib/adminlib.php b/lib/adminlib.php index 1db208f5a14..7106ab72638 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -2417,8 +2417,9 @@ class admin_setting_configmultiselect extends admin_setting_configselect { } $defaults = array(); + $size = min(10, count($this->choices)); $return = '