From 8dc7b67b0243254c8500d39e45a7fcb74c54f982 Mon Sep 17 00:00:00 2001 From: Julian Prud'homme Date: Fri, 15 Jun 2007 15:37:31 +0200 Subject: [PATCH] [svn r12612] invert the lastname and the firstname (task http://projects.dokeos.com/?do=details&id=1598) --- main/admin/course_add.php | 4 ++-- main/admin/course_edit.php | 8 ++++---- main/admin/user_list.php | 10 +++++----- main/user/user.php | 32 +++----------------------------- 4 files changed, 14 insertions(+), 40 deletions(-) diff --git a/main/admin/course_add.php b/main/admin/course_add.php index 23e7887cef..1f571b5695 100644 --- a/main/admin/course_add.php +++ b/main/admin/course_add.php @@ -1,5 +1,5 @@ user_id] = $obj->firstname.' '.$obj->lastname; + $teachers[$obj->user_id] = $obj->lastname.' '.$obj->firstname; } // Build the form $form = new FormValidator('update_course'); diff --git a/main/admin/course_edit.php b/main/admin/course_edit.php index 671d1ee1e3..3be10ef385 100644 --- a/main/admin/course_edit.php +++ b/main/admin/course_edit.php @@ -1,6 +1,6 @@ user_id] = $obj->firstname.' '.$obj->lastname; + $course_teachers[$obj->user_id] = $obj->lastname.' '.$obj->firstname; } // Get all possible teachers without the course teachers @@ -106,7 +106,7 @@ $teachers = array(); while($obj = mysql_fetch_object($res)) { if(!array_key_exists($obj->user_id,$course_teachers)){ - $teachers[$obj->user_id] = $obj->firstname.' '.$obj->lastname; + $teachers[$obj->user_id] = $obj->lastname.' '.$obj->firstname; } @@ -114,7 +114,7 @@ while($obj = mysql_fetch_object($res)) $course['tutor_name']=$obj->user_id; } //We add in the array platform teachers - $platform_teachers[$obj->user_id] = $obj->firstname.' '.$obj->lastname; + $platform_teachers[$obj->user_id] = $obj->lastname.' '.$obj->firstname; } //Case where there is no teacher in the course diff --git a/main/admin/user_list.php b/main/admin/user_list.php index 5d1f8e58ae..7b77f88aed 100644 --- a/main/admin/user_list.php +++ b/main/admin/user_list.php @@ -1,6 +1,6 @@ set_additional_parameters($parameters); $table->set_header(0, '', false); $table->set_header(1, get_lang('OfficialCode')); - $table->set_header(2, get_lang('FirstName')); - $table->set_header(3, get_lang('LastName')); + $table->set_header(2, get_lang('LastName')); + $table->set_header(3, get_lang('FirstName')); $table->set_header(4, get_lang('LoginName')); $table->set_header(5, get_lang('Email')); $table->set_header(6, get_lang('Status')); diff --git a/main/user/user.php b/main/user/user.php index 65d4850f9a..ed8a7404fb 100644 --- a/main/user/user.php +++ b/main/user/user.php @@ -351,32 +351,6 @@ Display::display_introduction_section(TOOL_USER, $is_allowed); */ function get_number_of_users() { - /*$user_table = Database::get_main_table(TABLE_MAIN_USER); - $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER); - if(api_get_setting('use_session_mode')!="true"){ - $sql = "SELECT COUNT(u.user_id) AS number_of_users FROM $user_table u,$course_user_table cu WHERE u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'"; - } - else{ - - if(!empty($_SESSION['id_session'])){ - $session_course_user_table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); - $sql = "SELECT COUNT(DISTINCT id_user) AS number_of_users - FROM $user_table u, $session_course_user_table - WHERE course_code= '".$_SESSION['_course']['id']."' - AND id_session='".$_SESSION['id_session']."'"; - } - else{ - $sql = "SELECT COUNT(u.user_id) AS number_of_users FROM $user_table u,$course_user_table cu WHERE u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'"; - } - } - if( isset ($_GET['keyword'])) - { - $keyword = mysql_real_escape_string($_GET['keyword']); - $sql .= " AND (firstname LIKE '%".$keyword."%' OR lastname LIKE '%".$keyword."%' OR username LIKE '%".$keyword."%' OR official_code LIKE '%".$keyword."%')"; - } - $res = api_sql_query($sql, __FILE__, __LINE__); - $result = mysql_fetch_object($res); - return $result->number_of_users;*/ $counter=0; if(!empty($_SESSION["id_session"])){ @@ -441,8 +415,8 @@ function get_user_data($from, $number_of_items, $column, $direction) $temp=array(); $temp[] = $user_id; $temp[] = $o_course_user['official_code']; - $temp[] = $o_course_user['firstname']; $temp[] = $o_course_user['lastname']; + $temp[] = $o_course_user['firstname']; $temp[] = $o_course_user['role']; $temp[] = implode(', ',$groups_name); //Group @@ -460,8 +434,8 @@ function get_user_data($from, $number_of_items, $column, $direction) else{ $temp=array(); $temp[] = $o_course_user['official_code']; - $temp[] = $o_course_user['firstname']; $temp[] = $o_course_user['lastname']; + $temp[] = $o_course_user['firstname']; $temp[] = $o_course_user['role']; $temp[] = implode(', ',$groups_name);//Group $temp[] = $user_id; @@ -518,8 +492,8 @@ $header_nr = 0; $table->set_header($header_nr++, '', false); } $table->set_header($header_nr++, get_lang('OfficialCode')); -$table->set_header($header_nr++, get_lang('FirstName')); $table->set_header($header_nr++, get_lang('LastName')); +$table->set_header($header_nr++, get_lang('FirstName')); $table->set_header($header_nr++, get_lang('Description')); $table->set_header($header_nr++, get_lang('Group'),false); if( api_is_allowed_to_edit())