2012-08-17 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_api.php: fixed the error messages althought you
	have event data.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6875 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-08-17 11:39:25 +00:00
parent cb962963b4
commit 2694f6bd73
21 changed files with 463 additions and 281 deletions

View File

@ -1,15 +1,31 @@
2012-08-16 Vanessa Gil <vanessa.gil@artica.es>
2012-08-17 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.oracle.sql
pandoradb.postgreSQL.sql
pandoradb.sql
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Changed
type 'subnet' and 'field1' to trecon_task table.
* include/functions_api.php: fixed the error messages althought you
have event data.
* godmode/servers/manage_recontask_form.php: Added help tip:
several networks to recon task.
2012-08-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/plugin_registration.php, extensions/insert_data.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/events/events.php, operation/events/export_csv.php,
operation/incidents/incident_detail.php,
operation/visual_console/render_view.php, extras/pandora_diag.php,
mobile/operation/agents/view_agents.php,
godmode/servers/manage_recontask.php,
godmode/reporting/visual_console_builder.wizard.php,
include/functions_api.php: cleaned source code style.
* godmode/setup/setup_visuals.php, operation/gis_maps/ajax.php,
operation/gis_maps/index.php, operation/gis_maps/render_view.php,
include/functions_config.php, include/functions_gis.php,
include/javascript/openlayers.pandora.js: added the feature to
hidden the names of agents in the map, and when it is set the
default icon in the setup and the agent haven't the icon, then this
is show in the map. Some code from the files "functions_config.php"
and "setup_visuals.php" are modifications of Sancho Lerena from the
branch 4.0.
MERGED FROM BRANCH PANDORA 4.0
2012-08-16 Sergio Martin <sergio.martin@artica.es>

View File

@ -191,7 +191,10 @@ function mainInsertData() {
page: "operation/agentes/exportdata",
"search_agents_2": 1,
"q": term,
id_group: function() { return $("#id_group").val(); }};
id_group: function() {
return $("#id_group").val();
}
};
jQuery.ajax ({
data: data_params,

View File

@ -99,7 +99,7 @@ function pluginreg_extension_main () {
if ($result> 0) {
echo "<h2 class=error>".__("Plugin already registered. Aborting!")."</h2>";
unlink ($config["attachment_store"] . "/plugin_definition.ini");
return;;
return;
}
$values = array(

View File

@ -121,43 +121,90 @@ render_info ("tsesion");
switch ($config["dbtype"]) {
case "mysql":
render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'enterprise_installed'", "Enterprise installed");
render_row ( date ("Y/m/d H:i:s",db_get_sql ("SELECT `value` FROM tconfig WHERE `token` = 'db_maintance'")), "PandoraDB Last run");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'enterprise_installed'", "Enterprise installed");
render_row ( date ("Y/m/d H:i:s",
db_get_sql ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'")), "PandoraDB Last run");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'customer_key';", "Update Key");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'current_update'", "Current Update #");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'customer_key';", "Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'current_update'", "Current Update #");
break;
case "postgresql":
render_info_data ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'enterprise_installed'", "Enterprise installed");
render_row ( date ("Y/m/d H:i:s",db_get_sql ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_maintance'")), "PandoraDB Last run");
render_info_data ("SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'enterprise_installed'", "Enterprise installed");
render_row ( date ("Y/m/d H:i:s",
db_get_sql ("SELECT \"value\"
FROM tconfig WHERE \"token\" = 'db_maintance'")), "PandoraDB Last run");
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'customer_key';", "Update Key");
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'current_update'", "Current Update #");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'customer_key';", "Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'current_update'", "Current Update #");
break;
case "oracle":
render_info_data ("SELECT value FROM tconfig WHERE token = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT value FROM tconfig WHERE token = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT value FROM tconfig WHERE token = 'enterprise_installed'", "Enterprise installed");
render_row (db_get_sql ("SELECT value FROM tconfig WHERE token = 'db_maintance'"), "PandoraDB Last run");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'enterprise_installed'", "Enterprise installed");
render_row (db_get_sql ("SELECT value
FROM tconfig
WHERE token = 'db_maintance'"), "PandoraDB Last run");
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'customer_key'", "Update Key");
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'current_update'", "Current Update #");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE key = 'customer_key'", "Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE key = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE key = 'keygen_path'", "Keygen path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE key = 'current_update'", "Current Update #");
break;
}
if ($console_mode == 0) {
echo "</table>";
}
?>

View File

@ -37,6 +37,7 @@ enterprise_include ('godmode/setup/setup_visuals.php');
*/
require_once ('include/functions_themes.php');
require_once ('include/functions_gis.php');
// Header
ui_print_page_header (__('Visual configuration'), "", false, "", true);
@ -139,9 +140,47 @@ $table->data[20][0] = __('Item title size text') . ui_print_help_tip(__('When th
$table->data[20][1] = html_print_input_text ('item_title_size_text', $config["item_title_size_text"], '', 3, 3, true);
$table->data[21][0] = __('GIS Labels') . ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
$table->data[21][1] = __('Yes').'&nbsp;'.html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'&nbsp;&nbsp;';
$table->data[21][1] .= __('No').'&nbsp;'.html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
$listIcons = gis_get_array_list_icons();
$arraySelectIcon = array();
foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index;
$path = 'images/gis_map/icons/'; //TODO set better method the path
$table->data[22][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
$gis_default_icon = $config["gis_default_icon"];
if ($gis_default_icon == '') {
$display_icons = 'none';
// Hack to show no icon. Use any given image to fix not found image errors
$path_without = "images/spinner.png";
$path_default = "images/spinner.png";
$path_ok = "images/spinner.png";
$path_bad = "images/spinner.png";
$path_warning = "images/spinner.png";
}
else {
$display_icons = '';
$path_without = $path . $gis_default_icon . ".default.png";
$path_default = $path . $gis_default_icon . ".default.png";
$path_ok = $path . $gis_default_icon . ".ok.png";
$path_bad = $path . $gis_default_icon . ".bad.png";
$path_warning = $path . $gis_default_icon . ".warning.png";
}
$table->data[22][1] = html_print_select($arraySelectIcon, "gis_default_icon", $gis_default_icon, "changeIcons();", __('None'), '', true) . '&nbsp;' . html_print_image($path_ok, true, array("id" => "icon_ok", "style" => "display:".$display_icons.";")) . '&nbsp;' . html_print_image($path_bad, true, array("id" => "icon_bad", "style" => "display:".$display_icons.";")) . '&nbsp;' . html_print_image($path_warning, true, array("id" => "icon_warning", "style" => "display:".$display_icons.";"));
echo '<form id="form_setup" method="post">';
html_print_input_hidden ('update_config', 1);
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"');
echo '</div>';

View File

@ -912,7 +912,9 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
function api_get_agent_modules($thrash1, $thrash2, $other, $thrash3) {
$sql = sprintf("SELECT id_agente, id_agente_modulo, nombre
FROM tagente_modulo WHERE id_agente = %d AND disabled = 0 AND delete_pending = 0", $other['data'][0]);
FROM tagente_modulo
WHERE id_agente = %d AND disabled = 0
AND delete_pending = 0", $other['data'][0]);
$all_modules = db_get_all_rows_sql($sql);
@ -942,7 +944,9 @@ function api_get_agent_modules($thrash1, $thrash2, $other, $thrash3) {
function api_get_group_agent($thrash1, $thrash2, $other, $thrash3) {
$sql = sprintf("SELECT groups.nombre nombre
FROM tagente agents, tgrupo groups WHERE id_agente = %d AND agents.disabled = 0 AND groups.disabled = 0
FROM tagente agents, tgrupo groups
WHERE id_agente = %d AND agents.disabled = 0
AND groups.disabled = 0
AND agents.id_grupo = groups.id_grupo", $other['data'][0]);
$group_names = db_get_all_rows_sql($sql);
@ -977,9 +981,11 @@ function api_get_policies($thrash1, $thrash2, $other, $thrash3) {
if ($other['data'][0] != "") {
$where .= ' AND id_agent = ' . $other['data'][0];
$sql = sprintf("SELECT policy.id, name, id_agent FROM tpolicies policy, tpolicy_agents pol_agents
$sql = sprintf("SELECT policy.id, name, id_agent
FROM tpolicies policy, tpolicy_agents pol_agents
WHERE policy.id = pol_agents.id %s", $where);
} else {
}
else {
$sql = "SELECT id, name FROM tpolicies policy";
}
@ -1017,7 +1023,8 @@ function api_get_policy_modules($thrash1, $thrash2, $other, $thrash3) {
return;
}
$policies = enterprise_hook('policies_get_modules_api', array($other['data'][0], $other['data'][1]));
$policies = enterprise_hook('policies_get_modules_api',
array($other['data'][0], $other['data'][1]));
if ($policies === ENTERPRISE_NOT_HOOK) {
returnError('error_policy_modules', 'Error retrieving policy modules.');
@ -5024,11 +5031,13 @@ function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = nul
$dataRows = db_get_all_rows_filter('tevento', $filterString);
$last_error = error_get_last();
if (empty($dataRows)) {
if (!empty($last_error)) {
returnError('ERROR_API_PANDORAFMS', $returnType);
return;
}
}
$data['type'] = 'array';
$data['data'] = $dataRows;

View File

@ -232,6 +232,9 @@ function config_update_config () {
config_update_value ('module_size_text_medium', get_parameter('module_size_text_medium'));
config_update_value ('description_size_text', get_parameter('description_size_text'));
config_update_value ('item_title_size_text', get_parameter('item_title_size_text'));
config_update_value ('gis_label', get_parameter ('gis_label'));
config_update_value ('gis_default_icon', get_parameter ('gis_default_icon'));
/////////////
break;
case 'enterprise/godmode/setup/setup_history':
@ -704,6 +707,14 @@ function config_process_config () {
config_update_value ('item_title_size_text', 45);
}
if (!isset($config['gis_label'])) {
config_update_value ('gis_label', 0);
}
if (!isset($config['gis_default_icon'])) {
config_update_value ('gis_default_icon', "marker");
}
/* Finally, check if any value was overwritten in a form */
config_update_config();
}

View File

@ -36,7 +36,6 @@ function gis_add_parent_lines() {
js_refreshParentLines('" . __('Hierarchy of agents') . "');
});";
echo "</script>";
}
/**
@ -358,6 +357,10 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $width = 20,
$height = 20, $point_id = '', $status = -1, $type_string = '', $idParent = 0) {
global $config;
if (!$config['gis_label'])
$pointName = '';
?>
<script type="text/javascript">
$(document).ready (
@ -458,11 +461,19 @@ function gis_get_layers($idMap) {
}
function gis_get_agent_icon_map($idAgent, $state = false, $status = null) {
$row = db_get_row_sql('SELECT id_grupo, icon_path FROM tagente WHERE id_agente = ' . $idAgent);
global $config;
$row = db_get_row_sql('SELECT id_grupo, icon_path
FROM tagente WHERE id_agente = ' . $idAgent);
if (($row['icon_path'] === null) || (strlen($row['icon_path']) == 0)) {
if ($config['gis_default_icon'] != "") {
$icon = "images/gis_map/icons/" . $config['gis_default_icon'];
}
else {
$icon = "images/groups_small/" . groups_get_icon($row['id_grupo']);
}
}
else {
$icon = "images/gis_map/icons/" . $row['icon_path'];
}

View File

@ -31,7 +31,7 @@ class ViewAgents {
$this->user = $user;
$this->system = $system;
$this->filterText = $this->system->getRequest('filter_text', '');
$this->filterGroup = $this->system->getRequest('filter_group', 0);;
$this->filterGroup = $this->system->getRequest('filter_group', 0);
}
private function showForm() {
@ -286,12 +286,30 @@ class ViewAgent {
if ($module["id_tipo_modulo"] == 24) { // log4x
switch($module["datos"]) {
case 10: $salida = "TRACE"; $style="font-weight:bold; color:darkgreen;"; break;
case 20: $salida = "DEBUG"; $style="font-weight:bold; color:darkgreen;"; break;
case 30: $salida = "INFO"; $style="font-weight:bold; color:darkgreen;"; break;
case 40: $salida = "WARN"; $style="font-weight:bold; color:darkorange;"; break;
case 50: $salida = "ERROR"; $style="font-weight:bold; color:red;"; break;
case 60: $salida = "FATAL"; $style="font-weight:bold; color:red;"; break;
case 10:
$salida = "TRACE";
$style="font-weight:bold; color:darkgreen;";
break;
case 20:
$salida = "DEBUG";
$style="font-weight:bold; color:darkgreen;";
break;
case 30:
$salida = "INFO";
$style="font-weight:bold; color:darkgreen;";
break;
case 40:
$salida = "WARN";
$style="font-weight:bold; color:darkorange;";
break;
case 50:
$salida = "ERROR";
$style="font-weight:bold; color:red;";
break;
case 60:
$salida = "FATAL";
$style="font-weight:bold; color:red;";
break;
}
$salida = "<span style='$style'>$salida</span>";
}

View File

@ -433,12 +433,14 @@ if ($group_rep == 0) {
case "mysql":
$sql = "SELECT *
FROM tevento
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
WHERE 1=1 ".$sql_post."
ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
break;
case "postgresql":
$sql = "SELECT *
FROM tevento
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$pagination." OFFSET ".$offset;
WHERE 1=1 ".$sql_post."
ORDER BY utimestamp DESC LIMIT ".$pagination." OFFSET ".$offset;
break;
case "oracle":
$set = array();
@ -446,7 +448,8 @@ if ($group_rep == 0) {
$set['offset'] = $offset;
$sql = "SELECT *
FROM tevento
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC";
WHERE 1=1 ".$sql_post."
ORDER BY utimestamp DESC";
$sql = oracle_recode_query ($sql, $set);
break;
}
@ -455,8 +458,11 @@ else {
switch ($config["dbtype"]) {
case "mysql":
db_process_sql ('SET group_concat_max_len = 9999999');
$sql = "SELECT *, MAX(id_evento) AS id_evento, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
$sql = "SELECT *, MAX(id_evento) AS id_evento,
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
MIN(estado) AS min_estado,
MAX(estado) AS max_estado,
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
FROM tevento
WHERE 1=1 ".$sql_post."
GROUP BY evento, id_agentmodule

View File

@ -51,10 +51,7 @@ $tag = get_parameter("tag", "");
$filter = array ();
if ($ev_group > 1)
$filter['id_grupo'] = $ev_group;
/*if ($status == 1)
$filter['estado'] = 1;
if ($status == 0)
$filter['estado'] = 0; */
$filter_state = '';
switch ($status) {
case 0:
@ -171,4 +168,3 @@ while ($event = db_get_all_row_by_steps_sql($new, $result, $sql)) {
echo chr (13);
}
?>

View File

@ -18,6 +18,8 @@ require_once ("include/config.php");
check_login ();
global $config;
require_once ('include/functions_gis.php');
require_once ('include/functions_ui.php');
require_once ('include/functions_agents.php');
@ -30,7 +32,8 @@ switch ($opt) {
$returnJSON['correct'] = 1;
$idConection = get_parameter('id_conection');
$row = db_get_row_filter('tgis_map_connection', array('id_tmap_connection' => $idConection));
$row = db_get_row_filter('tgis_map_connection',
array('id_tmap_connection' => $idConection));
$returnJSON['content'] = $row;
@ -113,6 +116,9 @@ switch ($opt) {
foreach ($agentsGISStatus as $row) {
$status = agents_get_status($row['tagente_id_agente']);
if (!$config['gis_label'])
$row['nombre'] = '';
$agents[$row['tagente_id_agente']] = array(
'icon_path' => gis_get_agent_icon_map($row['tagente_id_agente'], true, $status),
'name' => $row['nombre'],
@ -189,7 +195,6 @@ switch ($opt) {
$returnJSON['content'] .= __('Remote').': '. $row["ultimo_contacto"];
echo json_encode($returnJSON);
break;
case 'get_map_connection_data':
$idConnection = get_parameter('id_connection');

View File

@ -98,14 +98,15 @@ else {
if (check_acl ($config["id_user"], $map['group_id'], "IW"))
$buttons [] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
$buttonsString = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3">' . html_print_image("images/bricks.png", true, array("class" => "top", "border" => '0')) . '&nbsp; Agent&nbsp;-&nbsp;test_gis1</a></li></ul></div><div id="menu_tab"><ul class="mn"><li class="nomn"><a href="index.php?sec=estado&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente=3">' . html_print_image("images/setup.png", true, array("class" => "top", "title" => "Manage", "border" => "0", "width" => "16", "title" => "Manage")) . '&nbsp;</a></li><li class="nomn_high"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3">' . html_print_image("images/monitor.png", true, array("class" => "top", "title" => "Main", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3&amp;tab=data">' . html_print_image("images/lightbulb.png", true, array("class" => "top", "title" => "Data", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3&amp;tab=alert">' . html_print_image("images/bell.png", true, array("class" => "top", "title" => "Alerts", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=sla&amp;id_agente=3">' . html_print_image("images/images.png", true, array("class" => "top", "title" => "S.L.A.", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;group_id=2">' . html_print_image("images/agents_group.png", true, array("class" => "top", "title" => "Group", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=inventory&amp;id_agente=3">' . html_print_image("images/page_white_text.png", true, array("class" => "top", "title" => "Inventory", "border" => "0", "width" => "16")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente=3">' . html_print_image("images/world.png", array("class" => "top", "title" => "GIS data", "border" => "0")) . '&nbsp;</a>';
$buttonsString = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3">' .
html_print_image("images/bricks.png", true, array("class" => "top", "border" => '0')) . '&nbsp; Agent&nbsp;-&nbsp;test_gis1</a></li></ul></div><div id="menu_tab"><ul class="mn"><li class="nomn"><a href="index.php?sec=estado&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente=3">' . html_print_image("images/setup.png", true, array("class" => "top", "title" => "Manage", "border" => "0", "width" => "16", "title" => "Manage")) . '&nbsp;</a></li><li class="nomn_high"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3">' . html_print_image("images/monitor.png", true, array("class" => "top", "title" => "Main", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3&amp;tab=data">' . html_print_image("images/lightbulb.png", true, array("class" => "top", "title" => "Data", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=3&amp;tab=alert">' . html_print_image("images/bell.png", true, array("class" => "top", "title" => "Alerts", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=sla&amp;id_agente=3">' . html_print_image("images/images.png", true, array("class" => "top", "title" => "S.L.A.", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;group_id=2">' . html_print_image("images/agents_group.png", true, array("class" => "top", "title" => "Group", "border" => "0")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=inventory&amp;id_agente=3">' . html_print_image("images/page_white_text.png", true, array("class" => "top", "title" => "Inventory", "border" => "0", "width" => "16")) . '&nbsp;</a></li><li class="nomn"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente=3">' . html_print_image("images/world.png", array("class" => "top", "title" => "GIS data", "border" => "0")) . '&nbsp;</a>';
$times = array(
5 => __('5 seconds'),
10 => __('10 seconds'),
30 => __('30 seconds'),
SECONDS_1MINUTE => __('1 minute'),
SECONDS_2MINUTE => __('2 minutes'),
SECONDS_2MINUTES => __('2 minutes'),
SECONDS_5MINUTES => __('5 minutes'),
SECONDS_10MINUTES => __('10 minutes'),
SECONDS_1HOUR => __('1 hour'),
@ -178,10 +179,12 @@ if ($layers != false) {
$timestampLastOperation = db_get_value_sql("SELECT UNIX_TIMESTAMP()");
break;
case "postgresql":
$timestampLastOperation = db_get_value_sql("SELECT ceil(date_part('epoch', CURRENT_TIMESTAMP))");
$timestampLastOperation = db_get_value_sql(
"SELECT ceil(date_part('epoch', CURRENT_TIMESTAMP))");
break;
case "oracle":
$timestampLastOperation = db_get_value_sql("SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (86400)) from dual");
$timestampLastOperation = db_get_value_sql(
"SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (86400)) FROM dual");
break;
}

View File

@ -220,7 +220,8 @@ echo "<script type=\"text/javascript\">
$('#add_note').slideDown('slow');
return false;
});
});</script>";
});
</script>";
if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["insert_form"]
ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
@ -233,21 +234,31 @@ else {
}
echo '<table cellpadding="4" cellspacing="4" class="databox" width="98%">';
echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class="datos">';
echo '<tr>
<td class="datos"><b>'.__('Incident').'</b></td>
<td colspan="3" class="datos">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR
($usuario == $config["id_user"])) {
html_print_input_text ("titulo", $titulo,'', 70);
}
else {
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
}
echo '</td></tr>';
echo '</td>
</tr>';
echo '<tr><td class="datos2"><b>'.__('Opened at').'</b></td><td class="datos2"><i>'.date ($config['date_format'], $inicio).'</i></td>';
echo '<td class="datos2"><b>'.__('Updated at').'</b><td class="datos2"><i>'.date ($config['date_format'], $actualizacion).'</i></td></tr>';
echo '<tr>
<td class="datos2"><b>'.__('Opened at').'</b></td>
<td class="datos2"><i>'.date ($config['date_format'], $inicio).'</i></td>
<td class="datos2"><b>'.__('Updated at').'</b></td>
<td class="datos2"><i>'.date ($config['date_format'], $actualizacion).'</i></td>
</tr>';
echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
echo '<tr>
<td class="datos"><b>'.__('Owner').'</b></td>
<td class="datos">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
@ -255,7 +266,9 @@ if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $conf
else {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
}
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
echo '</td>
<td class="datos"><b>'.__('Status').'</b></td>
<td class="datos">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
@ -263,9 +276,12 @@ if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $conf
else {
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
}
echo '</td></tr>';
echo '</td>
</tr>';
echo '<tr><td class="datos2"><b>'.__('Source').'</b></td><td class="datos2">';
echo '<tr>
<td class="datos2"><b>'.__('Source').'</b></td>
<td class="datos2">';
$fields = array ();
$return = db_get_all_rows_sql ("SELECT origen FROM torigen ORDER BY origen");

View File

@ -399,5 +399,4 @@ function show_data_section () {
break;
}
}
</script>

View File

@ -146,8 +146,11 @@ $(document).ready (function () {
?>
t = new Date();
t.setTime (t.getTime() + <?php echo $config["refr"] * 1000; ?>);
$("#countdown").countdown({until: t, format: 'MS', description: '<?php echo __('Until refresh'); ?>'});
$("#countdown").countdown({
until: t,
format: 'MS',
description: '<?php echo __('Until refresh'); ?>'
});
<?php
}
?>