1
0
mirror of https://github.com/moodle/moodle.git synced 2025-05-11 10:45:38 +02:00

MDL-38180 do not add links for enrol and other users candidates

This commit is contained in:
Petr Škoda 2013-03-17 22:21:27 +01:00
parent 7112729206
commit d2f3c5c58d
2 changed files with 16 additions and 2 deletions
enrol

@ -96,9 +96,16 @@ switch ($action) {
$page = optional_param('page', 0, PARAM_INT);
$outcome->response = $manager->search_other_users($search, $searchanywhere, $page);
$extrafields = get_extra_user_fields($context);
$useroptions = array();
// User is not enrolled, either link to site profile or do not link at all.
if (has_capability('moodle/user:viewdetails', context_system::instance())) {
$useroptions['courseid'] = SITEID;
} else {
$useroptions['link'] = false;
}
foreach ($outcome->response['users'] as &$user) {
$user->userId = $user->id;
$user->picture = $OUTPUT->user_picture($user);
$user->picture = $OUTPUT->user_picture($user, $useroptions);
$user->fullname = fullname($user);
$fieldvalues = array();
foreach ($extrafields as $field) {

@ -71,8 +71,15 @@ switch ($action) {
$perpage = optional_param('perpage', 25, PARAM_INT); // This value is hard-coded to 25 in quickenrolment.js
$outcome->response = $manager->get_potential_users($enrolid, $search, $searchanywhere, $page, $perpage, $addedenrollment);
$extrafields = get_extra_user_fields($context);
$useroptions = array();
// User is not enrolled yet, either link to site profile or do not link at all.
if (has_capability('moodle/user:viewdetails', context_system::instance())) {
$useroptions['courseid'] = SITEID;
} else {
$useroptions['link'] = false;
}
foreach ($outcome->response['users'] as &$user) {
$user->picture = $OUTPUT->user_picture($user);
$user->picture = $OUTPUT->user_picture($user, $useroptions);
$user->fullname = fullname($user);
$fieldvalues = array();
foreach ($extrafields as $field) {