Merge branch 'w12_MDL-38180_m25_enrolpics' of git://github.com/skodak/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-03-19 17:58:55 +01:00
commit 66f1870701
2 changed files with 16 additions and 2 deletions

View File

@ -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) {

View File

@ -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) {