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

* include/functions.php, operation/events/events.build_table.php,
	general/shortcut_bar.php: improved the code style.
	
	* images/add.disabled.png: added lost icon file for alerts.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7717 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-25 16:21:11 +00:00
parent d036aa2f22
commit 4ae8270398
5 changed files with 46 additions and 39 deletions

View File

@ -1,3 +1,10 @@
2013-02-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php, operation/events/events.build_table.php,
general/shortcut_bar.php: improved the code style.
* images/add.disabled.png: added lost icon file for alerts.
2013-02-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php, operation/agentes/alerts_status.php:

View File

@ -19,7 +19,7 @@ global $config;
// Login check
check_login ();
if (is_ajax()){
if (is_ajax()) {
require_once("include/functions_reporting.php");
$save_item_shorcut = get_parameter("save_item_shorcut", 0);
@ -51,7 +51,7 @@ if (is_ajax()){
$get_opened_incidents = get_parameter('get_opened_incidents', 0);
// Update if shortcut is visible or hidden
if ($update_shortcut_state){
if ($update_shortcut_state) {
$value = get_parameter('value', 0);
db_process_sql_update('tusuario', array('shortcut' => $value), array('id_user' => $config['id_user']));
}
@ -121,7 +121,7 @@ if ($shortcut_state == 0)
if ($shortcut_state == 2) {
echo "<div id='shortcut_button' style='position: fixed; overflow: hidden; bottom: 0px; left: 0px; width: 185px; height: 40px; background-color: #FFFFFF; border: 1px solid #808080; border-top-left-radius: 10px; border-top-right-radius: 10px;'>";
}
else{
else {
echo "<div id='shortcut_button' style='position: fixed; overflow: hidden; bottom: 0px; left: 0px; width: 185px; height: 0px; background-color: #FFFFFF; border: 1px solid #808080; border-top-left-radius: 10px; border-top-right-radius: 10px;'>";
}
html_print_image("images/pandora_textlogo.png", false, array("title" => __("Press here to activate shortcut bar")));
@ -137,7 +137,7 @@ echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
$own_info = get_user_info ($config['id_user']);
// If user is admin can see all groups
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")){
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) {
echo "<a href='index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=120&filter=fired&free_search=&filter_button=Filter'>";
}
else {
@ -154,7 +154,7 @@ echo "&nbsp;";
$data_reporting = reporting_get_group_stats();
echo "<span id='shortcut_alerts_fired' style='font-size: 9pt; color:#696969; font-weight: bold;' title='" . __('Alerts fired') . "'>" . $data_reporting['monitor_alerts_fired'] . "</span>";
if (!empty($own_groups)){
if (!empty($own_groups)) {
echo "</a>";
}
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
@ -162,7 +162,7 @@ echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
$own_info = get_user_info ($config['id_user']);
// If user is admin can see all groups
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")){
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) {
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&filter_only_alert=-1'>";
}
else {
@ -189,7 +189,7 @@ if ($shortcut_events == false)
$shortcut_events = array();
$critical_events = 0;
foreach($shortcut_events as $event){
foreach ($shortcut_events as $event) {
if ($event['criticity'] == 4 and $event['estado'] == 0) {
$critical_events++;
}
@ -199,7 +199,7 @@ echo "<span id='shortcut_critical_events' style='font-size: 9pt; color:#696969;
echo "</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
// Calculate opened incidents (id integria incidents are not enabled)
if ($config['integria_enabled'] == 0){
if ($config['integria_enabled'] == 0) {
echo "<a href='index.php?sec=incidencias&sec2=operation/incidents/incident&estado=0'>";
html_print_image("images/book_edit.png", false, array("title" => __("Incidents opened"), "style" => "margin-bottom: -5px;"));
echo "&nbsp;";
@ -242,7 +242,7 @@ echo "</a>";
// Login in Console and shortcut bar is disabled
// This will show and hide the shortcut value in Javascript code
if (isset($_POST['nick']) and $shortcut_state != 2){
if (isset($_POST['nick']) and $shortcut_state != 2) {
html_print_input_hidden("login_console", 1);
}
else {

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

View File

@ -1649,12 +1649,12 @@ function get_periods ($custom = true, $show_default = true) {
$periods = array ();
if($custom) {
if ($custom) {
$periods[-1] = __('custom');
}
if(empty($config['interval_values'])) {
if($show_default) {
if (empty($config['interval_values'])) {
if ($show_default) {
$periods[SECONDS_5MINUTES] = sprintf(__('%s minutes'), '5');
$periods[SECONDS_30MINUTES] = sprintf(__('%s minutes'), '30 ');
$periods[SECONDS_1HOUR] = __('1 hour');

View File

@ -143,7 +143,7 @@ $idx = 0;
foreach ($result as $event) {
$data = array ();
if($meta) {
if ($meta) {
$event['server_url_hash'] = $servers_url_hash[$event['server_id']];
$event['server_url'] = $servers[$event['server_id']]['server_url'];
$event['server_name'] = $servers[$event['server_id']]['server_name'];
@ -197,7 +197,7 @@ foreach ($result as $event) {
$data[$i] .= html_print_input_hidden('timestamp_last_' . $event["id_evento"], $timestamp_last, true);
// Store server id if is metaconsole. 0 otherwise
if($meta) {
if ($meta) {
$server_id = $event['server_id'];
// If meta activated, propagate the id of the event on node (source id)
@ -470,18 +470,18 @@ foreach ($result as $event) {
echo '<div id="events_list">';
if (!empty ($table->data)) {
echo '<div style="clear:both"></div>';
if($allow_pagination) {
if ($allow_pagination) {
ui_pagination ($total_events, $url, $offset, $pagination);
}
if($allow_action) {
if ($allow_action) {
echo '<form method="post" id="form_events" action="'.$url.'">';
echo "<input type='hidden' name='delete' id='hidden_delete_events' value='0' />";
}
html_print_table ($table);
if($allow_action) {
if ($allow_action) {
echo '<div style="width:'.$table->width.';" class="action-buttons">';
if (tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected();', 'class="sub ok"');