mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-2104-gis-tooltip-improvements' into 'develop'
Ent 2104 gis tooltip improvements See merge request artica/pandorafms!1414
This commit is contained in:
commit
12451fa63b
@ -196,55 +196,45 @@ function gis_make_layer($name, $visible = true, $dot = null, $idLayer = null, $p
|
|||||||
layer.events.on({
|
layer.events.on({
|
||||||
"featureselected": function(e) {
|
"featureselected": function(e) {
|
||||||
if (e.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
if (e.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
||||||
var feature = e.feature;
|
var featureData = e.feature.data;
|
||||||
var featureData = feature.data;
|
|
||||||
var long_lat = featureData.long_lat;
|
var img_src = "<?php echo ui_get_full_url('images/spinner.gif', false, false, false, false); ?>";
|
||||||
var popup;
|
var $details = $('<div />');
|
||||||
|
|
||||||
var img_src = null;
|
$details
|
||||||
|
.prop("id", 'cloudContent_' + featureData.id)
|
||||||
|
.css("text-align", "center")
|
||||||
|
.html('<img src="' + img_src + '" />')
|
||||||
|
.dialog({
|
||||||
|
title: "<?php echo __('Agent'); ?> #" + featureData.id,
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
modal: true,
|
||||||
|
overlay: {
|
||||||
|
opacity: 0.5,
|
||||||
|
background: "black"
|
||||||
|
},
|
||||||
|
close: function () {
|
||||||
|
$details.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
url: "<?php echo ui_get_full_url('ajax.php', false, false, false, false); ?>",
|
url: "<?php echo ui_get_full_url('ajax.php', false, false, false, false); ?>",
|
||||||
data: {
|
data: {
|
||||||
page: "include/ajax/skins.ajax",
|
page: "operation/gis_maps/ajax",
|
||||||
get_image_path: 1,
|
opt: featureData.type,
|
||||||
img_src: "images/spinner.gif"
|
id: featureData.id,
|
||||||
|
hash: "<?php echo $hash; ?>",
|
||||||
|
id_user: "<?php echo $config['id_user']; ?>",
|
||||||
|
map_id: <?php echo (int)$id_map; ?>
|
||||||
},
|
},
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
dataType: 'html',
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
img_src = data;
|
if (data.correct) {
|
||||||
|
$details.css("text-align", "left").html(data.content);
|
||||||
popup = new OpenLayers.Popup.FramedCloud('cloud00',
|
}
|
||||||
long_lat,
|
|
||||||
null,
|
|
||||||
'<div class="cloudContent' + featureData.id + '" style="text-align: center;">' + img_src + '</div>',
|
|
||||||
null,
|
|
||||||
true,
|
|
||||||
function () { popup.destroy(); });
|
|
||||||
feature.popup = popup;
|
|
||||||
map.addPopup(popup);
|
|
||||||
|
|
||||||
jQuery.ajax ({
|
|
||||||
url: "<?php echo ui_get_full_url('ajax.php', false, false, false, false); ?>",
|
|
||||||
data: {
|
|
||||||
page: "operation/gis_maps/ajax",
|
|
||||||
opt: featureData.type,
|
|
||||||
id: featureData.id,
|
|
||||||
hash: "<?php echo $hash; ?>",
|
|
||||||
id_user: "<?php echo $config['id_user']; ?>",
|
|
||||||
map_id: <?php echo (int)$id_map; ?>
|
|
||||||
},
|
|
||||||
type: "GET",
|
|
||||||
dataType: 'json',
|
|
||||||
success: function (data) {
|
|
||||||
if (data.correct) {
|
|
||||||
$('.cloudContent' + featureData.id).css('text-align', 'left');
|
|
||||||
$('.cloudContent' + featureData.id).html(data.content);
|
|
||||||
popup.updateSize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,8 @@ require_once ($config['homedir'] . '/include/functions_gis.php');
|
|||||||
require_once ($config['homedir'] . '/include/functions_ui.php');
|
require_once ($config['homedir'] . '/include/functions_ui.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_agents.php');
|
require_once ($config['homedir'] . '/include/functions_agents.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_groups.php');
|
require_once ($config['homedir'] . '/include/functions_groups.php');
|
||||||
|
require_once ($config['homedir'] . '/include/functions_events.php');
|
||||||
|
require_once ($config['homedir'] . '/include/functions_alerts.php');
|
||||||
|
|
||||||
$opt = get_parameter('opt');
|
$opt = get_parameter('opt');
|
||||||
|
|
||||||
@ -338,6 +340,43 @@ switch ($opt) {
|
|||||||
}
|
}
|
||||||
$table->data[] = $row;
|
$table->data[] = $row;
|
||||||
|
|
||||||
|
// Critical && not validated events
|
||||||
|
$filter = array(
|
||||||
|
"id_agente" => (int) $agent['id_agente'],
|
||||||
|
"criticity" => EVENT_CRIT_CRITICAL,
|
||||||
|
"estado" => array(EVENT_STATUS_NEW, EVENT_STATUS_INPROCESS)
|
||||||
|
);
|
||||||
|
$result = events_get_events($filter, "COUNT(*) as num");
|
||||||
|
|
||||||
|
if (!empty($result)) {
|
||||||
|
$number = (int) $result[0]["num"];
|
||||||
|
|
||||||
|
if ($number > 0) {
|
||||||
|
$row = array();
|
||||||
|
$row[] = __("Number of non-validated critical events");
|
||||||
|
$row[] = '<a href="?sec=estado&sec2=operation/events/events&status=3&severity=' . EVENT_CRIT_CRITICAL
|
||||||
|
. '&id_agent=' . $agent['id_agente'] . '">' . $number . '</a>';
|
||||||
|
$table->data[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alerts fired
|
||||||
|
$alerts_fired = alerts_get_alerts(0, "", "fired", -1, $true, false, $agent['id_agente']);
|
||||||
|
if (!empty($alerts_fired)) {
|
||||||
|
$row = array();
|
||||||
|
$row[] = __("Alert(s) fired");
|
||||||
|
$alerts_detail = "";
|
||||||
|
foreach ($alerts_fired as $alert) {
|
||||||
|
$alerts_detail .= "<p>"
|
||||||
|
. $alert['module_name'] . " - "
|
||||||
|
. $alert['template_name'] . " - "
|
||||||
|
. date($config["date_format"], $alert['last_fired'])
|
||||||
|
. "</p>";
|
||||||
|
}
|
||||||
|
$row[] = $alerts_detail;
|
||||||
|
$table->data[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
// To remove the grey background color of the classes datos and datos2
|
// To remove the grey background color of the classes datos and datos2
|
||||||
for ($i = 0; $i < count($table->data); $i++)
|
for ($i = 0; $i < count($table->data); $i++)
|
||||||
$table->rowstyle[] = 'background-color: inherit;';
|
$table->rowstyle[] = 'background-color: inherit;';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user