diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-02 14:30:09 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-02 14:30:09 +0000 |
| commit | 5160f49d9546dc4a33fff23e75b03b5ac13de570 (patch) | |
| tree | 6ca1d0e6dd639e25aa4d5d2bed4cc2bcc0593c8b /frontends/php/include/graphs.inc.php | |
| parent | 674c41240eec523885688bed0a649548ac9b2086 (diff) | |
| download | zabbix-5160f49d9546dc4a33fff23e75b03b5ac13de570.tar.gz zabbix-5160f49d9546dc4a33fff23e75b03b5ac13de570.tar.xz zabbix-5160f49d9546dc4a33fff23e75b03b5ac13de570.zip | |
- added deletion from favorites on deleting items,graphs,screens,maps.. (Artem)
- changes resources for favorites (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5579 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/graphs.inc.php')
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index 554887ae..265d3614 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -301,13 +301,11 @@ return $result; } - function get_graph_by_graphid($graphid) - { + function get_graph_by_graphid($graphid){ $result=DBselect("SELECT * FROM graphs WHERE graphid=$graphid"); $row=DBfetch($result); - if($row) - { + if($row){ return $row; } error("No graph with graphid=[$graphid]"); @@ -626,14 +624,12 @@ * Comments: !!! Don't forget sync code with C !!! * */ - function delete_graph($graphid) - { + function delete_graph($graphid){ $graph = get_graph_by_graphid($graphid); $host_list = array(); $db_hosts = get_hosts_by_graphid($graphid); - while($db_host = DBfetch($db_hosts)) - { + while($db_host = DBfetch($db_hosts)){ $host_list[] = '"'.$db_host['host'].'"'; } @@ -648,13 +644,15 @@ DBexecute('delete from screens_items where resourceid='.$graphid.' and resourcetype='.SCREEN_RESOURCE_GRAPH); /* delete graph */ - if ( ($result = DBexecute('DELETE FROM graphs_items WHERE graphid='.$graphid)) ) - if ( ($result = DBexecute('DELETE FROM graphs WHERE graphid='.$graphid)) ) - { + $result = DBexecute('DELETE FROM graphs_items WHERE graphid='.$graphid); + $result &= DBexecute('DELETE FROM graphs WHERE graphid='.$graphid); + $result &= rm4favorites('web.favorite.graphids',$graphid,ZBX_FAVORITES_ALL,'graphid'); + + if($result){ info('Graph "'.$graph['name'].'" deleted from hosts '.implode(',',$host_list)); } - return $result; + return $result; } /* |
