2012-12-04 Miguel de Dios <miguel.dedios@artica.es>

* godmode/reporting/reporting_builder.php,
	godmode/reporting/map_builder.php,
	godmode/reporting/visual_console_builder.php,
	godmode/reporting/visual_console_builder.data.php,
	include/functions_visual_map_editor.php,
	operation/reporting/reporting_xml.php,
	operation/agentes/exportdata.excel.php,
	operation/agentes/ver_agente.php,
	operation/agentes/status_monitor.php,
	operation/agentes/alerts_status.php,
	operation/agentes/exportdata.csv.php: uploaded the changes of source
	code style previous to my next commit for to make the next commit
	more easy.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7224 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-12-04 12:21:39 +00:00
parent 88c6d89c5a
commit 03b0fc8a95
12 changed files with 105 additions and 74 deletions

View File

@ -1,3 +1,19 @@
2012-12-04 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.data.php,
include/functions_visual_map_editor.php,
operation/reporting/reporting_xml.php,
operation/agentes/exportdata.excel.php,
operation/agentes/ver_agente.php,
operation/agentes/status_monitor.php,
operation/agentes/alerts_status.php,
operation/agentes/exportdata.csv.php: uploaded the changes of source
code style previous to my next commit for to make the next commit
more easy.
2012-12-03 Ramon Novoa <rnovoa@artica.es>
* include/functions_treeview.php: Fixed id decoding under the

View File

@ -61,13 +61,13 @@ if ($copy_layout) {
$idNewVisualConsole = $result;
if($result) {
if ($result) {
$ninsert = 1;
// Return from DB the items of the source layout
$data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout);
if(!empty($data_layout_src)) {
if (!empty($data_layout_src)) {
//By default the id parent 0 is always 0.
$id_relations = array(0 => 0);
@ -91,7 +91,7 @@ if ($copy_layout) {
$id_relations[$old_id] = $result;
}
if($result)
if ($result)
$ninsert++;
}// for each item of console
@ -138,7 +138,7 @@ $table->head[1] = __('Group');
$table->head[2] = __('Items');
//Only for IW flag
if(check_acl ($config['id_user'], 0, "IW")) {
if (check_acl ($config['id_user'], 0, "IW")) {
$table->head[3] = __('Copy');
$table->head[4] = __('Delete');
}

View File

@ -1164,9 +1164,12 @@ switch ($action) {
break;
// Type case only depends of local database
case 'type':
$sql = "SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s";
$sql = "SELECT id_rc
FROM treport_content
WHERE %s ORDER BY type %s";
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
$sql = sprintf($sql,
'id_report = ' . $idReport, '%s');
switch ($dir) {
case 'up':
$sql = sprintf($sql, 'ASC');
@ -1224,15 +1227,18 @@ switch ($action) {
switch ($config["dbtype"]) {
case "mysql":
$resultOperationDB = db_process_sql_update('treport_content',
array('`order`' => $oldOrder), array('`order`' => $newOrder, 'id_report' => $idReport));
array('`order`' => $oldOrder),
array('`order`' => $newOrder, 'id_report' => $idReport));
break;
case "postgresql":
$resultOperationDB = db_process_sql_update('treport_content',
array('"order"' => $oldOrder), array('"order"' => $newOrder, 'id_report' => $idReport));
array('"order"' => $oldOrder),
array('"order"' => $newOrder, 'id_report' => $idReport));
break;
case "oracle":
$resultOperationDB = db_process_sql_update('treport_content',
array('"order"' => $oldOrder), array('"order"' => $newOrder, 'id_report' => $idReport), 'AND', false);
array('"order"' => $oldOrder),
array('"order"' => $newOrder, 'id_report' => $idReport), 'AND', false);
break;
}
if ($resultOperationDB !== false) {

View File

@ -42,6 +42,7 @@ switch ($activeTab) {
$background = '';
$visualConsoleName = '';
break;
case 'update':
case 'save':
$idGroup = get_parameter('id_group');
@ -53,7 +54,7 @@ switch ($activeTab) {
// If the background is changed the size is reseted
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
$background_now = $visualConsole['background'];
if($background_now != $background && $background) {
if ($background_now != $background && $background) {
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
$values['width'] = $sizeBackground[0];
$values['height'] = $sizeBackground[1];
@ -74,8 +75,8 @@ switch ($activeTab) {
$statusProcessInDB = array('flag' => false, 'message' => '<h3 class="error">'.__('Could not be update.').'</h3>');
}
break;
case 'save':
case 'save':
if($values['name'] != "" && $values['background'])
$idVisualConsole = db_process_sql_insert('tlayout', $values);
else
@ -94,6 +95,7 @@ switch ($activeTab) {
}
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
break;
case 'edit':
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
$visualConsoleName = $visualConsole['name'];
@ -102,6 +104,7 @@ switch ($activeTab) {
break;
}
break;
case 'list_elements':
switch ($action) {
case 'update':

View File

@ -232,7 +232,7 @@ if (defined('METACONSOLE')) {
}
if (!defined('METACONSOLE')) {
echo '
echo '
<td valign="middle">' . __('Group') . '</td>
<td valign="middle">' .
html_print_select_groups(false, "AR", true, "ag_group",
@ -241,15 +241,15 @@ echo '
</td>';
}
else {
echo '
<td valign="middle">' . __('Group') . '</td>
<td valign="middle">' .
html_print_select($groups_select, "ag_group",
io_safe_output($ag_group), '', '', '0', true, false, false, 'w130',
false, 'width:150px;') . '
</td>';
echo '
<td valign="middle">' . __('Group') . '</td>
<td valign="middle">' .
html_print_select($groups_select, "ag_group",
io_safe_output($ag_group), '', '', '0', true, false, false, 'w130',
false, 'width:150px;') . '
</td>';
}
echo '<td>' . __('Monitor status') . "</td>";
echo '<td>' . __('Monitor status') . "</td>";
@ -507,7 +507,7 @@ else {
if (defined('METACONSOLE')) {
if ($modulegroup != '-1')
$sql .= sprintf (" AND tagente_modulo.id_module_group IN (SELECT id_mg
FROM tmodule_group WHERE name = '%s')", $modulegroup);
FROM tmodule_group WHERE name = '%s')", $modulegroup);
}
else if ($modulegroup > -1) {
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
@ -735,9 +735,10 @@ else {
$result_server = db_get_all_rows_sql ($sql);
if(!empty($result_server)) {
if (!empty($result_server)) {
$pwd = $server["auth_token"]; // Create HASH login info
// Create HASH login info
$pwd = $server["auth_token"];
$auth_serialized = json_decode($pwd,true);
if (is_array($auth_serialized)) {
@ -1039,11 +1040,11 @@ else {
}
?>
<script type="text/javascript">
function toggle_full_value(id) {
value_title = $("#hidden-value_replace_module_" + id).val();
function toggle_full_value(id) {
value_title = $("#hidden-value_replace_module_" + id).val();
$("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html());
$("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html());
$("#value_module_text_" + id).html(value_title);
}
$("#value_module_text_" + id).html(value_title);
}
</script>

View File

@ -322,6 +322,7 @@ if (is_ajax ()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) == NOERR) {
/* Get all agents if no agent was given */
if ($id_agent == 0)
$id_agent = array_keys (
@ -332,6 +333,7 @@ if (is_ajax ()) {
$agent_modules = agents_get_modules ($id_agent,
($fields != '' ? explode (',', $fields) : "*"),
($filter != '' ? $filter : false), $indexed);
}
// Restore db connection
metaconsole_restore_db();
@ -351,6 +353,7 @@ if (is_ajax ()) {
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
}
//Hack to translate text "any" in PHP to javascript
//$agent_modules['any_text'] = __('Any');

View File

@ -592,7 +592,8 @@ foreach ($contents as $content) {
$content_report = " <event_report_agent/>\n";
$result = fwrite($file, $content_report);
fclose($file);
} else if ($data_count <= $limit) {
}
else if ($data_count <= $limit) {
$content_report = " <event_report_agent>\n";
$result = fwrite($file, $content_report);
fclose($file);
@ -612,7 +613,8 @@ foreach ($contents as $content) {
$result = fwrite($file, $content_report);
} else {
}
else {
$content_report = " <event_report_agent>\n";
$result = fwrite($file, $content_report);
fclose($file);