2012-02-28 Miguel de Dios <miguel.dedios@artica.es>

* godmode/alerts/configure_alert_action.php,
	godmode/alerts/configure_alert_template.php,
	godmode/modules/manage_network_components_form.php,
	godmode/users/configure_user.php, include/functions_forecast.php,
	mobile/operation/agents/monitor_status.php: cleaned source code style.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5661 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-02-28 12:05:41 +00:00
parent 4320cdc101
commit 7a3a3a6f7d
7 changed files with 44 additions and 23 deletions

View File

@ -1,4 +1,12 @@
2012-02-27 Miguel de Dios <miguel.dedios@artica.es> 2012-02-28 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_network_components_form.php,
godmode/users/configure_user.php, include/functions_forecast.php,
mobile/operation/agents/monitor_status.php: cleaned source code style.
2012-02-28 Miguel de Dios <miguel.dedios@artica.es>
* operation/integria_incidents/incident.php: added error message when * operation/integria_incidents/incident.php: added error message when
Pandora have a bad conf for the Integria API. And cleaned source code style. Pandora have a bad conf for the Integria API. And cleaned source code style.

View File

@ -41,11 +41,12 @@ if ($al_action !== false){
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
}else }
else
// Header // Header
ui_print_page_header (__('Alerts').' &raquo; '.__('Configure alert action'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Configure alert action'), "images/god2.png", false, "", true);
// If user tries to edit an action of others groups } // If user tries to edit an action of others groups
}else{ else {
$own_info = get_user_info ($config['id_user']); $own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "LM")); $own_groups = array_keys(users_get_groups($config['id_user'], "LM"));
@ -63,7 +64,8 @@ if ($al_action !== false){
exit; exit;
} }
} }
}else }
else
// Header // Header
ui_print_page_header (__('Alerts').' &raquo; '.__('Configure alert action'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Configure alert action'), "images/god2.png", false, "", true);

View File

@ -35,7 +35,8 @@ $id = (int) get_parameter ('id');
if ($duplicate_template) { if ($duplicate_template) {
$source_id = (int) get_parameter ('source_id'); $source_id = (int) get_parameter ('source_id');
$a_template = alerts_get_alert_template($source_id); $a_template = alerts_get_alert_template($source_id);
}else{ }
else {
$a_template = alerts_get_alert_template($id); $a_template = alerts_get_alert_template($id);
} }
@ -48,11 +49,13 @@ if ($a_template !== false){
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
}else }
else
// Header // Header
ui_print_page_header (__('Alerts').' &raquo; '.__('Configure alert template'), "", false, "", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Configure alert template'), "", false, "", true);
// If user tries to duplicate/edit a template of others groups
}else{ } // If user tries to duplicate/edit a template of others groups
else {
$own_info = get_user_info ($config['id_user']); $own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "LM")); $own_groups = array_keys(users_get_groups($config['id_user'], "LM"));

View File

@ -154,7 +154,8 @@ if ($id) {
html_print_input_hidden ('update_component', 1); html_print_input_hidden ('update_component', 1);
html_print_input_hidden ('id', $id); html_print_input_hidden ('id', $id);
html_print_submit_button (__('Update'), 'upd', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'upd', false, 'class="sub upd"');
} else { }
else {
html_print_input_hidden ('create_component', 1); html_print_input_hidden ('create_component', 1);
html_print_submit_button (__('Create'), 'crt', false, 'class="sub wand"'); html_print_submit_button (__('Create'), 'crt', false, 'class="sub wand"');
} }
@ -436,7 +437,8 @@ $(document).ready (function () {
$("input[name=active_snmp_v3]").val(1); $("input[name=active_snmp_v3]").val(1);
$("input[name=snmp_community]").css({backgroundColor: '#ddd'}); $("input[name=snmp_community]").css({backgroundColor: '#ddd'});
$("input[name=snmp_community]").attr("disabled",true); $("input[name=snmp_community]").attr("disabled",true);
}else{ }
else {
$("input[name=snmp3_auth_user]").val(""); $("input[name=snmp3_auth_user]").val("");
$("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'}); $("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'});
$("input[name=snmp3_auth_user]").attr("disabled", true); $("input[name=snmp3_auth_user]").attr("disabled", true);

View File

@ -387,7 +387,8 @@ else
if ($new_user) { if ($new_user) {
$usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group)); $usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group));
$id_usr = $config['id_user']; $id_usr = $config['id_user'];
}else{ }
else {
$usr_groups = (users_get_groups($id, 'AR', $display_all_group)); $usr_groups = (users_get_groups($id, 'AR', $display_all_group));
$id_usr = $id; $id_usr = $id;
} }
@ -420,7 +421,8 @@ if ($new_user) {
html_print_input_hidden ('create_user', 1); html_print_input_hidden ('create_user', 1);
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"'); html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
} }
} else { }
else {
if ($config['user_can_update_info']) { if ($config['user_can_update_info']) {
html_print_input_hidden ('update_user', 1); html_print_input_hidden ('update_user', 1);
html_print_submit_button (__('Update'), 'uptbutton', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'uptbutton', false, 'class="sub upd"');

View File

@ -64,7 +64,10 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
// Creates data for calculation // Creates data for calculation
foreach ($module_data as $utimestamp => $row) { foreach ($module_data as $utimestamp => $row) {
if ($utimestamp == '') { continue; } if ($utimestamp == '') {
continue;
}
$data[0] = ''; $data[0] = '';
$data[1] = $cont; $data[1] = $cont;
$data[2] = date('d M Y H:i:s', $utimestamp); $data[2] = date('d M Y H:i:s', $utimestamp);
@ -75,7 +78,8 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
$data[7] = $row['sum'] * $row['sum']; $data[7] = $row['sum'] * $row['sum'];
if ($cont == 1){ if ($cont == 1){
$data[8] = 0; $data[8] = 0;
}else{ }
else {
$data[8] = $utimestamp - $last_timestamp; $data[8] = $utimestamp - $last_timestamp;
} }