mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-26935 course: Require course:renameroles to rename roles.
This commit is contained in:
parent
fd57d685c7
commit
502336f215
@ -288,16 +288,19 @@ class course_edit_form extends moodleform {
|
||||
$options[0] = get_string('none');
|
||||
$mform->addElement('select', 'defaultgroupingid', get_string('defaultgrouping', 'group'), $options);
|
||||
|
||||
// Customizable role names in this course.
|
||||
$mform->addElement('header','rolerenaming', get_string('rolerenaming'));
|
||||
$mform->addHelpButton('rolerenaming', 'rolerenaming');
|
||||
if ((empty($course->id) && guess_if_creator_will_have_course_capability('moodle/course:renameroles', $categorycontext))
|
||||
|| (!empty($course->id) && has_capability('moodle/course:renameroles', $coursecontext))) {
|
||||
// Customizable role names in this course.
|
||||
$mform->addElement('header', 'rolerenaming', get_string('rolerenaming'));
|
||||
$mform->addHelpButton('rolerenaming', 'rolerenaming');
|
||||
|
||||
if ($roles = get_all_roles()) {
|
||||
$roles = role_fix_names($roles, null, ROLENAME_ORIGINAL);
|
||||
$assignableroles = get_roles_for_contextlevels(CONTEXT_COURSE);
|
||||
foreach ($roles as $role) {
|
||||
$mform->addElement('text', 'role_'.$role->id, get_string('yourwordforx', '', $role->localname));
|
||||
$mform->setType('role_'.$role->id, PARAM_TEXT);
|
||||
if ($roles = get_all_roles()) {
|
||||
$roles = role_fix_names($roles, null, ROLENAME_ORIGINAL);
|
||||
$assignableroles = get_roles_for_contextlevels(CONTEXT_COURSE);
|
||||
foreach ($roles as $role) {
|
||||
$mform->addElement('text', 'role_' . $role->id, get_string('yourwordforx', '', $role->localname));
|
||||
$mform->setType('role_' . $role->id, PARAM_TEXT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,6 +141,7 @@ $string['course:managescales'] = 'Manage scales';
|
||||
$string['course:markcomplete'] = 'Mark users as complete in course completion';
|
||||
$string['course:movesections'] = 'Move sections';
|
||||
$string['course:publish'] = 'Publish a course into hub';
|
||||
$string['course:renameroles'] = 'Rename roles';
|
||||
$string['course:request'] = 'Request new courses';
|
||||
$string['course:reset'] = 'Reset course';
|
||||
$string['course:reviewotherusers'] = 'Review other users';
|
||||
|
@ -982,6 +982,16 @@ $capabilities = array(
|
||||
'clonepermissionsfrom' => 'moodle/course:update'
|
||||
),
|
||||
|
||||
'moodle/course:renameroles' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'archetypes' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
'clonepermissionsfrom' => 'moodle/course:update'
|
||||
),
|
||||
|
||||
'moodle/course:changeidnumber' => array(
|
||||
|
||||
'riskbitmask' => RISK_XSS,
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2015092400.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2015092400.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user