2009-03-26 Esteban Sanchez <estebans@artica.es>

* include/javascript/jquery.ui.dialog.js: Added to repository.

	* index.php, general/header.php: Replaced overlay with jquery UI
	dialog.

	* godmode/agentes/module_manager.php: Use print_moduletype_image().

	* images/close.png, images/transparent.png,
	include/javascript/jquery.overlay.js: Removed from repository.

	* include/javascript/jquery.pandora.js: Use dialog instead of overlay.

	* include/styles/images/dialog-*: Added to repository. Dialog images.

	* include/styles/pandora.css: Removed overlay styles.

	* include/styles/dialog.css: Added to repository. Dialog styles.

	* include/functions_ui.php: Show description on
	print_moduletype_icon() title.

	* operation/agentes/estado_agente.php: Return control instead of exit.

	* operation/agentes/estado_ultimopaquete.php: Style corrections and
	usage of pandora database functions.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1570 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2009-03-26 15:55:30 +00:00
parent 6d3638696b
commit 5c3d1009a6
33 changed files with 404 additions and 232 deletions

View File

@ -1,3 +1,31 @@
2009-03-26 Esteban Sanchez <estebans@artica.es>
* include/javascript/jquery.ui.dialog.js: Added to repository.
* index.php, general/header.php: Replaced overlay with jquery UI
dialog.
* godmode/agentes/module_manager.php: Use print_moduletype_image().
* images/close.png, images/transparent.png,
include/javascript/jquery.overlay.js: Removed from repository.
* include/javascript/jquery.pandora.js: Use dialog instead of overlay.
* include/styles/images/dialog-*: Added to repository. Dialog images.
* include/styles/pandora.css: Removed overlay styles.
* include/styles/dialog.css: Added to repository. Dialog styles.
* include/functions_ui.php: Show description on
print_moduletype_icon() title.
* operation/agentes/estado_agente.php: Return control instead of exit.
* operation/agentes/estado_ultimopaquete.php: Style corrections and
usage of pandora database functions.
2009-03-26 Esteban Sanchez <estebans@artica.es>
* godmode/reporting/reporting_builder.php: Some small fixes which

View File

@ -37,8 +37,16 @@ echo '</td><td width="20">&nbsp;</td>';
echo '<td width="20%"><img src="images/user_'.((is_user_admin ($config["id_user"]) == 1) ? 'suit' : 'green' ).'.png" class="bot" alt="user" />&nbsp;'.'<a href="index.php?sec=usuarios&amp;sec2=operation/users/user_edit" class="white">'.__('You are').' [<b>'.$config["id_user"].'</b>]</a> ';
$msg_cnt = get_message_count ($config["id_user"]);
if ($msg_cnt > 0) {
echo '<a href="ajax.php?page=operation/messages/message&amp;refr=60" rel="#overlay">';
print_image ("images/email.png", false, array ("title" => __('You have').' '.$msg_cnt.' '.__('unread message(s)'), "id" => "yougotmail", "class" => "bot"));
echo '<div id="dialog_messages" style="display: none"></div>';
require_css_file ('dialog');
require_jquery_file ('ui.core');
require_jquery_file ('ui.dialog');
echo '<a href="ajax.php?page=operation/messages/message" id="show_messages_dialog">';
print_image ("images/email.png", false,
array ("title" => __('You have %d unread message(s)', $msg_cnt),
"id" => "yougotmail",
"class" => "bot"));
echo '</a>';
}
@ -107,7 +115,9 @@ require_jquery_file ('countdown');
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
<?php if ($msg_cnt > 0): ?>
$("#yougotmail").pulsate ();
<?php endif; ?>
<?php if ($config["refr"]): ?>
t = new Date();
t.setTime (t.getTime () + <?php echo $config["refr"] * 1000; ?>);

View File

@ -144,7 +144,7 @@ foreach ($modules as $module) {
// Module type (by data type)
$data[2] = '';
if ($type) {
$data[2] = print_image ('images/'.show_icon_type ($type), true);
$data[2] = print_moduletype_icon ($type, true);
}
// Module interval

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -924,17 +924,19 @@ function debug ($var, $backtrace = true) {
function print_moduletype_icon ($id_moduletype, $return = false) {
global $config;
$type = get_db_row ("ttipo_modulo", "id_tipo", (int) $id_moduletype, array ("nombre", "icon"));
$type = get_db_row ("ttipo_modulo", "id_tipo", (int) $id_moduletype, array ("descripcion", "icon"));
if ($type === false) {
$type = array ();
$type["nombre"] = __('Unknown Type');
$type["descripcion"] = __('Unknown Type');
$type["icon"] = 'b_down.png';
}
$imagepath = 'images/'.$type["icon"];
if (! file_exists ($config['homedir'].'/'.$imagepath))
$imagepath = ENTERPRISE_DIR.'/'.$imagepath;
return print_image ($imagepath, $return, array ("border" => 0, "title" => $type["nombre"]));
return print_image ($imagepath, $return,
array ("border" => 0,
"title" => $type["descripcion"]));
}
/**

View File

@ -1,13 +0,0 @@
/*!
* jquery.overlay 1.0.1. Overlay HTML with eyecandy.
*
* Copyright (c) 2009 Tero Piirainen
* http://flowplayer.org/tools/overlay.html
*
* Dual licensed under MIT and GPL 2+ licenses
* http://www.opensource.org/licenses
*
* Launch : March 2008
* Version : 1.0.1 - Wed Feb 18 2009 05:18:25 GMT-0000 (GMT+00:00)
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){6 q=[];4 H(a,c,d,e){6 b=a[c];3($.17(b)){1K{5 b.1y(d,e)}1s(V){3(a.U){U("21 1X 7."+c+": "+V)}1c{18 V;}5 y}}5 9}4 13(l,p){6 f=r;6 j=G;6 w=$(T);6 k=p.S||l.I("20");6 o=k?$(k):G;3(!o){o=l}1c{j=l}6 h=o.I("7");3(!h){h=o.v("1d");h=h.1Q(h.10("(")+1,h.10(")"));o.v("1d","1N");o.I("7",h)}3(!h){18"1M-1L 1J 1I 1G 1F 1E 7 1C: "+k;}h=h.1B(/\\"/g,"");3(p.Y){$(T).L(4(){1u(4(){6 a=X 1r();a.1l=h},1o)})}6 g=o.1m({1k:9});6 m=o.2a({1k:9});6 i=$(\'<25 1l="\'+h+\'"/>\');i.v({23:0,1g:\'x\'}).s(g).R();$(\'1Y\').1W(i);3(j){j.F("Q.7",4(e){f.L(e.1U-w.O(),e.1T-w.N());5 e.1S()})}3(!p.8||!o.1b(p.8).1a){o.1P(\'<J 1O="8"></J>\');p.8="J.8"}6 n=o.1b(p.8);$.W(f,{L:4(a,b){3(f.K()){5 f}3(p.16){$.15(q,4(){r.8()})}3(H(p,"Z",f)===y){5 f}a=a||p.A.t;b=b||p.A.u;6 d=p.E.t;6 c=p.E.u;3(d==\'D\'){d=C.12((w.11()-m)/2-1D,0)}3(c==\'D\'){c=C.12((w.s()-g)/2,0)}3(!p.A.x){a+=w.O();b+=w.N()}3(!p.E.x){d+=w.O();c+=w.N()}i.v({t:a,u:b,s:p.A.s,B:p.B}).1H();i.1A({t:d,u:c,s:g},p.14,4(){o.v({1g:\'x\',t:d,u:c});6 z=i.v("B");n.1z(o).v("B",++z);o.1x(p.19,4(){H(p,"1w",f)})});5 f},1v:4(){5 i},1t:4(){5 o},1R:4(){5 j},K:4(){5 o.P(":M")},1q:4(){5 p},8:4(){3(!f.K()){5 f}3(H(p,"1V",f)===y){5 f}3(i.P(":M")){i.R();o.R()}5 f},1p:4(){5[1,0,0]},1f:4(){i.1f()}});n.F("Q.7",4(){f.8()});w.F("1n.7",4(a){3(a.1Z==27){f.8()}});3(p.1e){w.F("Q.7",4(a){3(!o.P(":M, :2f")){5}6 b=$(a.S);3(b.I("7")){5}3(b.2e("[7]").1a){5}f.8()})}}1j.2b.7=4(d){6 c=r.29(28 d==\'26\'?d:0).1i("7");3(c){5 c}6 w=$(T);6 b={A:{t:C.1h(w.11()/2),u:C.1h(w.s()/2),s:0,x:y},E:{t:\'D\',u:\'D\',x:y},14:\'24\',19:\'2c\',8:G,16:9,1e:9,Y:9,B:2d,S:G,U:9};3($.17(d)){d={Z:d}}$.W(9,b,d);r.15(4(){6 a=X 13($(r),b);q.22(a);$(r).1i("7",a)});5 r}})(1j);',62,140,'|||if|function|return|var|overlay|close|true||||||||||||||||||this|width|top|left|css||absolute|false||start|zIndex|Math|center|finish|bind|null|fireEvent|attr|div|isOpened|load|visible|scrollLeft|scrollTop|is|click|hide|target|window|alert|error|extend|new|preload|onBeforeLoad|indexOf|height|max|Overlay|speed|each|oneInstance|isFunction|throw|fadeInSpeed|length|find|else|backgroundImage|closeOnClick|expose|position|round|data|jQuery|margin|src|outerWidth|keypress|2000|getVersion|getConf|Image|catch|getContent|setTimeout|getBackgroundImage|onLoad|fadeIn|call|add|animate|replace|element|30|for|set|not|show|property|CSS|try|image|background|none|class|prepend|substring|getTrigger|preventDefault|pageX|pageY|onClose|append|calling|body|keyCode|rel|Error|push|border|normal|img|number||typeof|eq|outerHeight|prototype|fast|9999|parents|animated'.split('|'),0,{}))

View File

@ -18,10 +18,9 @@ $(document).ready (function () {
};
$.fn.pulsate = function () {
var i=0;
for (i=0; i<=2; i++) {
$(this).fadeOut ("slow");
$(this).fadeIn ("slow");
var i = 0;
for (i = 0; i <= 2; i++) {
$(this).fadeOut ("slow").fadeIn ("slow");
}
};
@ -30,9 +29,31 @@ $(document).ready (function () {
.text (msg)
.slideDown ();
};
$("a#show_messages_dialog").click (function () {
jQuery.get ("ajax.php",
{"page": "operation/messages/message"},
function (data, status) {
$("#dialog_messages").hide ()
.empty ()
.append (data)
.dialog ({
title: $("a#show_messages_dialog").attr ("title"),
resizable: false,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
bgiframe: jQuery.browser.msie,
width: 700,
height: 300
})
.show ();
},
"html"
);
$("a[rel]").overlay (function() {
var wrap = this.getContent().find("div.wrap");
wrap.load(this.getTrigger().attr("href"));
return false;
});
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,149 @@
/* This file skins dialog */
.ui-dialog {
background-color: #ffffff;
}
.ui-dialog .ui-dialog-titlebar {
border-bottom: 1px solid #d8d2aa;
background: #778866 url(images/dialog-title.gif) repeat-x;
padding: 0px;
height: 28px;
_height: 29px;
}
.ui-dialog.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-dialog .ui-dialog-titlebar-close {
width: 16px;
height: 16px;
background: url(images/dialog-titlebar-close.png) no-repeat;
position:absolute;
top: 6px;
right: 7px;
cursor: default;
}
.ui-dialog .ui-dialog-titlebar-close span {
display: none;
}
.ui-dialog .ui-dialog-titlebar-close-hover {
background: url(images/dialog-titlebar-close-hover.png) no-repeat;
}
.ui-dialog .ui-dialog-titlebar-close-hover {
color: #000000;
}
.ui-dialog .ui-dialog-title {
margin-left: 5px;
color: white;
font-weight: bold;
position: relative;
top: 7px;
left: 4px;
}
.ui-dialog .ui-dialog-content {
margin: 1.2em;
}
.ui-dialog .ui-dialog-buttonpane {
background-color: #2179B1;
position: absolute;
bottom: 8px;
right: 12px;
width: 100%;
text-align: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin-bottom: 6px;
}
.ui-dialog .ui-dialog-buttonpane button {
border-bottom-color: #708090;
border-right-color: #708090;
-moz-border-radius: 5%;
font-size: 0.85em;
font-weight: bold;
height: 22px;
}
/* Dialog handle styles */
.ui-dialog .ui-resizable-n, {
cursor: n-resize;
height: 6px;
width: 100%;
top: 0px;
left: 0px;
background: transparent url(images/dialog-n.gif) repeat scroll center top;
}
.ui-dialog .ui-resizable-s {
cursor: s-resize;
height: 8px;
width: 100%;
bottom: 0px;
left: 0px;
background: transparent url(images/dialog-s.gif) repeat scroll center top;
}
.ui-dialog .ui-resizable-e {
cursor: e-resize;
width: 7px;
right: 0px;
top: 0px;
height: 100%;
background: transparent url(images/dialog-e.gif) repeat scroll right center;
}
.ui-dialog .ui-resizable-w {
cursor: w-resize;
width: 7px;
left: 0px;
top: 0px;
height: 100%;
background: transparent url(images/dialog-w.gif) repeat scroll right center;
}
.ui-dialog .ui-resizable-se {
cursor: se-resize;
width: 9px;
height: 9px;
right: 0px;
bottom: 0px;
background: transparent url(images/dialog-se.gif);
}
.ui-dialog .ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: 0px;
bottom: 0px;
background: transparent url(images/dialog-sw.gif);
}
.ui-dialog .ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 29px;
left: 0px;
top: 0px;
background: transparent url(images/dialog-nw.gif);
}
.ui-dialog .ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 29px;
right: 0px;
top: 0px;
background: transparent url(images/dialog-ne.gif);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

View File

@ -910,38 +910,6 @@ a.add_action {
vertical-align: middle;
margin-left: 2px;
}
/* the overlay element */
#overlay {
background-image:url(../../images/transparent.png);
/* dimensions after the growing animation finishes */
width:600px;
height:470px;
/* initially overlay is hidden */
display:none;
/* some padding to layout nested elements nicely */
padding:55px;
overflow:auto;
}
/* default close button positioned on upper right corner */
#overlay div.close {
background-image:url(../../images/close.png);
position:absolute;
right:5px;
top:5px;
cursor:pointer;
height:35px;
width:35px;
}
/* external content */
#overlay div.wrap {
height:441px;
overflow:auto;
}
div#steps_clean {
clear:both;
}

View File

@ -196,10 +196,6 @@ if ($config["pure"] == 0) {
// Main block of content
if ($config["pure"] == 0) {
echo '<div id="main">';
//This is a generic overlay (hidden) which can be filled with jQuery
// To use you have to use <a href="ajax.php?page=operation/page" rel="#overlay">Load overlay</a>
echo '<div class="overlay" id="overlay"><div class="wrap"></div></div>';
require_jquery_file ('overlay');
}
// Check permissions

View File

@ -24,7 +24,7 @@ if (! give_acl ($config['id_user'], 0, "AR")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access agent main list view");
require ("general/noaccess.php");
exit;
return;
}
if (is_ajax ()) {

View File

@ -26,15 +26,22 @@ if (isset($_GET["id_agente"])){
// View last data packet
// Get timestamp of last packet
$sql_t='SELECT * FROM tagente WHERE id_agente = '.$id_agente;
$result_t=mysql_query($sql_t);
$row_t=mysql_fetch_array($result_t);
$timestamp_ref = $row_t["ultimo_contacto_remoto"];
$timestamp_lof = $row_t["ultimo_contacto"];
$intervalo_agente = $row_t["intervalo"];
$agent = get_db_row ('tagente', 'id_agente', $id_agente,
array ('ultimo_contacto_remoto',
'ultimo_contacto',
'intervalo',
'id_grupo'));
$timestamp_ref = $agent["ultimo_contacto_remoto"];
$timestamp_lof = $agent["ultimo_contacto"];
$intervalo_agente = $agent["intervalo"];
// Get last packet
$sql3 = 'SELECT * FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled = 0 AND tagente_modulo.id_agente = ' . $id_agente . ' AND tagente_estado.utimestamp != 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo ORDER BY id_module_group, nombre';
$sql3 = 'SELECT * FROM tagente_modulo, tagente_estado
WHERE tagente_modulo.disabled = 0
AND tagente_modulo.id_agente = ' . $id_agente.
' AND tagente_estado.utimestamp != 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
ORDER BY id_module_group, nombre';
$label_group = 0;
$last_label = "";
@ -44,178 +51,181 @@ echo __('Display of last data modules received by agent');
echo "&nbsp;<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/refresh.png'></A>";
echo "</h2>";
$modules = get_db_all_rows_filter ('tagente_modulo, tagente_estado',
array ('tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo',
'disabled' => 0,
'tagente_estado.utimestamp != 0',
'tagente_modulo.id_agente = '.$id_agente,
'order' => 'id_module_group, nombre'));
$result3=mysql_query($sql3);
if (mysql_num_rows ($result3)) {
echo "<table width='750' cellpadding='3' cellspacing='3' class='databox'>";
echo "<th></th>";
echo "<th>".__('Module name')."</th>";
echo "<th>".__('Type')."</th>";
echo "<th>".__('int')."</th>";
echo "<th>".__('Description')."</th>";
echo "<th>".__('Data')."</th>";
echo "<th>".__('Graph')."</th>";
echo "<th>".__('Raw Data')."</th>";
echo "<th>".__('Timestamp')."</th>";
$texto=''; $last_modulegroup = 0;
$color = 1;
while ($row3=mysql_fetch_array($result3)){
// Calculate table line color
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if ($modules === false) {
echo "<div class='nf'>".__('This agent doesn\'t have any module')."</div>";
return;
}
echo "<table width='95%' cellpadding='3' cellspacing='3' class='databox'>";
echo "<th></th>";
echo "<th>".__('Module name')."</th>";
echo "<th>".__('Type')."</th>";
echo "<th>".__('int')."</th>";
echo "<th>".__('Description')."</th>";
echo "<th>".__('Data')."</th>";
echo "<th>".__('Graph')."</th>";
echo "<th>".__('Raw Data')."</th>";
echo "<th>".__('Timestamp')."</th>";
$texto=''; $last_modulegroup = 0;
$color = 1;
$write = give_acl ($config['id_user'], $agent['id_grupo'], "AW");
foreach ($modules as $module) {
// Calculate table line color
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if ($module["id_module_group"] != $last_modulegroup ){
// Render module group names (fixed code)
$nombre_grupomodulo = get_modulegroup_name ($module["id_module_group"]);
$last_modulegroup = $module["id_module_group"];
echo "<tr><td class='datos3' align='center' colspan='9'>
<b>".$nombre_grupomodulo."</b></td></tr>";
}
if ($row3["id_module_group"] != $last_modulegroup ){
// Render module group names (fixed code)
$nombre_grupomodulo = get_modulegroup_name ($row3["id_module_group"]);
$last_modulegroup = $row3["id_module_group"];
echo "<tr><td class='datos3' align='center' colspan='9'>
<b>".$nombre_grupomodulo."</b></td></tr>";
// Begin to render data ...
echo "<tr><td class='$tdcolor'>";
// Render network exec module button, only when
// Agent Write for this module and group, is given
// Is a network module
// Has flag = 0
if ($write && $module["id_modulo"] > 1 && $module["id_tipo_modulo"] < 100) {
if ($module["flag"] == 0) {
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&id_agente_modulo=".$module["id_agente_modulo"]."&flag=1&tab=data&refr=60'><img src='images/target.png' border='0'></a>";
} else {
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&id_agente_modulo=".$module["id_agente_modulo"]."&tab=data&refr=60'><img src='images/refresh.png' border='0'></a>";
}
// Begin to render data ...
echo "<tr><td class='$tdcolor'>";
// Render network exec module button, only when
// Agent Write for this module and group, is given
// Is a network module
// Has flag = 0
$id_grupo = $row_t["id_grupo"];
if (give_acl ($config['id_user'], $id_grupo, "AW")) {
if (($row3["id_modulo"] > 1) AND ($row3["id_tipo_modulo"] < 100)) {
if ($row3["flag"] == 0){
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&id_agente_modulo=".$row3["id_agente_modulo"]."&flag=1&tab=data&refr=60'><img src='images/target.png' border='0'></a>";
} else {
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&id_agente_modulo=".$row3["id_agente_modulo"]."&tab=data&refr=60'><img src='images/refresh.png' border='0'></a>";
}
}
}
echo "</td>";
$nombre_grupomodulo = get_modulegroup_name ($module["id_module_group"]);
if ($nombre_grupomodulo != ""){
if (($label_group == 0) || ($last_label != $nombre_grupomodulo)){ // Show label module group
$label_group = -1;
$last_label = $nombre_grupomodulo;
$texto = $texto. "
<td class='$tdcolor' align='center' colspan='7'>
<b>".$nombre_grupomodulo."</b></td>";
}
}
$nombre_tipo_modulo = get_moduletype_name ($module["id_tipo_modulo"]);
echo "<td class='".$tdcolor."_id' title='".salida_limpia($module["nombre"])."'>";
print_string_substr ($module["nombre"]);
echo "</td><td class='".$tdcolor."'> ";
print_moduletype_icon ($module["id_tipo_modulo"]);
echo "</td><td class='".$tdcolor."'>";
if ($module["module_interval"] != 0){
echo $module["module_interval"];
$real_interval = $module["module_interval"];
} else {
echo $intervalo_agente;
$real_interval = $intervalo_agente;
}
if (($module["id_tipo_modulo"] != 3)
AND ($module["id_tipo_modulo"] != 10)
AND ($module["id_tipo_modulo"] != 17)
AND ($module["id_tipo_modulo"] != 23)){
echo "</td><td class='".$tdcolor."f9' title='".salida_limpia($module["descripcion"])."'>";
echo salida_limpia(substr($module["descripcion"],0,32));
if (strlen($module["descripcion"]) > 32){
echo "...";
}
echo "</td>";
$nombre_grupomodulo = get_modulegroup_name ($row3["id_module_group"]);
if ($nombre_grupomodulo != ""){
if (($label_group == 0) || ($last_label != $nombre_grupomodulo)){ // Show label module group
$label_group = -1;
$last_label = $nombre_grupomodulo;
$texto = $texto. "
<td class='$tdcolor' align='center' colspan='7'>
<b>".$nombre_grupomodulo."</b></td>";
}
}
if (($module["id_tipo_modulo"] == 100) OR ($module['history_data'] == 0)) {
echo "<td class='".$tdcolor."f9' colspan='2' title='".$module["datos"]."'>";
echo substr(salida_limpia($module["datos"]),0,12);
} else {
// String uses colspan2 and different graphtype
if (($module["id_tipo_modulo"] == 3)
OR ($module["id_tipo_modulo"] == 10)
OR ($module["id_tipo_modulo"] == 17)
OR ($module["id_tipo_modulo"] == 23)){
$graph_type = "string";
echo "<td class='".$tdcolor."f9' colspan=2 title='".salida_limpia($module["datos"])."'>";
}
$nombre_tipo_modulo = get_moduletype_name ($row3["id_tipo_modulo"]);
echo "<td class='".$tdcolor."_id' title='".salida_limpia($row3["nombre"])."'>";
echo salida_limpia(substr($row3["nombre"],0,15));
echo "</td><td class='".$tdcolor."'>";
echo " <img src='images/".show_icon_type($row3["id_tipo_modulo"])."' border=0>";
echo "</td><td class='".$tdcolor."'>";
if ($row3["module_interval"] != 0){
echo $row3["module_interval"];
$real_interval = $row3["module_interval"];
} else {
echo $intervalo_agente;
$real_interval = $intervalo_agente;
elseif (($module["id_tipo_modulo"] == 2)
OR ($module["id_tipo_modulo"] == 6)
OR ($module["id_tipo_modulo"] == 21)
OR ($module["id_tipo_modulo"] == 18)
OR ($module["id_tipo_modulo"] == 9)) {
$graph_type = "boolean";
echo "<td class=".$tdcolor.">";
}
else {
$graph_type = "sparse";
echo "<td class=".$tdcolor.">";
}
if (($row3["id_tipo_modulo"] != 3)
AND ($row3["id_tipo_modulo"] != 10)
AND ($row3["id_tipo_modulo"] != 17)
AND ($row3["id_tipo_modulo"] != 23)){
echo "</td><td class='".$tdcolor."f9' title='".salida_limpia($row3["descripcion"])."'>";
echo salida_limpia(substr($row3["descripcion"],0,32));
if (strlen($row3["descripcion"]) > 32){
echo "...";
}
echo "</td>";
}
if (($row3["id_tipo_modulo"] == 100) OR ($row3['history_data'] == 0)) {
echo "<td class='".$tdcolor."f9' colspan='2' title='".$row3["datos"]."'>";
echo substr(salida_limpia($row3["datos"]),0,12);
} else {
// String uses colspan2 and different graphtype
if (($row3["id_tipo_modulo"] == 3)
OR ($row3["id_tipo_modulo"] == 10)
OR ($row3["id_tipo_modulo"] == 17)
OR ($row3["id_tipo_modulo"] == 23)){
$graph_type = "string";
echo "<td class='".$tdcolor."f9' colspan=2 title='".salida_limpia($row3["datos"])."'>";
}
elseif (($row3["id_tipo_modulo"] == 2)
OR ($row3["id_tipo_modulo"] == 6)
OR ($row3["id_tipo_modulo"] == 21)
OR ($row3["id_tipo_modulo"] == 18)
OR ($row3["id_tipo_modulo"] == 9)) {
$graph_type = "boolean";
echo "<td class=".$tdcolor.">";
}
else {
$graph_type = "sparse";
echo "<td class=".$tdcolor.">";
}
// Kind of data
if (is_numeric($module["datos"])) {
echo format_for_graph($module["datos"] );
} else
echo substr(salida_limpia($module["datos"]),0,42);
$handle = "stat".$nombre_tipo_modulo."_".$module["id_agente_modulo"];
$url = 'reporting/procesos.php?agente='.$module["id_agente_modulo"];
$win_handle=dechex(crc32($module["id_agente_modulo"].$module["nombre"]));
echo "<td class=".$tdcolor." width='78'>";
$graph_label = output_clean_strict ($module["nombre"]);
echo "<a href='javascript:winopeng(\"reporting/stat_win.php?type=$graph_type&period=2419200&id=".$module["id_agente_modulo"]."&label=".$graph_label."refresh=180000\", \"month_".$win_handle."\")'><img src='images/grafica_m.png' border=0></a>&nbsp;";
$link ="winopeng('reporting/stat_win.php?type=$graph_type&period=604800&id=".$module["id_agente_modulo"]."&label=".$graph_label."&refresh=6000','week_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_w.png" border=0></a>&nbsp;';
$link ="winopeng('reporting/stat_win.php?type=$graph_type&period=86400&id=".$module["id_agente_modulo"]."&label=".$graph_label."&refresh=600','day_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_d.png" border=0></a>&nbsp;';
// Kind of data
if (is_numeric($row3["datos"])) {
echo format_for_graph($row3["datos"] );
} else
echo substr(salida_limpia($row3["datos"]),0,42);
$handle = "stat".$nombre_tipo_modulo."_".$row3["id_agente_modulo"];
$url = 'reporting/procesos.php?agente='.$row3["id_agente_modulo"];
$win_handle=dechex(crc32($row3["id_agente_modulo"].$row3["nombre"]));
echo "<td class=".$tdcolor." width='78'>";
$graph_label = output_clean_strict ($row3["nombre"]);
echo "<a href='javascript:winopeng(\"reporting/stat_win.php?type=$graph_type&period=2419200&id=".$row3["id_agente_modulo"]."&label=".$graph_label."refresh=180000\", \"month_".$win_handle."\")'><img src='images/grafica_m.png' border=0></a>&nbsp;";
$link ="winopeng('reporting/stat_win.php?type=$graph_type&period=604800&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=6000','week_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_w.png" border=0></a>&nbsp;';
$link ="winopeng('reporting/stat_win.php?type=$graph_type&period=86400&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=600','day_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_d.png" border=0></a>&nbsp;';
$link ="winopeng('reporting/stat_win.php?type=$graph_type&period=3600&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=60','hour_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_h.png" border=0></a>';
}
if ($row3['history_data'] == 1){
// RAW Table data
echo "<td class=".$tdcolor." width=70>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=2592000&id=".$row3["id_agente_modulo"]."'><img border=0 src='images/data_m.png'></a>&nbsp;&nbsp;";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=604800&id=".$row3["id_agente_modulo"]."'><img border=0 src='images/data_w.png'></a>&nbsp;&nbsp;";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=86400&id=".$row3["id_agente_modulo"]."'><img border=0 src='images/data_d.png'></a>";
} else {
echo "<td class=".$tdcolor."></td>";
}
echo "<td class='".$tdcolor."f9'>";
if ($row3["timestamp"] == "0000-00-00 00:00:00"){
echo __('Never');
} else {
$ahora = get_system_time ();
// Async modules
if (($row3["id_tipo_modulo"] > 20) AND ($row3["id_tipo_modulo"] < 100)){
echo human_time_comparation($row3["timestamp"]);
} else {
if ( ($ahora - $row3["utimestamp"]) > ($real_interval*2)) {
echo "<font color='red'>";
echo human_time_comparation($row3["timestamp"]);
echo "</font>";
} else
echo human_time_comparation($row3["timestamp"]);
}
}
echo "</td></tr>";
$link ="winopeng('reporting/stat_win.php?type=$graph_type&period=3600&id=".$module["id_agente_modulo"]."&label=".$graph_label."&refresh=60','hour_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_h.png" border=0></a>';
}
echo '</table>';
if ($module['history_data'] == 1){
// RAW Table data
echo "<td class=".$tdcolor." width=70>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=2592000&id=".$module["id_agente_modulo"]."'><img border=0 src='images/data_m.png'></a>&nbsp;&nbsp;";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=604800&id=".$module["id_agente_modulo"]."'><img border=0 src='images/data_w.png'></a>&nbsp;&nbsp;";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=86400&id=".$module["id_agente_modulo"]."'><img border=0 src='images/data_d.png'></a>";
} else {
echo "<td class=".$tdcolor."></td>";
}
echo "<td class='".$tdcolor."f9'>";
if ($module["timestamp"] == "0000-00-00 00:00:00"){
echo __('Never');
} else {
$ahora = get_system_time ();
// Async modules
if (($module["id_tipo_modulo"] > 20) AND ($module["id_tipo_modulo"] < 100)){
echo human_time_comparation($module["timestamp"]);
} else {
if ( ($ahora - $module["utimestamp"]) > ($real_interval*2)) {
echo "<font color='red'>";
echo human_time_comparation($module["timestamp"]);
echo "</font>";
} else
echo human_time_comparation($module["timestamp"]);
}
}
echo "</td></tr>";
}
else {
echo "<div class='nf'>".__('This agent doesn\'t have any module')."</div>";
}
echo '</table>';
?>