summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-11 15:12:31 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-11 15:12:31 +0000
commitc5d0cb04c085a0ea496ab12e346924662f190ac5 (patch)
treec56951b7c40f9161f07c899a283d7ba3d1f11942 /frontends/php/include
parent2e5dbab4c69ad5de57b0e53fd529c194a53a58a2 (diff)
- [ZBX-203] fixing issue with "Availability Report" (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5158 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/reports.inc.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/frontends/php/include/reports.inc.php b/frontends/php/include/reports.inc.php
index 2a3d1a6f..2e82fcb0 100644
--- a/frontends/php/include/reports.inc.php
+++ b/frontends/php/include/reports.inc.php
@@ -107,38 +107,36 @@ function show_report2_header($config,$available_hosts){
if(0 == $config){
$r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts));
+ show_table_header(S_AVAILABILITY_REPORT_BIG, $r_form);
}
else{
$r_form->AddItem(array(SPACE.S_TEMPLATE.SPACE,$cmbTpls));
- if($_REQUEST['hostid'] > 0){
+ if($_REQUEST['hostid'] > 0){
$sql = 'SELECT DISTINCT t.triggerid,t.description '.
- ' FROM triggers t,hosts h,items i,functions f,hosts_templates ht '.
+ ' FROM triggers t,hosts h,items i,functions f '.
' WHERE f.itemid=i.itemid '.
' AND h.hostid=i.hostid '.
- ' AND h.hostid=ht.hostid '.
' AND t.status='.TRIGGER_STATUS_ENABLED.
' AND t.triggerid=f.triggerid '.
- ' AND ht.templateid='.$_REQUEST['hostid'].
- ' AND h.status='.HOST_STATUS_MONITORED.
+ ' AND h.hostid='.$_REQUEST['hostid'].
+ ' AND h.status='.HOST_STATUS_TEMPLATE.
' AND '.DBin_node('t.triggerid').
' AND i.status='.ITEM_STATUS_ACTIVE.
' ORDER BY t.description';
}
else{
$sql = 'SELECT DISTINCT t.triggerid,t.description '.
- ' FROM triggers t,hosts h,items i,functions f,hosts_templates ht '.
+ ' FROM triggers t,hosts h,items i,functions f '.
' WHERE f.itemid=i.itemid '.
' AND h.hostid=i.hostid '.
- ' AND h.hostid=ht.hostid '.
' AND t.status='.TRIGGER_STATUS_ENABLED.
' AND t.triggerid=f.triggerid '.
- ' AND h.status='.HOST_STATUS_MONITORED.
+ ' AND h.status='.HOST_STATUS_TEMPLATE.
' AND h.hostid in ('.$available_hosts.')'.
' AND '.DBin_node('t.triggerid').
' AND i.status='.ITEM_STATUS_ACTIVE.
' ORDER BY t.description';
}
-
$result=DBselect($sql);
while($row=DBfetch($result)){
@@ -147,9 +145,15 @@ function show_report2_header($config,$available_hosts){
get_node_name_by_elid($row['triggerid']).expand_trigger_description($row['triggerid'])
);
}
-
- $r_form->AddItem(array(BR.S_TRIGGER.SPACE,$cmbTrigs));
+ $rr_form = new CForm();
+ $rr_form->SetMethod('get');
+ $rr_form->AddVar('config',$config);
+ $rr_form->AddVar('groupid',$_REQUEST['groupid']);
+ $rr_form->AddVar('hostid',$_REQUEST['hostid']);
+
+ $rr_form->AddItem(array(S_TRIGGER.SPACE,$cmbTrigs));
+ show_table_header(S_AVAILABILITY_REPORT_BIG, array($r_form,$rr_form));
}
- show_table_header(S_AVAILABILITY_REPORT_BIG, $r_form);
+
}
?> \ No newline at end of file