diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3ab101b7c6..5ad235a3bf 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-04-25 Miguel de Dios + + * godmode/users/user_list.php: changed the table layout and other + stetical things. + + Fixes: #3611684 + + * include/functions_html.php: cleaned the source code style. + 2013-04-25 Miguel de Dios * godmode/alerts/alert_list.list.php, diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 98770659b7..0601537720 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -93,12 +93,12 @@ switch ($sortField) { break; } - + $buttons[$tab]['active'] = true; // Header if (defined('METACONSOLE')) { - + user_meta_print_header(); $sec = 'advanced'; @@ -116,7 +116,7 @@ else { html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'')); $buttons[$tab]['active'] = true; - + ui_print_page_header (__('User management').' » '.__('Users defined in Pandora'), "images/gm_users.png", false, "", true, $buttons); $sec = 'gusuarios'; @@ -136,7 +136,7 @@ if (isset ($_GET["user_del"])) { //delete user if ($result) { users_save_logout($user_row, true); - + db_pandora_audit("User management", __("Deleted user %s", io_safe_input($id_user))); } @@ -147,7 +147,7 @@ if (isset ($_GET["user_del"])) { //delete user // Delete the user in all the consoles if (defined ('METACONSOLE') && isset ($_GET["delete_all"])) { - + $servers = metaconsole_get_servers(); foreach ($servers as $server) { @@ -163,7 +163,7 @@ if (isset ($_GET["user_del"])) { //delete user // Restore the db connection metaconsole_restore_db(); - + // Log to the metaconsole too if ($result) { db_pandora_audit("User management", @@ -216,6 +216,7 @@ $table->head = array (); $table->data = array (); $table->align = array (); $table->size = array (); +$table->valign = array(); $table->head[0] = __('User ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectUserIDUp)) . '' . @@ -226,15 +227,23 @@ $table->head[1] = __('Name') . ' ' . $table->head[2] = __('Last contact') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectLastConnectUp )) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectLastConnectDown)) . ''; -$table->head[3] = __('Profile'); -$table->head[4] = __('Description'); -$table->head[5] = '' . __('Op.') . ''; +$table->head[3] = __('Admin'); +$table->head[4] = __('Profile'); +$table->head[5] = __('Description'); +$table->head[6] = '' . __('Op.') . ''; -$table->align[2] = "center"; +$table->align[2] = "right"; $table->align[3] = "center"; -$table->align[5] = "left"; $table->size[2] = '150px'; -$table->size[5] = '85px'; +$table->size[6] = '85px'; + +$table->valign[0] = 'top'; +$table->valign[1] = 'top'; +$table->valign[2] = 'top'; +$table->valign[3] = 'top'; +$table->valign[4] = 'top'; +$table->valign[5] = 'top'; +$table->valign[6] = 'top'; $info1 = array (); @@ -259,7 +268,7 @@ else { unset($g); } } - + // Prepare pagination ui_pagination (count($info)); @@ -294,12 +303,13 @@ foreach ($info as $user_id => $user_info) { $iterator++; $data[0] = ''.$user_id.''; - $data[1] = $user_info["fullname"] . ''; - $data[1] .= __('First name') . ': ' . $user_info["firstname"].'
'; - $data[1] .= __('Last name') . ': ' . $user_info["lastname"].'
'; - $data[1] .= __('Phone') . ': ' . $user_info["phone"].'
'; - $data[1] .= __('E-mail') . ': ' . $user_info["email"].'
'; - $data[1] .= '
'; + $data[1] = ''; $data[2] = ui_print_timestamp ($user_info["last_connect"], true); if ($user_info["is_admin"]) { @@ -308,43 +318,51 @@ foreach ($info as $user_id => $user_info) { "title" => __('Administrator'))) . ' '; } else { + /* $data[3] = html_print_image ("images/user_green.png", true, array ("alt" => __('User'), "title" => __('Standard User'))) . ' '; + */ + $data[3] = ""; } - $data[3] .= ''; + $data[4] = ""; $result = db_get_all_rows_field_filter ("tusuario_perfil", "id_usuario", $user_id); if ($result !== false) { + $data[4] .= ""; foreach ($result as $row) { - $data[3] .= profile_get_name ($row["id_perfil"]); - $data[3] .= " / "; - $data[3] .= groups_get_name ($row["id_grupo"]); - $data[3] .= "
"; + $data[4] .= ""; + $data[4] .= ""; + $data[4] .= ""; + $data[4] .= ""; } + $data[4] .= "
"; + $data[4] .= profile_get_name ($row["id_perfil"]); + $data[4] .= ""; + $data[4] .= groups_get_name ($row["id_grupo"], true); + $data[4] .= "
"; } else { - $data[3] .= __('The user doesn\'t have any assigned profile/group'); + $data[4] .= __('The user doesn\'t have any assigned profile/group'); } - $data[3] .= "
"; - $data[4] = ui_print_string_substr ($user_info["comments"], 24, true); + $data[5] = ui_print_string_substr ($user_info["comments"], 24, true); if ($user_info['disabled'] == 0) { - $data[5] = ''.html_print_image('images/lightbulb.png', true, array('title' => __('Disable'))).''; + $data[6] = ''.html_print_image('images/lightbulb.png', true, array('title' => __('Disable'))).''; } else { - $data[5] = ''.html_print_image('images/lightbulb_off.png', true, array('title' => __('Enable'))).''; + $data[6] = ''.html_print_image('images/lightbulb_off.png', true, array('title' => __('Enable'))).''; } - $data[5] .= ''.html_print_image('images/config.png', true, array('title' => __('Edit'))).''; + $data[6] .= ''.html_print_image('images/config.png', true, array('title' => __('Edit'))).''; if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) { - $data[5] .= "".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false")).""; + $data[6] .= "".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false")).""; if (defined('METACONSOLE')) { - $data[5] .= "".html_print_image('images/cross_double.png', true, array ('title' => __('Delete from all consoles'), 'onclick' => "if (! confirm ('" .__('Deleting User %s from all consoles', $user_info['id_user']) . ". " . __('Are you sure?') ."')) return false")).""; + $data[6] .= "".html_print_image('images/cross_double.png', true, array ('title' => __('Delete from all consoles'), 'onclick' => "if (! confirm ('" .__('Deleting User %s from all consoles', $user_info['id_user']) . ". " . __('Are you sure?') ."')) return false")).""; } } else { - $data[5] .= ''; //Delete button not in this mode + $data[6] .= ''; //Delete button not in this mode } array_push ($table->data, $data); } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 003e20c63d..d7144fbb06 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1262,7 +1262,7 @@ function html_print_table (&$table, $return = false) { } } } - + $styleTable = ''; if (isset ($table->styleTable)) { $styleTable = $table->styleTable;