2013-01-30 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/planned_downtime.list.php, include/db/oracle.php,
	include/Image/image_functions.php,
	operation/events/events.build_table.php,
	operation/messages/message_edit.php, operation/users/user_edit.php,
	operation/tree.php: improved the source style.
	
	* include/constants.php: added constants for the subtype of modules.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7550 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-01-30 13:53:02 +00:00
parent 470864b136
commit 4b174a29b0
9 changed files with 85 additions and 65 deletions

View File

@ -1,3 +1,13 @@
2013-01-30 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/planned_downtime.list.php, include/db/oracle.php,
include/Image/image_functions.php,
operation/events/events.build_table.php,
operation/messages/message_edit.php, operation/users/user_edit.php,
operation/tree.php: improved the source style.
* include/constants.php: added constants for the subtype of modules.
2013-01-30 Sergio Martin <sergio.martin@artica.es> 2013-01-30 Sergio Martin <sergio.martin@artica.es>
* godmode/events/event_responses.editor.php: Little fix * godmode/events/event_responses.editor.php: Little fix

View File

@ -153,7 +153,7 @@ else {
$data[5] .= "&nbsp;"; $data[5] .= "&nbsp;";
} }
$data[5] .= "&nbsp;(" . $downtime['periodically_time_from']; $data[5] .= "&nbsp;(" . $downtime['periodically_time_from'];
$data[5] .= "-" . $downtime['periodically_time_to'] . ")"; $data[5] .= "-" . $downtime['periodically_time_to'] . ")";
break; break;
case 'monthly': case 'monthly':
$data[5] = __('Monthly:'); $data[5] = __('Monthly:');

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* @category Images * @category Images
* @package Image_Graph * @package Image_Graph
*/ */
/** /**

View File

@ -208,6 +208,8 @@ define ('STATUS_ALERT_DISABLED', 'alert_disabled.png');
define ('STATUS_SERVER_OK', 'server_ok.png'); define ('STATUS_SERVER_OK', 'server_ok.png');
define ('STATUS_SERVER_DOWN', 'server_down.png'); define ('STATUS_SERVER_DOWN', 'server_down.png');
/* Events criticity */ /* Events criticity */
define ('EVENT_CRIT_MAINTENANCE', 0); define ('EVENT_CRIT_MAINTENANCE', 0);
define ('EVENT_CRIT_INFORMATIONAL', 1); define ('EVENT_CRIT_INFORMATIONAL', 1);
@ -219,4 +221,9 @@ define ('EVENT_CRIT_CRITICAL', 4);
define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34); define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34);
define ('EVENT_CRIT_NOT_NORMAL', 20); define ('EVENT_CRIT_NOT_NORMAL', 20);
/* Id Module (more use in component)*/
define ('MODULE_WMI', 6);
define ('MODULE_NETWORK', 2);
define ('MODULE_PLUGIN', 4);
define ('MODULE_WEB', 7);
?> ?>

View File

@ -621,12 +621,12 @@ function oracle_db_format_array_where_clause_sql ($values, $join = 'AND', $prefi
$query .= sprintf ("%s IN ('%s')", $field, implode ("', '", $value)); $query .= sprintf ("%s IN ('%s')", $field, implode ("', '", $value));
} }
else { else {
if ($value[0] == ">"){ if ($value[0] == ">") {
$value = substr($value,1,strlen($value)-1); $value = substr($value,1,strlen($value)-1);
$query .= sprintf ("%s > '%s'", $field, $value); $query .= sprintf ("%s > '%s'", $field, $value);
} }
else if ($value[0] == "<"){ else if ($value[0] == "<") {
if ($value[1] == ">"){ if ($value[1] == ">") {
$value = substr($value,2,strlen($value)-2); $value = substr($value,2,strlen($value)-2);
$query .= sprintf ("%s <> '%s'", $field, $value); $query .= sprintf ("%s <> '%s'", $field, $value);
} }
@ -904,9 +904,9 @@ function oracle_db_get_row_filter ($table, $filter, $fields = false, $where_join
} }
else { else {
if (is_array ($fields)) if (is_array ($fields))
$fields = implode (',', $fields); $fields = implode (',', $fields);
else if (! is_string ($fields)) else if (! is_string ($fields))
return false; return false;
} }
if (is_array ($filter)) if (is_array ($filter))
@ -1224,6 +1224,7 @@ function oracle_db_process_sql_delete_temp ($table, $where, $where_join = 'AND')
} }
$result = ''; $result = '';
return db_process_sql ($query, "affected_rows", '', true, $result, false); return db_process_sql ($query, "affected_rows", '', true, $result, false);
} }

View File

@ -289,7 +289,7 @@ foreach ($result as $event) {
$data[$i] = '<b><a href="'.$event["server_url"].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $event["id_agente"] . $event["server_url_hash"] . '">'; $data[$i] = '<b><a href="'.$event["server_url"].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $event["id_agente"] . $event["server_url_hash"] . '">';
$data[$i] .= $event["agent_name"]; $data[$i] .= $event["agent_name"];
$data[$i] .= "</a></b>"; $data[$i] .= "</a></b>";
} }
else { else {
$data[$i] .= ui_print_agent_name ($event["id_agente"], true); $data[$i] .= ui_print_agent_name ($event["id_agente"], true);
} }

View File

@ -83,7 +83,7 @@ if ($read_message) {
$table->data[2][0] = __('Subject'); $table->data[2][0] = __('Subject');
$table->data[2][1] = html_print_input_text_extended ("subject", $message["subject"], 'text-subject', '', 50, 70, true, false, '', 'readonly'); $table->data[2][1] = html_print_input_text_extended ("subject", $message["subject"], 'text-subject', '', 50, 70, true, false, '', 'readonly');
$order = array("\r\n", "\n", "\r"); $order = array("\r\n", "\n", "\r");
$replace = '<br />'; $replace = '<br />';
$parsed_message = str_replace($order, $replace, $message["mensaje"]); $parsed_message = str_replace($order, $replace, $message["mensaje"]);

View File

@ -561,8 +561,8 @@ if (! defined ('METACONSOLE')) {
$img_style = array ("class" => "top", "width" => 16); $img_style = array ("class" => "top", "width" => 16);
$activeTab = get_parameter('tab','group'); $activeTab = get_parameter('tab','group');
$group_tab = array('text' => "<a href='index.php?sec=monitoring&sec2=operation/tree&refr=0&tab=group&pure=$pure'>" $group_tab = array('text' => "<a href='index.php?sec=monitoring&sec2=operation/tree&refr=0&tab=group&pure=$pure'>"
. html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "</a>", . html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "</a>",
'active' => $activeTab == "group"); 'active' => $activeTab == "group");
$tags_tab = array('text' => "<a href='index.php?&sec=monitoring&sec2=operation/tree&refr=0&tab=tag&pure=$pure'>" $tags_tab = array('text' => "<a href='index.php?&sec=monitoring&sec2=operation/tree&refr=0&tab=tag&pure=$pure'>"
. html_print_image ("images/tag_red.png", true, array ("title" => __('Tags'))) . "</a>", 'active' => $activeTab == "tag"); . html_print_image ("images/tag_red.png", true, array ("title" => __('Tags'))) . "</a>", 'active' => $activeTab == "tag");
$subsections = array('group' => $group_tab, 'tag' => $tags_tab); $subsections = array('group' => $group_tab, 'tag' => $tags_tab);
@ -586,7 +586,8 @@ if(tags_has_user_acl_tags()) {
echo "<br>"; echo "<br>";
if (! defined ('METACONSOLE')) { if (! defined ('METACONSOLE')) {
echo '<form id="tree_search" method="post" action="index.php?extension_in_menu=estado&sec=estado&sec2=operation/tree&refr=0&sort_by='.$activeTab.'&pure='.$pure.'">'; echo '<form id="tree_search" method="post" action="index.php?extension_in_menu=estado&sec=estado&sec2=operation/tree&refr=0&sort_by='.$activeTab.'&pure='.$pure.'">';
} else { }
else {
echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$activeTab.'&pure='.$pure.'">'; echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$activeTab.'&pure='.$pure.'">';
} }
echo "<b>" . __('Agent status') . "</b>"; echo "<b>" . __('Agent status') . "</b>";
@ -635,7 +636,7 @@ treeview_printTree($activeTab);
* less_branchs int use in ajax php as binary structure 0b00, 0b01, 0b10 and 0b11 * less_branchs int use in ajax php as binary structure 0b00, 0b01, 0b10 and 0b11
* id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one * id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one
*/ */
function loadSubTree(type, div_id, less_branchs, id_father, server_name) { function loadSubTree(type, div_id, less_branchs, id_father, server_name) {
hiddenDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv'); hiddenDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv');
loadDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv'); loadDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv');
pos = parseInt($('#tree_image'+id_father+'_'+type+'_'+div_id).attr('pos_tree')); pos = parseInt($('#tree_image'+id_father+'_'+type+'_'+div_id).attr('pos_tree'));
@ -690,9 +691,11 @@ treeview_printTree($activeTab);
}); });
} }
else { else {
<?php if (! defined ('METACONSOLE')) { <?php
if (! defined ('METACONSOLE')) {
echo 'var icon_path = \'operation/tree\';'; echo 'var icon_path = \'operation/tree\';';
} else { }
else {
echo 'var icon_path = \'../../operation/tree\';'; echo 'var icon_path = \'../../operation/tree\';';
} }
?> ?>

View File

@ -237,8 +237,7 @@ $usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group));
$id_usr = $config['id_user']; $id_usr = $config['id_user'];
// User only can change skins if has more than one group // User only can change skins if has more than one group
if (count($usr_groups) > 1){ if (count($usr_groups) > 1) {
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); $isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
echo '</td></tr><tr><td class="datos">' . __('Skin') . '</td><td class="datos2">'; echo '</td></tr><tr><td class="datos">' . __('Skin') . '</td><td class="datos2">';
@ -250,7 +249,7 @@ echo '</td></tr><tr><td class="datos">'.__('Interactive charts') . ui_print_help
$values = array(-1 => __('Default'),1 => __('Yes'),0 => __('No')); $values = array(-1 => __('Default'),1 => __('Yes'),0 => __('No'));
echo html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false); echo html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false);
echo '</td></tr><tr><td class="datos">'.__('Block size for pagination'). ui_print_help_tip(__('If checkbox is clicked then block size global configuration is used'), true) . '</td><td class="datos2">'; echo '</td></tr><tr><td class="datos">'.__('Block size for pagination'). ui_print_help_tip(__('If checkbox is clicked then block size global configuration is used'), true) . '</td><td class="datos2">';
if($user_info["block_size"] == 0) { if ($user_info["block_size"] == 0) {
$block_size = $config["global_block_size"]; $block_size = $config["global_block_size"];
} }
else { else {
@ -371,42 +370,42 @@ $(document).ready (function () {
function show_data_section () { function show_data_section () {
section=$("#section").val(); section=$("#section").val();
switch (section) { switch (section) {
case <?php echo "'".__('Dashboard')."'"; ?>: case <?php echo "'" . __('Dashboard') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", ""); $("#dashboard").css("display", "");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Visual console')."'"; ?>: case <?php echo "'" . __('Visual console') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", ""); $("#visual_console").css("display", "");
break; break;
case <?php echo "'".__('Event list')."'"; ?>: case <?php echo "'" . __('Event list') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Group view')."'"; ?>: case <?php echo "'" . __('Group view') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Tactical view')."'"; ?>: case <?php echo "'" . __('Tactical view') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Alert detail')."'"; ?>: case <?php echo "'" . __('Alert detail') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Other')."'"; ?>: case <?php echo "'" . __('Other') . "'"; ?>:
$("#text-data_section").css("display", ""); $("#text-data_section").css("display", "");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");
break; break;
case <?php echo "'".__('Default')."'"; ?>: case <?php echo "'" . __('Default') . "'"; ?>:
$("#text-data_section").css("display", "none"); $("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none"); $("#dashboard").css("display", "none");
$("#visual_console").css("display", "none"); $("#visual_console").css("display", "none");