From ec55273c758e96dcf8219df76afb2daa0b2b3f61 Mon Sep 17 00:00:00 2001 From: osmiy Date: Mon, 2 Apr 2007 13:15:05 +0000 Subject: - fixed remembering of previous charts viewed (Eugene) - fixed color validation (Eugene) - fixed template graphs editing (Eugene) - fixed trigger overview status (Eugene) [THANKS TO: 'ZP Gu' for detailed bug report] git-svn-id: svn://svn.zabbix.com/trunk@3966 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/graphs.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'frontends/php/include/graphs.inc.php') diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index 76855f29..9497af5c 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -204,7 +204,8 @@ { if($g_graph['graphtype'] != $graphtype && $graphtype == GRAPH_TYPE_STACKED) { - $result = DBexecute("update graphs_items set calc_fnc=".CALC_FNC_AVG.",drawtype=1,type=".GRAPH_ITEM_SIMPLE); + $result = DBexecute('update graphs_items set calc_fnc='.CALC_FNC_AVG.',drawtype=1,type='.GRAPH_ITEM_SIMPLE. + ' where graphid='.$graphid); } info("Graph '".$g_graph["name"]."' updated"); @@ -217,10 +218,14 @@ $result = update_graph($graphid,$name,$width,$height,$yaxistype,$yaxismin,$yaxismax,$showworkperiod, $showtriggers,$graphtype,$templateid); - if($result) $result = DBexecute("delete from graphs_items where graphid=$graphid"); - if($result) { + $db_graphs_items = DBselect('select gitemid from graphs_items where graphid='.$graphid); + while($gitem_data = DBfetch($db_graphs_items)) + { + delete_graph_item($gitem_data['gitemid']); + } + foreach($items as $gitem) { if(!add_item_to_graph( -- cgit