add username as tooltip for lastname in group tool - ref #4226

skala
Hubert Borderiou 13 years ago
parent 80397eeafc
commit 844665ad57
  1. 7
      main/group/group.php
  2. 3
      main/group/group_overview.php
  3. 29
      main/group/group_space.php

@ -272,13 +272,14 @@ foreach ($group_cats as $index => $category) {
if (count($tutorsids_of_group) > 0) { if (count($tutorsids_of_group) > 0) {
foreach ($tutorsids_of_group as $tutor_id) { foreach ($tutorsids_of_group as $tutor_id) {
$tutor = api_get_user_info($tutor_id); $tutor = api_get_user_info($tutor_id);
$username = api_htmlentities(sprintf(get_lang('LoginX'), $tutor['username']), ENT_QUOTES);
if (api_get_setting('show_email_addresses') == 'true') { if (api_get_setting('show_email_addresses') == 'true') {
$tutor_info .= Display::encrypted_mailto_link($tutor['mail'], api_get_person_name($tutor['firstName'], $tutor['lastName']).' ('.$tutor['username'].')').', '; $tutor_info .= Display::tag('span', Display::encrypted_mailto_link($tutor['mail'], api_get_person_name($tutor['firstName'], $tutor['lastName'])), array('title'=>$username)).', ';
} else { } else {
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
$tutor_info .= Display::encrypted_mailto_link($tutor['mail'], api_get_person_name($tutor['firstName'], $tutor['lastName']).' ('.$tutor['username'].')').', '; $tutor_info .= Display::tag('span', Display::encrypted_mailto_link($tutor['mail'], api_get_person_name($tutor['firstName'], $tutor['lastName'])), array('title'=>$username)).', ';
} else { } else {
$tutor_info .= api_get_person_name($tutor['firstName'], $tutor['lastName']).' ('.$tutor['username'].'), '; $tutor_info .= Display::tag('span', api_get_person_name($tutor['firstName'], $tutor['lastName']), array('title'=>$username)).', ';
} }
} }
} }

@ -107,7 +107,8 @@ foreach ($categories as $index => $category) {
if (!empty($users)) { if (!empty($users)) {
foreach ($users as $index => $user) { foreach ($users as $index => $user) {
$user_info = api_get_user_info($user); $user_info = api_get_user_info($user);
echo '<li>'.api_get_person_name($user_info['firstName'], $user_info['lastName']).' ('.$user_info['username'].')</li>'; $username = api_htmlentities(sprintf(get_lang('LoginX'), $user_info['username']), ENT_QUOTES);
echo '<li title="'.$username.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</li>';
} }
} else { } else {
//echo Display::tag('li', get_lang('NoStudents')); //echo Display::tag('li', get_lang('NoStudents'));

@ -244,12 +244,12 @@ if (count($tutors) == 0) {
isset($origin)?$my_origin = $origin:$my_origin=''; isset($origin)?$my_origin = $origin:$my_origin='';
foreach($tutors as $index => $tutor) { foreach($tutors as $index => $tutor) {
$tab_user_info = Database::get_user_info_from_id($tutor['user_id']); $tab_user_info = Database::get_user_info_from_id($tutor['user_id']);
$username = $tab_user_info['username']; $username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
$image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'], 'web', false, true); $image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'], 'web', false, true);
$image_repository = $image_path['dir']; $image_repository = $image_path['dir'];
$existing_image = $image_path['file']; $existing_image = $image_path['file'];
$photo= '<img src="'.$image_repository.$existing_image.'" align="absbottom" alt="'.api_get_person_name($tutor['firstname'], $tutor['lastname']).' ('.$username.')" width="32" height="32" title="'.api_get_person_name($tutor['firstname'], $tutor['lastname']).' ('.$username.')" />'; $photo= '<img src="'.$image_repository.$existing_image.'" align="absbottom" alt="'.api_get_person_name($tutor['firstname'], $tutor['lastname']).'" width="32" height="32" title="'.api_get_person_name($tutor['firstname'], $tutor['lastname']).'" />';
$tutor_info .= '<div style="margin-bottom: 5px;"><a href="../user/userInfo.php?origin='.$my_origin.'&amp;uInfo='.$tutor['user_id'].'">'.$photo.'&nbsp;'.api_get_person_name($tutor['firstname'], $tutor['lastname']).' ('.$username.')</a></div>'; $tutor_info .= '<div style="margin-bottom: 5px;"><a href="../user/userInfo.php?origin='.$my_origin.'&amp;uInfo='.$tutor['user_id'].'">'.$photo.'&nbsp;'.Display::tag('span', api_get_person_name($tutor['firstname'], $tutor['lastname']), array('title'=>$username)).'</a></div>';
} }
} }
@ -278,14 +278,14 @@ if (api_is_western_name_order()) {
$table->set_header(1, get_lang('LastName')); $table->set_header(1, get_lang('LastName'));
$table->set_header(2, get_lang('FirstName')); $table->set_header(2, get_lang('FirstName'));
} }
$table->set_header(3, get_lang('LoginName'));
if (api_get_setting('show_email_addresses') == 'true') { if (api_get_setting('show_email_addresses') == 'true') {
$table->set_header(4, get_lang('Email')); $table->set_header(3, get_lang('Email'));
$table->set_column_filter(4, 'email_filter'); $table->set_column_filter(3, 'email_filter');
} else { } else {
if (api_is_allowed_to_edit() == 'true') { if (api_is_allowed_to_edit() == 'true') {
$table->set_header(4, get_lang('Email')); $table->set_header(3, get_lang('Email'));
$table->set_column_filter(4, 'email_filter'); $table->set_column_filter(3, 'email_filter');
} }
} }
//the order of these calls is important //the order of these calls is important
@ -348,8 +348,7 @@ function get_group_user_data($from, $number_of_items, $column, $direction) {
"user.lastname AS col1, "user.lastname AS col1,
user.firstname AS col2," user.firstname AS col2,"
)." )."
user.username AS col3, user.email AS col3
user.email AS col4
FROM ".$table_user." user, ".$table_group_user." group_rel_user FROM ".$table_user." user, ".$table_group_user." group_rel_user
WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'"; AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
@ -366,8 +365,7 @@ function get_group_user_data($from, $number_of_items, $column, $direction) {
"user.lastname AS col1, "user.lastname AS col1,
user.firstname AS col2," user.firstname AS col2,"
)." )."
user.username AS col3, user.email AS col3
user.email AS col4
FROM ".$table_user." user, ".$table_group_user." group_rel_user FROM ".$table_user." user, ".$table_group_user." group_rel_user
WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'"; AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
@ -382,8 +380,7 @@ function get_group_user_data($from, $number_of_items, $column, $direction) {
: :
"user.lastname AS col1, "user.lastname AS col1,
user.firstname AS col2 " user.firstname AS col2 "
).", )."
user.username AS col3
FROM ".$table_user." user, ".$table_group_user." group_rel_user FROM ".$table_user." user, ".$table_group_user." group_rel_user
WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'"; AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
@ -439,7 +436,9 @@ function user_icon_filter($user_id) {
*/ */
function user_name_filter($name, $url_params, $row) { function user_name_filter($name, $url_params, $row) {
global $origin; global $origin;
return '<a href="../user/userInfo.php?uInfo='.$row[0].'&amp;'.$url_params.'">'.$name.'</a>'; $tab_user_info = Database::get_user_info_from_id($row[0]);
$username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
return '<a href="../user/userInfo.php?uInfo='.$row[0].'&amp;'.$url_params.'" title="'.$username.'">'.$name.'</a>';
} }
// Footer // Footer

Loading…
Cancel
Save