diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-16 10:06:44 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-16 10:06:44 +0000 |
| commit | 96fbc177dee3d7275d3b4b7ec0f39ee228616bac (patch) | |
| tree | 1a2e9d116f16d946d899a3caef70bc48ec1a7c81 /frontends/php | |
| parent | 53538e4a4fb3b59a0e52555f19627f932b9c66f0 (diff) | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@2324 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/chart2.php | 3 | ||||
| -rw-r--r-- | frontends/php/graph.php | 16 | ||||
| -rw-r--r-- | frontends/php/include/classes.inc.php | 2 | ||||
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 12 | ||||
| -rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 2 |
5 files changed, 24 insertions, 11 deletions
diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index 6c1b5c5e..7e7a62df 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -67,13 +67,14 @@ $graph->setYAxisMin(DBget_field($result,0,4)); $graph->setYAxisMax(DBget_field($result,0,5)); - $result=DBselect("select gi.itemid,i.description,gi.color,h.host,gi.drawtype from graphs_items gi,items i,hosts h where gi.itemid=i.itemid and gi.graphid=".$_REQUEST["graphid"]." and i.hostid=h.hostid order by gi.sortorder"); + $result=DBselect("select gi.itemid,i.description,gi.color,h.host,gi.drawtype,gi.yaxisside from graphs_items gi,items i,hosts h where gi.itemid=i.itemid and gi.graphid=".$_REQUEST["graphid"]." and i.hostid=h.hostid order by gi.sortorder"); for($i=0;$i<DBnum_rows($result);$i++) { $graph->addItem(DBget_field($result,$i,0)); $graph->setColor(DBget_field($result,$i,0), DBget_field($result,$i,2)); $graph->setDrawtype(DBget_field($result,$i,0), DBget_field($result,$i,4)); + $graph->setYAxisSide(DBget_field($result,$i,0), DBget_field($result,$i,5)); } $graph->Draw(); diff --git a/frontends/php/graph.php b/frontends/php/graph.php index a86caa01..4aa803ac 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -45,7 +45,7 @@ { if($_REQUEST["register"]=="add") { - $gitemid=add_item_to_graph($_REQUEST["graphid"],$_REQUEST["itemid"],$_REQUEST["color"],$_REQUEST["drawtype"],$_REQUEST["sortorder"]); + $gitemid=add_item_to_graph($_REQUEST["graphid"],$_REQUEST["itemid"],$_REQUEST["color"],$_REQUEST["drawtype"],$_REQUEST["sortorder"],$_REQUEST["yaxisside"]); if($gitemid) { add_graph_item_to_linked_hosts($gitemid); @@ -57,7 +57,7 @@ } if($_REQUEST["register"]=="update") { - $result=update_graph_item($_REQUEST["gitemid"],$_REQUEST["itemid"],$_REQUEST["color"],$_REQUEST["drawtype"],$_REQUEST["sortorder"]); + $result=update_graph_item($_REQUEST["gitemid"],$_REQUEST["itemid"],$_REQUEST["color"],$_REQUEST["drawtype"],$_REQUEST["sortorder"],$_REQUEST["yaxisside"]); if($result) { $graphitem=get_graphitem_by_gitemid($_REQUEST["gitemid"]); @@ -151,16 +151,18 @@ if(isset($_REQUEST["gitemid"])) { - $sql="select itemid,color,drawtype,sortorder from graphs_items where gitemid=".$_REQUEST["gitemid"]; + $sql="select itemid,color,drawtype,sortorder,yaxisside from graphs_items where gitemid=".$_REQUEST["gitemid"]; $result=DBselect($sql); $itemid=DBget_field($result,0,0); $color=DBget_field($result,0,1); $drawtype=DBget_field($result,0,2); $sortorder=DBget_field($result,0,3); + $yaxisside=DBget_field($result,0,4); } else { $sortorder=0; + $yaxisside=1; } show_form_begin("graph.item"); @@ -205,6 +207,14 @@ echo "</SELECT>"; show_table2_v_delimiter(); + echo S_YAXIS_SIDE; + show_table2_h_delimiter(); + echo "<SELECT class=\"biginput\" NAME=\"yaxisside\" size=\"1\"\">"; + echo "<OPTION VALUE=\"1\" "; if($yaxisside==GRAPH_YAXIS_SIDE_RIGHT) echo "SELECTED"; echo ">".S_RIGHT; + echo "<OPTION VALUE=\"0\" "; if($yaxisside==GRAPH_YAXIS_SIDE_LEFT) echo "SELECTED"; echo ">".S_LEFT; + echo "</SELECT>"; + + show_table2_v_delimiter(); echo S_COLOR; show_table2_h_delimiter(); echo "<select name=\"color\" size=1>"; diff --git a/frontends/php/include/classes.inc.php b/frontends/php/include/classes.inc.php index 5fa2ac9c..e13404b6 100644 --- a/frontends/php/include/classes.inc.php +++ b/frontends/php/include/classes.inc.php @@ -155,7 +155,7 @@ $this->items[$this->itemids[$itemid]]["drawtype"]=$drawtype; } - function setAxisSide($itemid,$axisside) + function setYAxisSide($itemid,$axisside) { $this->items[$this->itemids[$itemid]]["axisside"]=$axisside; if($axisside == GRAPH_YAXIS_SIDE_LEFT) diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index c72302e4..f2d44c2a 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -34,15 +34,15 @@ return DBinsert_id($result,"graphs","graphid"); } - function update_graph_item($gitemid,$itemid,$color,$drawtype,$sortorder) + function update_graph_item($gitemid,$itemid,$color,$drawtype,$sortorder,$yaxisside) { - $sql="update graphs_items set itemid=$itemid,color='$color',drawtype=$drawtype,sortorder=$sortorder where gitemid=$gitemid"; + $sql="update graphs_items set itemid=$itemid,color='$color',drawtype=$drawtype,sortorder=$sortorder,yaxisside=$yaxisside where gitemid=$gitemid"; return DBexecute($sql); } - function add_item_to_graph($graphid,$itemid,$color,$drawtype,$sortorder) + function add_item_to_graph($graphid,$itemid,$color,$drawtype,$sortorder,$yaxisside) { - $sql="insert into graphs_items (graphid,itemid,color,drawtype,sortorder) values ($graphid,$itemid,'$color',$drawtype,$sortorder)"; + $sql="insert into graphs_items (graphid,itemid,color,drawtype,sortorder) values ($graphid,$itemid,'$color',$drawtype,$sortorder,$yaxisside)"; $result=DBexecute($sql); return DBinsert_id($result,"graphs_items","gitemid"); } @@ -146,14 +146,14 @@ $host=get_host_by_hostid($row["hostid"]); while($row2=DBfetch($result2)) { - add_item_to_graph($row2["graphid"],$itemid,$graph_item["color"],$graph_item["drawtype"],$graph_item["sortorder"]); + add_item_to_graph($row2["graphid"],$itemid,$graph_item["color"],$graph_item["drawtype"],$graph_item["sortorder"],$graph_item["taxisside"]); info("Added graph element to graph ".$graph["name"]." of linked host ".$host["host"]); } if(DBnum_rows($result2)==0) { $graphid=add_graph($graph["name"],$graph["width"],$graph["height"],$graph["yaxistype"],$graph["yaxismin"],$graph["yaxismax"]); info("Added graph ".$graph["name"]." of linked host ".$host["host"]); - add_item_to_graph($graphid,$itemid,$graph_item["color"],$graph_item["drawtype"],$graph_item["sortorder"]); + add_item_to_graph($graphid,$itemid,$graph_item["color"],$graph_item["drawtype"],$graph_item["sortorder"],$graph_item["yaxisside"]); info("Added graph element to graph ".$graph["name"]." of linked host ".$host["host"]); } } diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index d8cb5ccd..940354b3 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -259,6 +259,8 @@ "S_DOWN"=> "Down", "S_NEW_ITEM_FOR_THE_GRAPH"=> "New item for the graph", "S_SORT_ORDER_1_100"=> "Sort order (0->100)", + "S_YAXIS_SIDE"=> "Y axis side", + "S_LEFT"=> "Left", // graphs.php "S_CONFIGURATION_OF_GRAPHS"=> "Configuration of graphs", |
