Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ecb8829
)
MDL-28253 use unique name for new manager role
author
Petr Skoda
<commits@skodak.org>
Thu, 14 Jul 2011 11:36:27 +0000
(13:36 +0200)
committer
Petr Skoda
<commits@skodak.org>
Thu, 14 Jul 2011 11:38:36 +0000
(13:38 +0200)
lib/db/upgrade.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/db/upgrade.php
b/lib/db/upgrade.php
index
f823295
..
2b0bf72
100644
(file)
--- a/
lib/db/upgrade.php
+++ b/
lib/db/upgrade.php
@@
-2858,16
+2858,16
@@
WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
unset($role->capability);
if ($role->archetype === 'admin') {
$i = '';
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;
$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;
$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');
}
}
$role->description = get_string('managerdescription', 'role');
}
}