From edb44e0293222987bcbaf6409c021c767c6faeec Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 20 Jul 2003 18:15:21 +0000 Subject: - support for changing of graph items (Alexei) - menu will not require more than three lines (Alexei) - fixed dividion by zero in chart2.php (Alexei) - period and start of interval are preserved in full-screen mode (Alexei) - added units in graph legends (Alexei) - table-like legend for user graphs (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@853 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/config.inc.php | 56 +++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 17 deletions(-) (limited to 'frontends/php/include') diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 3d52da01..27258313 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -573,6 +573,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo "
"; // echo ""; + echo ""; if($ERROR_MSG=="") { echo "[$msg]"; @@ -581,7 +582,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; { echo "[$msg. $ERROR_MSG]"; } -// echo ""; + echo ""; echo "

"; } @@ -901,11 +902,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; if( ($page["file"]=="latest.php") || ($page["file"]=="history.php")) { - echo "[LATEST VALUES]"; + echo "[LATEST VALUES]"; } else { - echo "LATEST VALUES"; + echo "LATEST VALUES"; } ?> @@ -988,11 +989,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; [NETWORK MAPS]"; + echo "[NETWORK MAPS]"; } else { - echo "NETWORK MAPS"; + echo "NETWORK MAPS"; } ?> @@ -1041,11 +1042,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } if($page["file"]=="srv_status.php") { - echo "[IT SERVICES]"; + echo "[IT SERVICES]"; } else { - echo "IT SERVICES"; + echo "IT SERVICES"; } ?> @@ -1093,11 +1094,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; [STATUS OF ZABBIX]"; + echo "[STATUS OF ZABBIX]"; } else { - echo "STATUS OF ZABBIX"; + echo "STATUS OF ZABBIX"; } ?> @@ -1111,11 +1112,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; [AVAILABILITY REPORT]"; + echo "[AVAILABILITY REPORT]"; } else { - echo "AVAILABILITY REPORT"; + echo "AVAILABILITY REPORT"; } ?> @@ -1231,11 +1232,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; if( ($page["file"]=="sysmaps.php")|| ($page["file"]=="sysmap.php")) { - echo "[NETWORK MAPS]"; + echo "[NETWORK MAPS]"; } else { - echo "NETWORK MAPS"; + echo "NETWORK MAPS"; } ?> @@ -1282,11 +1283,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } if($page["file"]=="services.php") { - echo "[IT SERVICES]"; + echo "[IT SERVICES]"; } else { - echo "IT SERVICES"; + echo "IT SERVICES"; } ?> @@ -1805,13 +1806,19 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function add_service_link($servicedownid,$serviceupid,$softlink) { -// global $ERROR_MSG; + global $ERROR_MSG; if( ($softlink==0) && (is_service_hardlinked($servicedownid)==TRUE) ) { return FALSE; } + if($servicedownid==$serviceupid) + { + $ERROR_MSG="Cannot link service to itself."; + return FALSE; + } + $sql="insert into services_links (servicedownid,serviceupid,soft) values ($servicedownid,$serviceupid,$softlink)"; return DBexecute($sql); } @@ -2326,6 +2333,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return DBexecute($sql); } + function update_graph_item($gitemid,$itemid,$color,$drawtype) + { + $sql="update graphs_items set itemid=$itemid,color='$color',drawtype=$drawtype where gitemid=$gitemid"; + return DBexecute($sql); + } + function add_item_to_graph($graphid,$itemid,$color,$drawtype) { $sql="insert into graphs_items (graphid,itemid,color,drawtype) values ($graphid,$itemid,'$color',$drawtype)"; @@ -4220,18 +4233,28 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; { return $result; } + $sql="delete from screens_graphs where screenid=$screenid"; + $result=DBexecute($sql); + if(!$result) + { + return $result; + } $sql="delete from screens where screenid=$screenid"; return DBexecute($sql); } function add_screen_item($screenid,$x,$y,$graphid,$width,$height) { + $sql="delete from screens_items where screenid=$screenid and x=$x and y=$y"; + DBexecute($sql); $sql="insert into screens_items (screenid,x,y,graphid,width,height) values ($screenid,$x,$y,$graphid,$width,$height)"; return DBexecute($sql); } function add_screen_graph($screenid,$x,$y,$itemid,$width,$height) { + $sql="delete from screens_graphs where screenid=$screenid and x=$x and y=$y"; + DBexecute($sql); $sql="insert into screens_graphs (screenid,x,y,itemid,width,height) values ($screenid,$x,$y,$itemid,$width,$height)"; return DBexecute($sql); } @@ -4248,7 +4271,6 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return DBexecute($sql); } - function get_drawtype_description($drawtype) { if($drawtype==0) -- cgit