diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 5de8e0a0c86..e3ffc92aef1 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -20,12 +20,12 @@ Feature: Edit capabilities And I set the following system permissions of "Teacher" role: | capability | permission | | block/mnet_hosts:myaddinstance | Allow | - | moodle/community:add | Inherit | + | moodle/site:messageanyuser | Inherit | | moodle/grade:managesharedforms | Prevent | | moodle/course:request | Prohibit | When I follow "Edit Teacher role" Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission - And "moodle/community:add" capability has "Not set" permission + And "moodle/site:messageanyuser" capability has "Not set" permission And "moodle/grade:managesharedforms" capability has "Prevent" permission And "moodle/course:request" capability has "Prohibit" permission diff --git a/blocks/community/block_community.php b/blocks/community/block_community.php index fc345caa521..ab9db50d6b5 100644 --- a/blocks/community/block_community.php +++ b/blocks/community/block_community.php @@ -48,54 +48,11 @@ class block_community extends block_list { } function get_content() { - global $CFG, $OUTPUT, $USER; - - $coursecontext = context::instance_by_id($this->instance->parentcontextid); - - if (!has_capability('moodle/community:add', $coursecontext) - or $this->content !== NULL) { - return $this->content; - } - $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; - - if (!isloggedin()) { - return $this->content; - } - - $icon = $OUTPUT->pix_icon('i/group', get_string('group')); - $addcourseurl = new moodle_url('/blocks/community/communitycourse.php', - array('add' => true, 'courseid' => $this->page->course->id)); - $searchlink = html_writer::tag('a', $icon . get_string('addcourse', 'block_community'), - array('href' => $addcourseurl->out(false))); - $this->content->items[] = $searchlink; - - require_once($CFG->dirroot . '/blocks/community/locallib.php'); - $communitymanager = new block_community_manager(); - $courses = $communitymanager->block_community_get_courses($USER->id); - if ($courses) { - $this->content->items[] = html_writer::empty_tag('hr'); - $this->content->icons[] = ''; - $this->content->items[] = get_string('mycommunities', 'block_community'); - $this->content->icons[] = ''; - foreach ($courses as $course) { - //delete link - $deleteicon = $OUTPUT->pix_icon('t/delete', get_string('removecommunitycourse', 'block_community')); - $deleteurl = new moodle_url('/blocks/community/communitycourse.php', - array('remove' => true, - 'courseid' => $this->page->course->id, - 'communityid' => $course->id, 'sesskey' => sesskey())); - $deleteatag = html_writer::tag('a', $deleteicon, array('href' => $deleteurl)); - - $courselink = html_writer::tag('a', $course->coursename, - array('href' => $course->courseurl)); - $this->content->items[] = $courselink . ' ' . $deleteatag; - $this->content->icons[] = ''; - } - } + $this->content->items[] = get_string('functionalityremoved', 'error'); return $this->content; } diff --git a/lang/en/error.php b/lang/en/error.php index e8cee31f43c..08075ac58a6 100644 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -262,6 +262,7 @@ $string['filternotactive'] = 'Filter {$a} is not currently active'; $string['filternotenabled'] = 'Filter not enabled!'; $string['filternotinstalled'] = 'Filter {$a} is not currently installed'; $string['forumblockingtoomanyposts'] = 'You have exceeded the posting threshold set for this forum'; +$string['functionalityremoved'] = 'You are trying to access functionality that has been removed.'; $string['generalexceptionmessage'] = 'Exception - {$a}'; $string['gradepubdisable'] = 'Grade publishing disabled'; $string['gradesneedregrading'] = 'The course grades need to be recalculated'; diff --git a/version.php b/version.php index 37f6323f48a..25a31b5efc2 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2018120305.10; // 20181203 = branching date YYYYMMDD - do not modify! +$version = 2018120305.11; // 20181203 = branching date YYYYMMDD - do not modify! // RR = release increments - 00 in DEV branches. // .XX = incremental changes.