diff --git a/main/admin/course_information.php b/main/admin/course_information.php index 12f7ca75f3..33d30e3dae 100644 --- a/main/admin/course_information.php +++ b/main/admin/course_information.php @@ -80,7 +80,6 @@ if(api_get_setting('server_type') == 'test') { '.get_lang('CourseUsage').''; -echo '
'; $id_session = intval($_GET['id_session']); $table = new SortableTableFromArray(get_course_usage($course->code,$id_session),0,20,'usage_table'); @@ -89,12 +88,10 @@ $table->set_other_tables(array('user_table','class_table')); $table->set_header(0,get_lang('Tool'), true); $table->set_header(1,get_lang('NumberOfItems'), true); $table->display(); -echo '
'; /** * Show all users subscribed in this course */ echo '

'.get_lang('Users').'

'; -echo '
'; $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_user = Database :: get_main_table(TABLE_MAIN_USER); $sql = "SELECT *,cu.status as course_status FROM $table_course_user cu, $table_user u WHERE cu.user_id = u.user_id AND cu.course_code = '".$code."' AND cu.relation_type <> ".COURSE_RELATION_TYPE_RRHH." "; @@ -139,12 +136,9 @@ if (Database::num_rows($res) > 0) $table->set_header(4,get_lang('Status'), true); $table->set_header(5,'', false); $table->display(); -} -else -{ +} else { echo get_lang('NoUsersInCourse'); } -echo '
'; /*@todo This should be dissapear classes are a deprecated feature*/ /** diff --git a/main/admin/user_information.php b/main/admin/user_information.php old mode 100755 new mode 100644 index 3a9b7703a9..35c2cf4747 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -15,12 +15,13 @@ api_protect_admin_script(); $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList')); -if ( ! isset($_GET['user_id'])) { +if (!isset($_GET['user_id'])) { api_not_allowed(); } $user = api_get_user_info($_GET['user_id']); $tool_name = api_get_person_name($user['firstName'], $user['lastName']).(empty($user['official_code'])?'':' ('.$user['official_code'].')'); Display::display_header($tool_name); + $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); if ( isset($_GET['action']) ) { @@ -35,14 +36,15 @@ if ( isset($_GET['action']) ) { break; } } -api_display_tool_title($tool_name); //only allow platform admins to login_as, or session admins only for students (not teachers nor other admins) $statusname = api_get_status_langvars(); $login_as_icon = ''; if (api_is_platform_admin() || (api_is_session_admin() && $row['6'] == $statusname[STUDENT])) { $login_as_icon = ''.Display::return_icon('login_as.gif', get_lang('LoginAs')).''; } -echo '
'.Display::return_icon('statistics.gif',get_lang('Reporting')).''.$login_as_icon.'
'; +echo '
'.Display::return_icon('statistics.png',get_lang('Reporting'),'', 32).''.$login_as_icon.'
'; + +api_display_tool_title($tool_name); //getting the user image $sysdir_array = UserManager::get_user_picture_path_by_id($user['user_id'],'system',false,true); @@ -65,8 +67,7 @@ echo '

'.Display :: encrypted_mailto_link($user['mail'], $user['mail']).'

' * Show the sessions and the courses in wich this user is subscribed */ -echo '

'.get_lang('SessionList').'

'; -echo '
'; +echo '

'.get_lang('SessionList').'

'; $main_user_table = Database :: get_main_table(TABLE_MAIN_USER); $main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE); @@ -87,18 +88,6 @@ $result = Database::query("SELECT DISTINCT id, name, date_start, date_end ". $sessions = Database::store_result($result); -/* -// Get the list of sessions where the user is subscribed as coach in a course -$sql = "SELECT DISTINCT id, name, date_start, date_end FROM $tbl_session as session ". - " INNER JOIN $tbl_session_course_user as session_rel_course_rel_user ". - " ON session_rel_course_rel_user.id_user = $user_id AND status = 2 ". - " AND (date_start <= NOW() AND date_end >= NOW() OR date_start='0000-00-00') ". - " ORDER BY date_start, date_end, name"; - -$result = Database::query($sql); -$session_is_coach = Database::store_result($result); -*/ - $personal_course_list = array(); if (count($sessions)>0) { $header[] = array (get_lang('Code'), true); @@ -135,9 +124,9 @@ if (count($sessions)>0) { $row[] = $my_course['k']; $row[] = $my_course['i']; $row[] = $my_course['s'] == STUDENT ? get_lang('Student') : get_lang('Teacher'); + $tools = ''.Display::return_icon('synthese_view.gif', get_lang('Overview')).''. - ''.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'' . - ''.Display::return_icon('edit.gif', get_lang('Edit')).''; + ''.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).''; if( $my_course->status == STUDENT ){ $tools .= ''.Display::return_icon('delete.gif', get_lang('Delete')).''; @@ -146,16 +135,14 @@ if (count($sessions)>0) { $row[] = $tools; $data[] = $row; } - echo $enreg['name']; - Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); - echo '


'; + echo Display::tag('h4',$enreg['name']); + Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); } } else { echo '

'.get_lang('NoSessionsForThisUser').'

'; } -echo '
'; /** * Show the courses in which this user is subscribed @@ -187,10 +174,8 @@ if (Database::num_rows($res) > 0) { $data[] = $row; } - echo '

'.get_lang('Courses').'

'; - echo '
'; - Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); - echo '
'; + echo '

'.get_lang('Courses').'

'; + Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); } else { echo '

'.get_lang('NoCoursesForThisUser').'

'; } @@ -238,13 +223,12 @@ if ($_configuration['multiple_access_urls']) { $row[] = $url['url']; $data[] = $row; } - echo '

'.get_lang('URLList').'

'; - echo '
'; - Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); - echo '
'; + echo '

'.get_lang('URLList').'

'; + Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); } else { echo '

'.get_lang('NoUrlForThisUser').'

'; } } + /* FOOTER */ Display::display_footer(); \ No newline at end of file