Added user' photo into user list interface and disabled field trainers(tutor name) in create course form from user portal - partial DT#5496

skala
Cristian Fasanando 16 years ago
parent c101b343f9
commit 4a742059ea
  1. 4
      documentation/changelog.html
  2. 53
      main/admin/user_list.php
  3. 5
      main/create_course/add_course.php
  4. 10
      main/user/userInfo.php
  5. 8
      whoisonline.php

@ -39,7 +39,9 @@
<li>Added Send a email to a portal administrator upon course creation (DT#3489)</li>
<li>Added Chat tool is now private when are in sessions or groups (DT#5558)</li>
<li>Wiki: Posibility to definition of wiki pages as tasks for students. Add feedback to student wiki pages, sincronized with their progress in the task. Posibility to establish a time limit for each wiki page. Posibility to establish a max number of words into each wiki page. Posibility to establish a max number versions for each page. Improve control of concurrent users. Improvements in the use of wiki pages such as portfolios of student (individual task)</li>
<li>Added when a user is enrolled only in one course, go directly to the course after the login (defined by the platform administrator through platform administration > configuration setting > training)- DT#3466</li>
<li>Added when a user is enrolled only in one course, go directly to the course after the login (defined by the platform administrator through platform administration > configuration setting > training)- DT#3466</li>
<li>Added user' photo into user list interface - DT#5496</li>
<li>Disabled field trainers(tutor name) in create course form from user portal, by default is current user's name, you can modify this field into setting course - DT#5496 </li>
</ul>
<h3>Debugging</h3>
<ul>

@ -323,6 +323,8 @@ function get_number_of_users()
*/
function get_user_data($from, $number_of_items, $column, $direction)
{
global $_configuration,$origin;
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
$sql = "SELECT
@ -341,8 +343,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
", u.expiration_date AS exp ".
" FROM $user_table u ";
// adding the filter to see the user's only of the current access_url
global $_configuration;
// adding the filter to see the user's only of the current access_url
if ((api_is_platform_admin() || api_is_session_admin()) && $_configuration['multiple_access_urls']==true && api_get_current_access_url_id()!=-1) {
$access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
@ -403,6 +404,15 @@ function get_user_data($from, $number_of_items, $column, $direction)
$users = array ();
$t = time();
while ($user = Database::fetch_row($res)) {
$image_path = UserManager::get_user_picture_path_by_id($user[0], 'web', false, true);
$user_profile = UserManager::get_picture_user($user[0], $image_path['file'], 22, 'small_', ' width="22" height="22" ');
if (!api_is_anonymous()) {
$photo = '<center><a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$user[0].'" title="'.get_lang('Info').'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user[2],$user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" /></a></center>';
} else {
$photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" /></center>';
}
if ($user[7] == 1 && $user[9] != '0000-00-00 00:00:00') {
// check expiration date
$expiration_time = convert_mysql_date($user[9]);
@ -412,7 +422,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
}
}
// forget about the expiration date field
$users[] = array($user[0],$user[1],$user[2],$user[3],$user[4],$user[5],$user[6],$user[7],$user[8]);
$users[] = array($user[0],$photo,$user[1],$user[2],$user[3],$user[4],$user[5],$user[6],$user[7],$user[8]);
}
return $users;
}
@ -746,26 +756,35 @@ else
$_admins_list[] = $row_admin[0];
}
$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
$user_profile = UserManager::get_picture_user($user_id, $image_path['file'], 22, 'small_', ' width="22" height="22" ');
if (!api_is_anonymous()) {
$photo = '<center><a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'" title="'.get_lang('Info').'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></a></center>';
} else {
$photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></center>';
}
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false);
$table->set_header(1, get_lang('OfficialCode'));
$table->set_header(1, get_lang('Photo'));
$table->set_header(2, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
$table->set_header(2, get_lang('FirstName'));
$table->set_header(3, get_lang('LastName'));
} else {
$table->set_header(2, get_lang('LastName'));
$table->set_header(3, get_lang('FirstName'));
$table->set_header(4, get_lang('LastName'));
} else {
$table->set_header(3, get_lang('LastName'));
$table->set_header(4, get_lang('FirstName'));
}
$table->set_header(4, get_lang('LoginName'));
$table->set_header(5, get_lang('Email'));
$table->set_header(6, get_lang('Status'));
$table->set_header(7, get_lang('Active'));
$table->set_header(8, get_lang('Action'), false,'width="170px"');
$table->set_column_filter(5, 'email_filter');
$table->set_column_filter(6, 'status_filter');
$table->set_column_filter(7, 'active_filter');
$table->set_column_filter(8, 'modify_filter');
$table->set_header(5, get_lang('LoginName'));
$table->set_header(6, get_lang('Email'));
$table->set_header(7, get_lang('Status'));
$table->set_header(8, get_lang('Active'));
$table->set_header(9, get_lang('Action'), false,'width="170px"');
$table->set_column_filter(6, 'email_filter');
$table->set_column_filter(7, 'status_filter');
$table->set_column_filter(8, 'active_filter');
$table->set_column_filter(9, 'modify_filter');
if (api_is_platform_admin())
$table->set_form_actions(array ('delete' => get_lang('DeleteFromPlatform')));
$table->display();

@ -77,8 +77,9 @@ $form->add_textfield('wanted_code', get_lang('Code'),false,array('size'=>'$maxle
$form->applyFilter('wanted_code', 'html_filter');
$form->addRule('wanted_code',get_lang('Max'),'maxlength',$maxlength);
$titular= &$form->add_textfield('tutor_name', get_lang('Professors'),true,array('size'=>'60'));
$form->applyFilter('tutor_name', 'html_filter');
$titular= &$form->add_textfield('tutor_name', get_lang('Professors'),null,array('size'=>'60','disabled'=>'disabled'));
$form->addElement('static',null,null,get_lang('ExplicationTrainers'));
//$form->applyFilter('tutor_name', 'html_filter');
$form->addElement('select_language', 'course_language', get_lang('Ln'));
$form->applyFilter('select_language', 'html_filter');

@ -410,13 +410,13 @@ elseif ($displayMode == "viewMainInfoEdit")
"<tr align=\"center\" bgcolor=\"#E6E6E6\">\n",
"<td align=\"left\">", get_lang('Name'), "</td>\n",
"<td width=\"100px\" align=\"left\">", get_lang('Description'), "</td>\n",
"<td>", get_lang('Tutor'), "</td>\n",
//"<td>", get_lang('Tutor'), "</td>\n",
"<td>", get_lang('CourseManager'), "</td>\n",
"</tr>\n",
"<tr align=\"center\">",
"<td align=\"left\"><b>", htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName'])), "</b></td>\n",
"<td align=\"left\"><input type=\"text\" name =\"role\" value=\"", $mainUserInfo['role'], "\" maxlength=\"40\" /></td>",
"<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteTutor\" value=\"1\" ", $tutorChecked, " /></td>";
"<td align=\"left\"><input type=\"text\" name =\"role\" value=\"", $mainUserInfo['role'], "\" maxlength=\"40\" /></td>";
//"<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteTutor\" value=\"1\" ", $tutorChecked, " /></td>";
if (!($is_courseAdmin && $_user['user_id'] == $userIdViewed))
{
@ -503,7 +503,7 @@ elseif ($displayMode == "viewContentList") // default display
"<tr align=\"center\" bgcolor=\"#E6E6E6\">\n",
"<td align=\"left\">",get_lang('Name'),"</td>\n",
"<td width=\"100px\" align=\"left\">",get_lang('Description'),"</td>\n",
"<td>",get_lang('Tutor'),"</td>\n",
//"<td>",get_lang('Tutor'),"</td>\n",
"<td>",get_lang('CourseManager'),"</td>\n",
($allowedToEditDef?"<td>".get_lang('Edit')."</td>\n":""),
($is_allowedToTrack?"<td>".get_lang('Tracking')."</td>\n":""),
@ -519,7 +519,7 @@ elseif ($displayMode == "viewContentList") // default display
// deprecated feature
if ($mainUserInfo['tutor_id'] == 1)
{
echo "<td>",get_lang('Tutor'),"</td>\n";
//echo "<td>",get_lang('Tutor'),"</td>\n";
}
else
{

@ -386,7 +386,13 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
$referer = empty($_GET['referer']) ? 'index.php' : api_htmlentities(strip_tags($_GET['referer']), ENT_QUOTES);
if (isset($_GET['id'])) {
echo '<a href="whoisonline.php" class="fake_button_back">'.get_lang('Back').'</a>';
if ($_GET['origin'] == 'user_list') {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php" class="fake_button_back">'.get_lang('Back').'</a>';
} else {
echo '<a href="whoisonline.php" class="fake_button_back">'.get_lang('Back').'</a>';
}
} else {
echo '<a href="'.$referer.'" class="fake_button_back">'.get_lang('BackHome').'</a>';
}

Loading…
Cancel
Save