summaryrefslogtreecommitdiffstats
path: root/frontends/php/popup.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-07 09:42:00 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-07 09:42:00 +0000
commitdc18c3c54aa5bd3d198b6ab480b6d42c4731df18 (patch)
treed307e0e8a516fdc94ad9f910f9d875e814d70358 /frontends/php/popup.php
parent3766bb922ed8071a08c4d80c6754b41ad9155e47 (diff)
downloadzabbix-dc18c3c54aa5bd3d198b6ab480b6d42c4731df18.tar.gz
zabbix-dc18c3c54aa5bd3d198b6ab480b6d42c4731df18.tar.xz
zabbix-dc18c3c54aa5bd3d198b6ab480b6d42c4731df18.zip
- [DEV-137] fixes to popup screen, charts refresh and few SQL's (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5679 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/popup.php')
-rw-r--r--frontends/php/popup.php33
1 files changed, 19 insertions, 14 deletions
diff --git a/frontends/php/popup.php b/frontends/php/popup.php
index b3585c8e..154f34b7 100644
--- a/frontends/php/popup.php
+++ b/frontends/php/popup.php
@@ -931,30 +931,34 @@ include_once "include/page_header.php";
}
$table->Show();
}
- else if($srctbl == "graphs")
- {
+ else if($srctbl == "graphs"){
+
$table = new CTableInfo(S_NO_GRAPHS_DEFINED);
- $table->SetHeader(array(S_NAME,S_GRAPH_TYPE));
+ $table->SetHeader(array(
+ isset($hostid)?null:S_HOST,
+ S_NAME,
+ S_GRAPH_TYPE
+ ));
- $available_graphs = get_accessible_graphs(PERM_READ_LIST, null, get_current_nodeid());
+ $available_graphs = get_accessible_graphs(PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid());
- $sql = 'SELECT DISTINCT g.graphid,g.name,g.graphtype,n.name as node_name, h.host'.
- ' FROM graphs g '.
- ' LEFT JOIN graphs_items gi ON g.graphid=gi.graphid '.
- ' LEFT JOIN items i ON gi.itemid=i.itemid '.
- ' LEFT JOIN hosts h ON h.hostid=i.hostid '.
- ' LEFT JOIN nodes n ON n.nodeid='.DBid2nodeid('g.graphid').
- ' WHERE '.DBcondition('g.graphid',$available_graphs).
- ' AND '.DBin_node('g.graphid', $nodeid);
+ $sql = 'SELECT DISTINCT g.graphid,g.name,g.graphtype,h.host '.
+ ' FROM graphs g,graphs_items gi,items i,hosts h '.
+ ' WHERE gi.graphid=g.graphid '.
+ ' AND i.itemid=gi.itemid '.
+ ' AND h.hostid=i.hostid '.
+ ' AND h.status='.HOST_STATUS_MONITORED.
+ ' AND '.DBin_node('g.graphid').
+ ' AND '.DBcondition('g.graphid',$available_graphs);
if(isset($hostid))
$sql .= ' AND h.hostid='.$hostid;
- $sql .= ' ORDER BY node_name,host,name,graphid';
+ $sql .= ' ORDER BY h.host,g.name';
$result=DBselect($sql);
while($row=DBfetch($result)){
- $row['node_name'] = isset($row['node_name']) ? '('.$row['node_name'].') ' : '';
+ $row['node_name'] = get_node_name_by_elid($row['graphid']);
$name = $row['node_name'].$row['host'].':'.$row['name'];
$description = new CLink($row['name'],'#','action');
@@ -986,6 +990,7 @@ include_once "include/page_header.php";
}
$table->AddRow(array(
+ isset($hostid)?null:$row['host'],
$description,
$graphtype
));