Minor - cleaning layout

skala
Julio Montoya 14 years ago
parent 047246c30d
commit f75fb86fc4
  1. 8
      main/admin/course_information.php
  2. 38
      main/admin/user_information.php

@ -80,7 +80,6 @@ if(api_get_setting('server_type') == 'test') {
<?php <?php
echo '<h4>'.get_lang('CourseUsage').'</h4>'; echo '<h4>'.get_lang('CourseUsage').'</h4>';
echo '<blockquote>';
$id_session = intval($_GET['id_session']); $id_session = intval($_GET['id_session']);
$table = new SortableTableFromArray(get_course_usage($course->code,$id_session),0,20,'usage_table'); $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(0,get_lang('Tool'), true);
$table->set_header(1,get_lang('NumberOfItems'), true); $table->set_header(1,get_lang('NumberOfItems'), true);
$table->display(); $table->display();
echo '</blockquote>';
/** /**
* Show all users subscribed in this course * Show all users subscribed in this course
*/ */
echo '<h4>'.get_lang('Users').'</h4>'; echo '<h4>'.get_lang('Users').'</h4>';
echo '<blockquote>';
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_user = Database :: get_main_table(TABLE_MAIN_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." "; $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(4,get_lang('Status'), true);
$table->set_header(5,'', false); $table->set_header(5,'', false);
$table->display(); $table->display();
} } else {
else
{
echo get_lang('NoUsersInCourse'); echo get_lang('NoUsersInCourse');
} }
echo '</blockquote>';
/*@todo This should be dissapear classes are a deprecated feature*/ /*@todo This should be dissapear classes are a deprecated feature*/
/** /**

@ -15,12 +15,13 @@ api_protect_admin_script();
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList')); $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
if ( ! isset($_GET['user_id'])) { if (!isset($_GET['user_id'])) {
api_not_allowed(); api_not_allowed();
} }
$user = api_get_user_info($_GET['user_id']); $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'].')'); $tool_name = api_get_person_name($user['firstName'], $user['lastName']).(empty($user['official_code'])?'':' ('.$user['official_code'].')');
Display::display_header($tool_name); Display::display_header($tool_name);
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
if ( isset($_GET['action']) ) { if ( isset($_GET['action']) ) {
@ -35,14 +36,15 @@ if ( isset($_GET['action']) ) {
break; 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) //only allow platform admins to login_as, or session admins only for students (not teachers nor other admins)
$statusname = api_get_status_langvars(); $statusname = api_get_status_langvars();
$login_as_icon = ''; $login_as_icon = '';
if (api_is_platform_admin() || (api_is_session_admin() && $row['6'] == $statusname[STUDENT])) { if (api_is_platform_admin() || (api_is_session_admin() && $row['6'] == $statusname[STUDENT])) {
$login_as_icon = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&amp;user_id='.$user['user_id'].'&amp;sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('login_as.gif', get_lang('LoginAs')).'</a>'; $login_as_icon = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&amp;user_id='.$user['user_id'].'&amp;sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('login_as.gif', get_lang('LoginAs')).'</a>';
} }
echo '<div class="actions"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.intval($_GET['user_id']).'" title="'.get_lang('Reporting').'">'.Display::return_icon('statistics.gif',get_lang('Reporting')).'</a>'.$login_as_icon.'</div>'; echo '<div class="actions"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.intval($_GET['user_id']).'" title="'.get_lang('Reporting').'">'.Display::return_icon('statistics.png',get_lang('Reporting'),'', 32).'</a>'.$login_as_icon.'</div>';
api_display_tool_title($tool_name);
//getting the user image //getting the user image
$sysdir_array = UserManager::get_user_picture_path_by_id($user['user_id'],'system',false,true); $sysdir_array = UserManager::get_user_picture_path_by_id($user['user_id'],'system',false,true);
@ -65,8 +67,7 @@ echo '<p>'.Display :: encrypted_mailto_link($user['mail'], $user['mail']).'</p>'
* Show the sessions and the courses in wich this user is subscribed * Show the sessions and the courses in wich this user is subscribed
*/ */
echo '<p><b>'.get_lang('SessionList').'</b></p>'; echo '<p><h3>'.get_lang('SessionList').'</h3></p>';
echo '<blockquote>';
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER); $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE); $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); $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(); $personal_course_list = array();
if (count($sessions)>0) { if (count($sessions)>0) {
$header[] = array (get_lang('Code'), true); $header[] = array (get_lang('Code'), true);
@ -135,9 +124,9 @@ if (count($sessions)>0) {
$row[] = $my_course['k']; $row[] = $my_course['k'];
$row[] = $my_course['i']; $row[] = $my_course['i'];
$row[] = $my_course['s'] == STUDENT ? get_lang('Student') : get_lang('Teacher'); $row[] = $my_course['s'] == STUDENT ? get_lang('Student') : get_lang('Teacher');
$tools = '<a href="course_information.php?code='.$my_course['k'].'&id_session='.$id_session.'">'.Display::return_icon('synthese_view.gif', get_lang('Overview')).'</a>'. $tools = '<a href="course_information.php?code='.$my_course['k'].'&id_session='.$id_session.'">'.Display::return_icon('synthese_view.gif', get_lang('Overview')).'</a>'.
'<a href="'.api_get_path(WEB_COURSE_PATH).$my_course['d'].'?id_session='.$id_session.'">'.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>' . '<a href="'.api_get_path(WEB_COURSE_PATH).$my_course['d'].'?id_session='.$id_session.'">'.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>';
'<a href="session_course_edit.php?id_session='.$id_session.'&course_code='.$my_course['k'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
if( $my_course->status == STUDENT ){ if( $my_course->status == STUDENT ){
$tools .= '<a href="user_information.php?action=unsubscribe&course_code='.$my_course['k'].'&user_id='.$user['user_id'].'">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>'; $tools .= '<a href="user_information.php?action=unsubscribe&course_code='.$my_course['k'].'&user_id='.$user['user_id'].'">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
@ -146,16 +135,14 @@ if (count($sessions)>0) {
$row[] = $tools; $row[] = $tools;
$data[] = $row; $data[] = $row;
} }
echo $enreg['name']; echo Display::tag('h4',$enreg['name']);
Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id'])));
echo '<br><br><br>';
} }
} else { } else {
echo '<p>'.get_lang('NoSessionsForThisUser').'</p>'; echo '<p>'.get_lang('NoSessionsForThisUser').'</p>';
} }
echo '</blockquote>';
/** /**
* Show the courses in which this user is subscribed * Show the courses in which this user is subscribed
@ -187,10 +174,8 @@ if (Database::num_rows($res) > 0) {
$data[] = $row; $data[] = $row;
} }
echo '<p><b>'.get_lang('Courses').'</b></p>'; echo '<p><h3>'.get_lang('Courses').'</b></h3>';
echo '<blockquote>';
Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id'])));
echo '</blockquote>';
} else { } else {
echo '<p>'.get_lang('NoCoursesForThisUser').'</p>'; echo '<p>'.get_lang('NoCoursesForThisUser').'</p>';
} }
@ -239,12 +224,11 @@ if ($_configuration['multiple_access_urls']) {
$data[] = $row; $data[] = $row;
} }
echo '<p><b>'.get_lang('URLList').'</b></p>'; echo '<p><b>'.get_lang('URLList').'</b></p>';
echo '<blockquote>';
Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id'])));
echo '</blockquote>';
} else { } else {
echo '<p>'.get_lang('NoUrlForThisUser').'</p>'; echo '<p>'.get_lang('NoUrlForThisUser').'</p>';
} }
} }
/* FOOTER */ /* FOOTER */
Display::display_footer(); Display::display_footer();
Loading…
Cancel
Save