diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-15 10:08:51 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-15 10:08:51 +0000 |
| commit | 7af07ac3e1c9c6c2a9fa97cb2cd3c92080752430 (patch) | |
| tree | 59bccc0c112d42c3a9e9bd07709e8f78e2625950 /frontends/php/items.php | |
| parent | dc613c5587703836d1d0b4767e95a7d1b294b528 (diff) | |
| download | zabbix-7af07ac3e1c9c6c2a9fa97cb2cd3c92080752430.tar.gz zabbix-7af07ac3e1c9c6c2a9fa97cb2cd3c92080752430.tar.xz zabbix-7af07ac3e1c9c6c2a9fa97cb2cd3c92080752430.zip | |
- [DEV-142] improvements in transactions for DB actions (beta) (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5622 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/items.php')
| -rw-r--r-- | frontends/php/items.php | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php index 8023efa5..730cc7dc 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -646,8 +646,7 @@ include_once "include/page_header.php"; $show_applications = 0; $show_host = 1; } - else - { + else{ $form->AddItem(array('[', new CLink($showdisabled ? S_HIDE_DISABLED_ITEMS : S_SHOW_DISABLED_ITEMS, @@ -660,27 +659,29 @@ include_once "include/page_header.php"; $result=DBselect("select distinct g.groupid,g.name from groups g,hosts_groups hg". " where g.groupid=hg.groupid and hg.hostid in (".$accessible_hosts.") ". " order by name"); - while($row=DBfetch($result)) - { + while($row=DBfetch($result)){ $cmbGroup->AddItem($row["groupid"],$row["name"]); } $form->AddItem(S_GROUP.SPACE); $form->AddItem($cmbGroup); - if(isset($_REQUEST["groupid"]) && $_REQUEST["groupid"]>0) - { - $sql='select distinct h.hostid,h.host from hosts h,hosts_groups hg'. - ' where hg.groupid='.$_REQUEST['groupid'].' and hg.hostid=h.hostid '. - ' and h.status in ('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.','.HOST_STATUS_TEMPLATE.')'. - ' and h.hostid in ('.$accessible_hosts.') '. - ' group by h.hostid,h.host order by h.host'; - } - else - { - $sql='select distinct h.hostid,h.host from hosts h'. + if(isset($_REQUEST["groupid"]) && $_REQUEST["groupid"]>0){ + $sql='select distinct h.hostid,h.host '. + ' from hosts h,hosts_groups hg'. + ' where hg.groupid='.$_REQUEST['groupid']. + ' and hg.hostid=h.hostid '. + ' and h.status in ('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.','.HOST_STATUS_TEMPLATE.')'. + ' and h.hostid in ('.$accessible_hosts.') '. + ' group by h.hostid,h.host '. + ' order by h.host'; + } + else{ + $sql='select distinct h.hostid,h.host '. + ' from hosts h'. ' where h.status in ('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.','.HOST_STATUS_TEMPLATE.')'. - ' and h.hostid in ('.$accessible_hosts.') '. - ' group by h.hostid,h.host order by h.host'; + ' and h.hostid in ('.$accessible_hosts.') '. + ' group by h.hostid,h.host '. + ' order by h.host'; } $result=DBselect($sql); @@ -690,8 +691,7 @@ include_once "include/page_header.php"; unset($correct_hostid); $first_hostid = -1; - while($row=DBfetch($result)) - { + while($row=DBfetch($result)){ $cmbHosts->AddItem($row["hostid"],$row["host"]); if($_REQUEST["hostid"]!=0){ @@ -710,8 +710,7 @@ include_once "include/page_header.php"; $form->AddItem(SPACE); $form->AddItem(new CButton("external_filter",S_EXTERNAL_FILTER)); - if($host_info = DBfetch(DBselect('select host from hosts where hostid='.$_REQUEST["hostid"]))) - { + if($host_info = DBfetch(DBselect('select host from hosts where hostid='.$_REQUEST["hostid"]))){ $form->AddVar('with_host', $host_info['host']); } $where_case[] = 'i.hostid='.$_REQUEST['hostid']; @@ -780,12 +779,10 @@ include_once "include/page_header.php"; "&group_task=".($db_item["status"] ? "Activate+selected" : "Disable+selected"), item_status2style($db_item["status"]))); - if($db_item["error"] == '') - { + if($db_item["error"] == ''){ $error=new CCol('-',"off"); } - else - { + else{ $error=new CCol($db_item["error"],"on"); } |
