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/graph.php | 61 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 16 deletions(-) (limited to 'frontends/php/graph.php') diff --git a/frontends/php/graph.php b/frontends/php/graph.php index e31bdb0c..3b80876c 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -27,6 +27,11 @@ $result=add_item_to_graph($HTTP_GET_VARS["graphid"],$HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["color"],$HTTP_GET_VARS["drawtype"]); show_messages($result,"Item added","Cannot add item"); } + if($HTTP_GET_VARS["register"]=="update") + { + $result=update_graph_item($HTTP_GET_VARS["gitemid"],$HTTP_GET_VARS["itemid"],$HTTP_GET_VARS["color"],$HTTP_GET_VARS["drawtype"]); + show_messages($result,"Item updated","Cannot update item"); + } if($HTTP_GET_VARS["register"]=="delete") { $result=delete_graphs_item($HTTP_GET_VARS["gitemid"]); @@ -69,7 +74,11 @@ echo "".$row["description"].""; echo "".get_drawtype_description($row["drawtype"]).""; echo "".$row["color"].""; - echo "Delete"; + echo ""; + echo "Change"; + echo " - "; + echo "Delete"; + echo ""; echo ""; } echo ""; @@ -79,6 +88,15 @@ echo "
"; echo ""; + if(isset($HTTP_GET_VARS["gitemid"])) + { + $sql="select itemid,color,drawtype from graphs_items where gitemid=".$HTTP_GET_VARS["gitemid"]; + $result=DBselect($sql); + $itemid=DBget_field($result,0,0); + $color=DBget_field($result,0,1); + $drawtype=DBget_field($result,0,2); + } + show_table2_header_begin(); echo "New item for graph"; @@ -99,7 +117,14 @@ $host_=DBget_field($result,$i,0); $description_=DBget_field($result,$i,1); $itemid_=DBget_field($result,$i,2); - echo "