2009-03-27 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Put template details icon on the left of the cell. * operation/agentes/alerts_status.php: Fixed validation errors. Moved validation to the top before reading the alerts. Added some size info to the tables. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1575 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
bf785adeee
commit
7354f983bd
|
@ -1,3 +1,12 @@
|
|||
2009-03-27 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* include/functions_ui.php: Put template details icon on the left of
|
||||
the cell.
|
||||
|
||||
* operation/agentes/alerts_status.php: Fixed validation errors. Moved
|
||||
validation to the top before reading the alerts. Added some size info
|
||||
to the tables.
|
||||
|
||||
2009-03-27 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* pandoradb.sql, extras/pandoradb_migrate_v2.x_to_v3.0.sql: Fixed
|
||||
|
|
|
@ -271,15 +271,13 @@ function format_alert_row ($alert, $compound = false, $agent = true, $url = '')
|
|||
$data[1] = print_agent_name (get_agentmodule_agent ($alert["id_agent_module"]), true, 20);
|
||||
}
|
||||
|
||||
$data[2] = '<span class="left">';
|
||||
$data[2] .= mb_substr (safe_input ($description), 0, 35);
|
||||
$data[2] .= '</span>';
|
||||
$data[2] = '';
|
||||
if (! $compound) {
|
||||
$data[2] .= ' <span class="right">';
|
||||
$data[2] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$template['id'].'">';
|
||||
$data[2] .= '<img src="images/zoom.png" />';
|
||||
$data[2] .= '</a></span>';
|
||||
$data[2] .= print_image ('images/zoom.png', true);
|
||||
$data[2] .= '</a> ';
|
||||
}
|
||||
$data[2] .= mb_substr (safe_input ($description), 0, 35);
|
||||
|
||||
$data[3] = print_timestamp ($alert["last_fired"], true);
|
||||
|
||||
|
|
|
@ -34,12 +34,30 @@ $url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$config["refr"].'&filter='.
|
|||
|
||||
// Force alert execution
|
||||
$flag_alert = (bool) get_parameter ('force_execution');
|
||||
if ($flag_alert == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) {
|
||||
$alert_validate = (bool) get_parameter ('alert_validate');
|
||||
|
||||
if ($flag_alert == 1 && give_acl ($config['id_user'], $id_group, "AW")) {
|
||||
require_once ("include/functions_alerts.php");
|
||||
$id_alert = (int) get_parameter ('id_alert');
|
||||
set_alerts_agent_module_force_execution ($id_alert);
|
||||
}
|
||||
|
||||
if ($alert_validate) {
|
||||
$ids = (array) get_parameter_post ("validate", array ());
|
||||
$compound_ids = (array) get_parameter_post ("validate_compound", array ());
|
||||
|
||||
if (! empty ($ids) || ! empty ($compound_ids)) {
|
||||
require_once ("include/functions_alerts.php");
|
||||
$result1 = validate_alert_agent_module ($ids);
|
||||
$result2 = validate_alert_compound ($compound_ids);
|
||||
$result == $result1 || $result2;
|
||||
|
||||
print_result_message ($result,
|
||||
__('Alert(s) validated'),
|
||||
__('Error processing alert(s)'));
|
||||
}
|
||||
}
|
||||
|
||||
// Show alerts for specific agent
|
||||
if (isset ($_GET["id_agente"])) {
|
||||
$id_agent = (int) get_parameter_get ("id_agente", 0);
|
||||
|
@ -86,22 +104,6 @@ if ($tab != '') {
|
|||
|
||||
echo "<h2>".__('Pandora Agents')." > ".__('Alerts').'</h2>';
|
||||
|
||||
if (get_parameter ('alert_validate')) {
|
||||
$ids = (array) get_parameter_post ("validate", array ());
|
||||
$compound_ids = (array) get_parameter_post ("validate_compound", array ());
|
||||
|
||||
if (! empty ($ids) || ! empty ($compound_ids)) {
|
||||
require_once ("include/functions_alerts.php");
|
||||
$result1 = validate_alert_agent_module ($ids);
|
||||
$result2 = validate_alert_compound ($compound_ids);
|
||||
$result == $result1 || $result2;
|
||||
|
||||
print_result_message ($result,
|
||||
__('Alert(s) validated'),
|
||||
__('Error processing alert(s)'));
|
||||
}
|
||||
}
|
||||
|
||||
echo '<form method="post" action="'.$url.'">';
|
||||
|
||||
if ($print_agent) {
|
||||
|
@ -127,6 +129,13 @@ echo '</form>';
|
|||
|
||||
$table->width = '90%';
|
||||
$table->class = "databox";
|
||||
$table->size = array ();
|
||||
$table->size[0] = '20px';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '50%';
|
||||
$table->size[3] = '25%';
|
||||
$table->size[4] = '20px';
|
||||
$table->size[5] = '20px';
|
||||
$table->head = array ();
|
||||
$table->head[0] = '';
|
||||
$table->head[1] = ''; //Placeholder for name
|
||||
|
@ -157,6 +166,8 @@ foreach ($alerts_simple as $alert) {
|
|||
array_push ($table->data, format_alert_row ($alert, false, $print_agent, $url));
|
||||
}
|
||||
|
||||
echo '<form method="post" action="'.$url.'">';
|
||||
|
||||
if (!empty ($table->data)) {
|
||||
pagination ($total, $url, $offset);
|
||||
print_table ($table);
|
||||
|
|
Loading…
Reference in New Issue