2013-02-11 Miguel de Dios <miguel.dedios@artica.es>

* godmode/menu.php, godmode/alerts/configure_alert_template.php,
	godmode/alerts/alert_actions.php,
	godmode/agentes/agent_template.php,
	godmode/massive/massive_delete_agents.php: cleaned source code.
	
	* include/functions_html.php: added the weeks in the input for
	times.
	
	* operation/agentes/stat_win.php: fixed the malformated table when
	show extended options in the time widget.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7617 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-11 10:26:16 +00:00
parent c78199a6bb
commit b35dd543ce
8 changed files with 82 additions and 55 deletions

View File

@ -1,3 +1,16 @@
2013-02-11 Miguel de Dios <miguel.dedios@artica.es>
* godmode/menu.php, godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_actions.php,
godmode/agentes/agent_template.php,
godmode/massive/massive_delete_agents.php: cleaned source code.
* include/functions_html.php: added the weeks in the input for
times.
* operation/agentes/stat_win.php: fixed the malformated table when
show extended options in the time widget.
2013-02-11 Sergio Martin <sergio.martin@artica.es> 2013-02-11 Sergio Martin <sergio.martin@artica.es>
* operation/gis_maps/index.php * operation/gis_maps/index.php

View File

@ -106,13 +106,14 @@ if (isset ($_POST["template_id"])) {
$error_count++; $error_count++;
} }
else { else {
$id_agente_modulo = db_process_sql_insert('tagente_modulo', $values); $id_agente_modulo = db_process_sql_insert('tagente_modulo', $values);
// Set the initial module status // Set the initial module status
if ($row2["type"] == 21 || $row2["type"] == 22 || $row2["type"] == 23) { if ($row2["type"] == 21 || $row2["type"] == 22 || $row2["type"] == 23) {
$status = 0; $status = 0;
} else { }
else {
$status = 4; $status = 4;
} }
@ -131,10 +132,11 @@ if (isset ($_POST["template_id"])) {
// Update module status count // Update module status count
if ($status == 4) { if ($status == 4) {
db_process_sql ('UPDATE tagente SET total_count=total_count+1, notinit_count=notinit_count+1 WHERE id_agente=' . (int)$id_agente); db_process_sql ('UPDATE tagente SET total_count=total_count+1, notinit_count=notinit_count+1 WHERE id_agente=' . (int)$id_agente);
} else { }
else {
db_process_sql ('UPDATE tagente SET total_count=total_count+1, normal_count=normal_count+1 WHERE id_agente=' . (int)$id_agente); db_process_sql ('UPDATE tagente SET total_count=total_count+1, normal_count=normal_count+1 WHERE id_agente=' . (int)$id_agente);
} }
} }
else else
$error_count++; $error_count++;
} }

View File

@ -81,13 +81,13 @@ if ($copy_action) {
exit; exit;
} }
else { else {
// Header // Header
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header (); alerts_meta_print_header ();
} }
else { else {
ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "alert_action", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
} }
} }
} // If user tries to copy an action of others groups } // If user tries to copy an action of others groups
else { else {
@ -99,13 +99,13 @@ if ($copy_action) {
$is_in_group = in_array($al_action['id_group'], $own_groups); $is_in_group = in_array($al_action['id_group'], $own_groups);
// Then action group have to be in his own groups // Then action group have to be in his own groups
if ($is_in_group) { if ($is_in_group) {
// Header // Header
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header (); alerts_meta_print_header ();
} }
else { else {
ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "alert_action", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
} }
} }
else { else {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
@ -113,13 +113,14 @@ if ($copy_action) {
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
} }
} }
} else { }
// Header else {
// Header
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header (); alerts_meta_print_header ();
} }
else { else {
ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "alert_action", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
} }
} }

View File

@ -412,7 +412,7 @@ if ($create_template) {
} }
else { else {
$result = ''; $result = '';
} }
if ($result) { if ($result) {
//db_pandora_audit("Command management", "Create alert command " . $result, false, false, json_encode($values)); //db_pandora_audit("Command management", "Create alert command " . $result, false, false, json_encode($values));
db_pandora_audit("Template alert management", "Create alert template #" . $result, false, false, json_encode($values)); db_pandora_audit("Template alert management", "Create alert template #" . $result, false, false, json_encode($values));

View File

@ -49,7 +49,7 @@ function process_manage_delete ($id_agents) {
if (! $success) { if (! $success) {
$agent_id_restore = $id_agent; $agent_id_restore = $id_agent;
break; break;
} }
$count_deleted++; $count_deleted++;
} }

View File

@ -274,7 +274,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
if (array_key_exists('fatherId',$extmenu)) { if (array_key_exists('fatherId',$extmenu)) {
if (strlen($extmenu['fatherId']) > 0) { if (strlen($extmenu['fatherId']) > 0) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']); $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
if ($extmenu["name"] != 'DB interface'){ if ($extmenu["name"] != 'DB interface') {
if (!empty($config['refr'])) { if (!empty($config['refr'])) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr'];
} }

View File

@ -448,6 +448,7 @@ function html_print_extended_select_for_time ($name, $selected = '', $script = '
SECONDS_1MINUTE => __('minutes'), SECONDS_1MINUTE => __('minutes'),
SECONDS_1HOUR => __('hours'), SECONDS_1HOUR => __('hours'),
SECONDS_1DAY => __('days'), SECONDS_1DAY => __('days'),
SECONDS_1WEEK => __('weeks'),
SECONDS_1MONTH => __('months'), SECONDS_1MONTH => __('months'),
SECONDS_1YEAR => __('years')); SECONDS_1YEAR => __('years'));

View File

@ -37,7 +37,7 @@ if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) {
db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $loginhash_user; $_SESSION['id_usuario'] = $loginhash_user;
$config["id_user"] = $loginhash_user; $config["id_user"] = $loginhash_user;
$hash_connection_data = true; $hash_connection_data = true;
} }
@ -283,18 +283,18 @@ $label = base64_decode(get_parameter('label', ''));
<?php <?php
echo __('Please, make your changes and apply with the <i>Reload</i> button'); echo __('Please, make your changes and apply with the <i>Reload</i> button');
?> ?>
<div style="float: left; width: 80%;"> <div style="float: left; width: 85%;">
<form method="get" action="stat_win.php"> <form method="get" action="stat_win.php">
<?php <?php
html_print_input_hidden ("id", $id); html_print_input_hidden ("id", $id);
html_print_input_hidden ("label", $label); html_print_input_hidden ("label", $label);
if (isset($hash_connection_data)) { if (isset($hash_connection_data)) {
html_print_input_hidden("loginhash", "auto"); html_print_input_hidden("loginhash", "auto");
html_print_input_hidden("loginhash_data", $loginhash_data); html_print_input_hidden("loginhash_data", $loginhash_data);
html_print_input_hidden("loginhash_user", $loginhash_user); html_print_input_hidden("loginhash_user", $loginhash_user);
} }
html_print_input_hidden ("id", $id); html_print_input_hidden ("id", $id);
@ -305,10 +305,10 @@ $label = base64_decode(get_parameter('label', ''));
html_print_input_hidden ("type", $type); html_print_input_hidden ("type", $type);
} }
?> ?>
<table class="databox_frame" cellspacing="5" width="100%"> <table class="databox_frame" cellspacing="2" width="100%">
<tr> <tr>
<td><?php echo __('Refresh time');?></td> <td><?php echo __('Refresh time');?></td>
<td> <td width="50%">
<?php <?php
html_print_extended_select_for_time( html_print_extended_select_for_time(
"refresh", $refresh, '', '', 0, 7); "refresh", $refresh, '', '', 0, 7);
@ -390,33 +390,43 @@ $label = base64_decode(get_parameter('label', ''));
case 'boolean': case 'boolean':
case 'sparse': case 'sparse':
?> ?>
<tr> <tr>
<td><?php echo __('Time compare').' ('.__('Overlapped').')';?></td> <td>
<td> <?php
<?php echo __('Time compare') . ' (' .
html_print_checkbox ("time_compare_overlapped", __('Overlapped') . ')';
1, (bool) $time_compare_overlapped); ?>
?> </td>
</td> <td>
</tr> <?php
<tr> html_print_checkbox ("time_compare_overlapped",
<td><?php echo __('Time compare').' ('.__('Separated').')';?></td> 1, (bool) $time_compare_overlapped);
<td> ?>
<?php </td>
html_print_checkbox ("time_compare_separated", </tr>
1, (bool) $time_compare_separated); <tr>
?> <td>
</td> <?php
</tr> echo __('Time compare') . ' ('.
<tr> __('Separated').')';
<td><?php echo __('Show unknown graph');?></td> ?>
<td> </td>
<?php <td>
html_print_checkbox ("unknown_graph", <?php
1, (bool) $unknown_graph); html_print_checkbox ("time_compare_separated",
?> 1, (bool) $time_compare_separated);
</td> ?>
</tr> </td>
</tr>
<tr>
<td><?php echo __('Show unknown graph');?></td>
<td>
<?php
html_print_checkbox ("unknown_graph",
1, (bool) $unknown_graph);
?>
</td>
</tr>
<?php <?php
break; break;
} }