2010-06-08 Raul Mateos <raulofpandora@gmail.com>

* operation/incidents/incident_detail.php,
	operation/incidents/incident.php: cleaned code, improved button usability.
	TODO: Use links instead buttons where adding notes.
	* operation/incidents/events.php: Cleaned code.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2010-06-08 18:34:34 +00:00
parent 8f2259ea41
commit b2bde2c85f
4 changed files with 27 additions and 25 deletions

View File

@ -1,3 +1,11 @@
2010-06-08 Raúl Mateos <raulofpandora@gmail.com>
* operation/incidents/incident_detail.php,
operation/incidents/incident.php: cleaned code, improved button usability.
TODO: Use links instead buttons where adding notes.
* operation/incidents/events.php: Cleaned code.
2010-06-08 Ramon Novoa <rnovoa@artica.es>
* pandoradb_data.sql, DEBIAN/control,

View File

@ -2,7 +2,7 @@
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
@ -160,13 +160,13 @@ if ($event_type != ""){
// If normal, warning, could be several (going_up_warning, going_down_warning... too complex
// for the user so for him is presented only "warning, critical and normal"
if ($event_type == "warning" || $event_type == "critical" || $event_type == "normal"){
$sql_post .= " AND event_type LIKE '%$event_type%' ";
}
elseif ($event_type == "not_normal"){
$sql_post .= " AND event_type LIKE '%warning%' OR LIKE '%critical%' ";
}
else
$sql_post .= " AND event_type = '".$event_type."'";
$sql_post .= " AND event_type LIKE '%$event_type%' ";
}
elseif ($event_type == "not_normal"){
$sql_post .= " AND event_type LIKE '%warning%' OR LIKE '%critical%' ";
}
else
$sql_post .= " AND event_type = '".$event_type."'";
}
if ($severity != -1)

View File

@ -179,7 +179,7 @@ echo '<table class="databox" cellpadding="4" cellspacing="4" width="95%"><tr>
<td valign="middle"><h3>'.__('Filter').'</h3>';
$fields = get_incidents_status ();
print_select ($fields, "estado", $estado, 'javascript:this.form.submit();', __('All incidents'), -1, false, false, false, 'w155');
print_select ($fields, "estado", $estado, 'javascript:this.form.submit();', __('All incidents'), -1, false, false, false, 'w155');
//Legend
echo '</td><td valign="middle"><noscript>';
@ -241,7 +241,7 @@ if ($count < 1) {
$url .= "&amp;texto=".$texto;
// Show pagination
pagination ($count + $offset, $url, $offset, 15, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
pagination ($count + $offset, $url, $offset, 15, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
echo '<br />';
// Show headers
@ -262,7 +262,7 @@ if ($count < 1) {
$table->head[5] = __('Updated');
$table->head[6] = __('Source');
$table->head[7] = __('Owner');
$table->head[8] = 'X';
$table->head[8] = __('Action');
$table->size[0] = 43;
$table->size[7] = 50;
@ -291,17 +291,11 @@ if ($count < 1) {
$data[0] .= '&nbsp;&nbsp;'.print_image ("images/attachment.png", true, array ("style" => "align:middle;"));
$data[1] = print_incidents_status_img ($row["estado"], true);
$data[2] = '<a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident_detail&amp;id='.$row["id_incidencia"].'">'.substr(safe_output($row["titulo"]),0,45).'</a>';
$data[3] = print_incidents_priority_img ($row["prioridad"], true);
$data[3] = print_incidents_priority_img ($row["prioridad"], true);
$data[4] = print_group_icon ($row["id_grupo"], true);
$data[5] = print_timestamp ($row["actualizacion"], true);
$data[6] = $row["origen"];
$data[6] = $row["origen"];
$data[7] = print_username ($row["id_usuario"], true);
if (give_acl ($config["id_user"], $row["id_grupo"], "IM") || $config["id_user"] == $row["id_usuario"] || $config["id_user"] == $row["id_creator"]) {
@ -309,13 +303,14 @@ if ($count < 1) {
} else {
$data[8] = '';
}
array_push ($table->data, $data);
}
echo '<form method="post" action="'.$url.'&amp;action=mass" style="margin-bottom: 0px;">';
print_table ($table);
echo '<div style="text-align:right; float:right; padding-right: 30px;">';
echo '<div style="text-align:right; float:right; padding-right: 2px;">';
echo '<b>'.__('Action').': </b>' ;
if (give_acl ($config["id_user"], 0, "IW")) {
print_submit_button (__('Delete incidents'), 'delete_btn', false, 'class="sub delete"');
}

View File

@ -199,7 +199,6 @@ echo "<script type=\"text/javascript\">
});
});</script>";
if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["insert_form"]
print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=update">';
@ -283,12 +282,12 @@ if (empty ($id_creator)) {
echo '</td></tr><tr><td class="datos2" colspan="4">';
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
} else {
print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
}
echo '</td></tr></table><div style="width: 600px; text-align:right;">';
echo '</td></tr></table><div style="width: 650px; text-align:right;">';
// Only if user is the used who opened incident or (s)he is admin
if (isset ($id_inc) AND ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {