From d7275b1cb9af92fb2c248da3c9decc5101074692 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 17 Sep 2013 16:14:47 +0200 Subject: [PATCH] Minor - adding edit button --- main/admin/user_information.php | 55 ++++++++++----------------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/main/admin/user_information.php b/main/admin/user_information.php index 946e51bcc8..6295734d4d 100644 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -25,9 +25,9 @@ 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']) ) { - switch($_GET['action']) { + switch ($_GET['action']) { case 'unsubscribe': - if ( CourseManager::get_user_in_course_status($_GET['user_id'],$_GET['course_code']) == STUDENT) { + if (CourseManager::get_user_in_course_status($_GET['user_id'],$_GET['course_code']) == STUDENT) { CourseManager::unsubscribe_user($_GET['user_id'],$_GET['course_code']); Display::display_normal_message(get_lang('UserUnsubscribed')); } else { @@ -36,22 +36,29 @@ if ( isset($_GET['action']) ) { break; } } -//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(); -$login_as_icon = ''; +$login_as_icon = null; +$editUser = null; 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')).''; + $login_as_icon = ''.Display::return_icon('login_as.gif', get_lang('LoginAs')).''; + $editUser = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array()), api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user['user_id']); } -echo '
'.Display::return_icon('statistics.png',get_lang('Reporting'),'', ICON_SIZE_MEDIUM).''.$login_as_icon.'
'; +echo '
+ '.Display::return_icon('statistics.png',get_lang('Reporting'),'', ICON_SIZE_MEDIUM).' + + '.$login_as_icon.' + '.$editUser.' +
'; echo Display::page_header($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 = $sysdir_array['dir']; $webdir_array = UserManager::get_user_picture_path_by_id($user['user_id'],'web',false,true); $webdir = $webdir_array['dir']; -$fullurl=$webdir.$webdir_array['file']; +$fullurl = $webdir.$webdir_array['file']; $system_image_path=$sysdir.$webdir_array['file']; list($width, $height, $type, $attr) = @getimagesize($system_image_path); $resizing = (($height > 200) ? 'height="200"' : ''); @@ -64,7 +71,7 @@ echo '

'. ($user['status'] == 1 ? get_lang('Teacher') : get_lang('Student')).' echo '

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

'; /** - * Show the sessions and the courses in wich this user is subscribed + * Show the sessions and the courses in which this user is subscribed */ echo Display::page_subheader(get_lang('SessionList')); @@ -152,35 +159,6 @@ if (Database::num_rows($res) > 0) { } else { echo '

'.get_lang('NoCoursesForThisUser').'

'; } - -/** - * Show the classes in which this user is subscribed - */ -/* -$table_class_user = Database :: get_main_table(TABLE_MAIN_CLASS_USER); -$table_class = Database :: get_main_table(TABLE_MAIN_CLASS); -$sql = 'SELECT * FROM '.$table_class_user.' cu, '.$table_class.' c '. - ' WHERE cu.user_id = '.$user['user_id'].' AND cu.class_id = c.id'; -$res = Database::query($sql); -if (Database::num_rows($res) > 0) { - $header = array(); - $header[] = array (get_lang('ClassName'), true); - $header[] = array ('', false); - $data = array (); - while ($class = Database::fetch_object($res)) { - $row = array(); - $row[] = $class->name; - $row[] = ''.Display::return_icon('synthese_view.gif', get_lang('Overview')).''; - $data[] = $row; - } - echo '

'.get_lang('Classes').'

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

'.get_lang('NoClassesForThisUser').'

'; -}*/ - /** * Show the URL in which this user is subscribed */ @@ -203,5 +181,4 @@ if ($_configuration['multiple_access_urls']) { } } -/* FOOTER */ Display::display_footer();