mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-16 10:24:56 +02:00
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:
parent
88c6d89c5a
commit
03b0fc8a95
@ -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>
|
2012-12-03 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* include/functions_treeview.php: Fixed id decoding under the
|
* include/functions_treeview.php: Fixed id decoding under the
|
||||||
|
@ -61,13 +61,13 @@ if ($copy_layout) {
|
|||||||
|
|
||||||
$idNewVisualConsole = $result;
|
$idNewVisualConsole = $result;
|
||||||
|
|
||||||
if($result) {
|
if ($result) {
|
||||||
$ninsert = 1;
|
$ninsert = 1;
|
||||||
|
|
||||||
// Return from DB the items of the source layout
|
// Return from DB the items of the source layout
|
||||||
$data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_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.
|
//By default the id parent 0 is always 0.
|
||||||
$id_relations = array(0 => 0);
|
$id_relations = array(0 => 0);
|
||||||
@ -91,7 +91,7 @@ if ($copy_layout) {
|
|||||||
$id_relations[$old_id] = $result;
|
$id_relations[$old_id] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($result)
|
if ($result)
|
||||||
$ninsert++;
|
$ninsert++;
|
||||||
}// for each item of console
|
}// for each item of console
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ $table->head[1] = __('Group');
|
|||||||
$table->head[2] = __('Items');
|
$table->head[2] = __('Items');
|
||||||
|
|
||||||
//Only for IW flag
|
//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[3] = __('Copy');
|
||||||
$table->head[4] = __('Delete');
|
$table->head[4] = __('Delete');
|
||||||
}
|
}
|
||||||
|
@ -1164,9 +1164,12 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
// Type case only depends of local database
|
// Type case only depends of local database
|
||||||
case 'type':
|
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) {
|
switch ($dir) {
|
||||||
case 'up':
|
case 'up':
|
||||||
$sql = sprintf($sql, 'ASC');
|
$sql = sprintf($sql, 'ASC');
|
||||||
@ -1224,15 +1227,18 @@ switch ($action) {
|
|||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$resultOperationDB = db_process_sql_update('treport_content',
|
$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;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$resultOperationDB = db_process_sql_update('treport_content',
|
$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;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$resultOperationDB = db_process_sql_update('treport_content',
|
$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;
|
break;
|
||||||
}
|
}
|
||||||
if ($resultOperationDB !== false) {
|
if ($resultOperationDB !== false) {
|
||||||
|
@ -42,6 +42,7 @@ switch ($activeTab) {
|
|||||||
$background = '';
|
$background = '';
|
||||||
$visualConsoleName = '';
|
$visualConsoleName = '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'update':
|
case 'update':
|
||||||
case 'save':
|
case 'save':
|
||||||
$idGroup = get_parameter('id_group');
|
$idGroup = get_parameter('id_group');
|
||||||
@ -53,7 +54,7 @@ switch ($activeTab) {
|
|||||||
// If the background is changed the size is reseted
|
// If the background is changed the size is reseted
|
||||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||||
$background_now = $visualConsole['background'];
|
$background_now = $visualConsole['background'];
|
||||||
if($background_now != $background && $background) {
|
if ($background_now != $background && $background) {
|
||||||
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
|
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
|
||||||
$values['width'] = $sizeBackground[0];
|
$values['width'] = $sizeBackground[0];
|
||||||
$values['height'] = $sizeBackground[1];
|
$values['height'] = $sizeBackground[1];
|
||||||
@ -74,8 +75,8 @@ switch ($activeTab) {
|
|||||||
$statusProcessInDB = array('flag' => false, 'message' => '<h3 class="error">'.__('Could not be update.').'</h3>');
|
$statusProcessInDB = array('flag' => false, 'message' => '<h3 class="error">'.__('Could not be update.').'</h3>');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'save':
|
|
||||||
|
|
||||||
|
case 'save':
|
||||||
if($values['name'] != "" && $values['background'])
|
if($values['name'] != "" && $values['background'])
|
||||||
$idVisualConsole = db_process_sql_insert('tlayout', $values);
|
$idVisualConsole = db_process_sql_insert('tlayout', $values);
|
||||||
else
|
else
|
||||||
@ -94,6 +95,7 @@ switch ($activeTab) {
|
|||||||
}
|
}
|
||||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||||
$visualConsoleName = $visualConsole['name'];
|
$visualConsoleName = $visualConsole['name'];
|
||||||
@ -102,6 +104,7 @@ switch ($activeTab) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'list_elements':
|
case 'list_elements':
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'update':
|
case 'update':
|
||||||
|
@ -232,7 +232,7 @@ if (defined('METACONSOLE')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('METACONSOLE')) {
|
if (!defined('METACONSOLE')) {
|
||||||
echo '
|
echo '
|
||||||
<td valign="middle">' . __('Group') . '</td>
|
<td valign="middle">' . __('Group') . '</td>
|
||||||
<td valign="middle">' .
|
<td valign="middle">' .
|
||||||
html_print_select_groups(false, "AR", true, "ag_group",
|
html_print_select_groups(false, "AR", true, "ag_group",
|
||||||
@ -241,15 +241,15 @@ echo '
|
|||||||
</td>';
|
</td>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '
|
echo '
|
||||||
<td valign="middle">' . __('Group') . '</td>
|
<td valign="middle">' . __('Group') . '</td>
|
||||||
<td valign="middle">' .
|
<td valign="middle">' .
|
||||||
html_print_select($groups_select, "ag_group",
|
html_print_select($groups_select, "ag_group",
|
||||||
io_safe_output($ag_group), '', '', '0', true, false, false, 'w130',
|
io_safe_output($ag_group), '', '', '0', true, false, false, 'w130',
|
||||||
false, 'width:150px;') . '
|
false, 'width:150px;') . '
|
||||||
</td>';
|
</td>';
|
||||||
}
|
}
|
||||||
echo '<td>' . __('Monitor status') . "</td>";
|
echo '<td>' . __('Monitor status') . "</td>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ else {
|
|||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
if ($modulegroup != '-1')
|
if ($modulegroup != '-1')
|
||||||
$sql .= sprintf (" AND tagente_modulo.id_module_group IN (SELECT id_mg
|
$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) {
|
else if ($modulegroup > -1) {
|
||||||
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
|
||||||
@ -735,9 +735,10 @@ else {
|
|||||||
|
|
||||||
$result_server = db_get_all_rows_sql ($sql);
|
$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);
|
$auth_serialized = json_decode($pwd,true);
|
||||||
|
|
||||||
if (is_array($auth_serialized)) {
|
if (is_array($auth_serialized)) {
|
||||||
@ -1039,11 +1040,11 @@ else {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function toggle_full_value(id) {
|
function toggle_full_value(id) {
|
||||||
value_title = $("#hidden-value_replace_module_" + id).val();
|
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>
|
</script>
|
||||||
|
@ -322,6 +322,7 @@ if (is_ajax ()) {
|
|||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
|
|
||||||
if (metaconsole_load_external_db($connection) == NOERR) {
|
if (metaconsole_load_external_db($connection) == NOERR) {
|
||||||
|
|
||||||
/* Get all agents if no agent was given */
|
/* Get all agents if no agent was given */
|
||||||
if ($id_agent == 0)
|
if ($id_agent == 0)
|
||||||
$id_agent = array_keys (
|
$id_agent = array_keys (
|
||||||
@ -332,6 +333,7 @@ if (is_ajax ()) {
|
|||||||
$agent_modules = agents_get_modules ($id_agent,
|
$agent_modules = agents_get_modules ($id_agent,
|
||||||
($fields != '' ? explode (',', $fields) : "*"),
|
($fields != '' ? explode (',', $fields) : "*"),
|
||||||
($filter != '' ? $filter : false), $indexed);
|
($filter != '' ? $filter : false), $indexed);
|
||||||
|
|
||||||
}
|
}
|
||||||
// Restore db connection
|
// Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
@ -351,6 +353,7 @@ if (is_ajax ()) {
|
|||||||
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
|
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Hack to translate text "any" in PHP to javascript
|
//Hack to translate text "any" in PHP to javascript
|
||||||
//$agent_modules['any_text'] = __('Any');
|
//$agent_modules['any_text'] = __('Any');
|
||||||
|
|
||||||
|
@ -592,7 +592,8 @@ foreach ($contents as $content) {
|
|||||||
$content_report = " <event_report_agent/>\n";
|
$content_report = " <event_report_agent/>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
} else if ($data_count <= $limit) {
|
}
|
||||||
|
else if ($data_count <= $limit) {
|
||||||
$content_report = " <event_report_agent>\n";
|
$content_report = " <event_report_agent>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
@ -612,7 +613,8 @@ foreach ($contents as $content) {
|
|||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$content_report = " <event_report_agent>\n";
|
$content_report = " <event_report_agent>\n";
|
||||||
$result = fwrite($file, $content_report);
|
$result = fwrite($file, $content_report);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user