mirror of
https://github.com/moodle/moodle.git
synced 2025-05-31 13:09:25 +02:00
Merge branch 'w28_MDL-28253_m22_managerupgrade' of git://github.com/skodak/moodle
This commit is contained in:
commit
b96fa1c265
@ -2858,16 +2858,16 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
|
||||
unset($role->capability);
|
||||
if ($role->archetype === 'admin') {
|
||||
$i = '';
|
||||
if ($DB->record_exists('role', array('shortname'=>'manager'))) {
|
||||
if ($DB->record_exists('role', array('shortname'=>'manager')) or $DB->record_exists('role', array('name'=>get_string('manager', 'role')))) {
|
||||
$i = 2;
|
||||
while($DB->record_exists('role', array('shortname'=>'manager'.$i))) {
|
||||
while($DB->record_exists('role', array('shortname'=>'manager'.$i)) or $DB->record_exists('role', array('name'=>get_string('manager', 'role').$i))) {
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$role->archetype = 'manager';
|
||||
if ($role->shortname === 'admin') {
|
||||
$role->shortname = 'manager'.$i;
|
||||
$role->name = get_string('manager', 'role');
|
||||
$role->name = get_string('manager', 'role').$i;
|
||||
$role->description = get_string('managerdescription', 'role');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user