mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
moodle/course:managemetacourse is now singular
This commit is contained in:
parent
096a664c01
commit
b79da3ac68
@ -65,7 +65,7 @@ class block_admin extends block_list {
|
||||
|
||||
/// Manage metacourses
|
||||
if ($course->metacourse) {
|
||||
if (has_capability('moodle/course:managemetacourses', $context)) {
|
||||
if (has_capability('moodle/course:managemetacourse', $context)) {
|
||||
$strchildcourses = get_string('childcourses');
|
||||
$this->content->items[]='<a href="importstudents.php?id='.$this->instance->pageid.'">'.$strchildcourses.'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" alt="" />';
|
||||
|
@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
} else {
|
||||
$managers = count(get_users_by_capability($context, 'moodle/course:managemetacourses'));
|
||||
$managers = count(get_users_by_capability($context, 'moodle/course:managemetacourse'));
|
||||
$participants = count(get_users_by_capability($context, 'moodle/course:view'));
|
||||
if ($participants > $managers) {
|
||||
$disable_meta = get_string('metaalreadyhasenrolments');
|
||||
@ -147,7 +147,7 @@
|
||||
add_to_log(SITEID, "course", "new", "view.php?id=$newcourseid", "$form->fullname (ID $newcourseid)") ;
|
||||
$context = get_context_instance(CONTEXT_COURSE, $newcourseid);
|
||||
|
||||
if ($form->metacourse and has_capability('moodle/course:managemetacourses', $context)) { // Redirect users with metacourse capability to student import
|
||||
if ($form->metacourse and has_capability('moodle/course:managemetacourse', $context)) { // Redirect users with metacourse capability to student import
|
||||
redirect($CFG->wwwroot."/course/importstudents.php?id=$newcourseid");
|
||||
|
||||
} else if (has_capability('moodle/role:assign', $context)) { // Redirect users with assign capability to assign users to different roles
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
require_login($course->id);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('moodle/course:managemetacourses', $context);
|
||||
require_capability('moodle/course:managemetacourse', $context);
|
||||
|
||||
if (!$course->metacourse) {
|
||||
redirect("$CFG->wwwroot/course/view.php?id=$course->id");
|
||||
|
@ -614,7 +614,7 @@ $moodle_capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/course:managemetacourses' => array(
|
||||
'moodle/course:managemetacourse' => array(
|
||||
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
|
@ -1855,7 +1855,7 @@ function sync_metacourse($course) {
|
||||
}
|
||||
|
||||
// always keep metacourse managers
|
||||
if ($users = get_users_by_capability($context, 'moodle/course:managemetacourses')) {
|
||||
if ($users = get_users_by_capability($context, 'moodle/course:managemetacourse')) {
|
||||
$managers = array_keys($users);
|
||||
} else {
|
||||
$managers = array();
|
||||
|
@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2006091807; // YYYYMMDD = date
|
||||
$version = 2006091900; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.7 dev'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user