From 2c88dcbac3de23650e7fccaa91f003e9ae54550d Mon Sep 17 00:00:00 2001 From: hugetoad Date: Tue, 3 Jul 2001 06:07:26 +0000 Subject: Patches for alpha6->alpha7. Fixed bug with lost status of trigger. git-svn-id: svn://svn.zabbix.com/trunk@122 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/config.inc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'frontends/php/include') diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index a470d1aa..f30444fb 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -1300,6 +1300,7 @@ echo("
"); + echo "
"; // Start of <<< WEEK >>> $tmp=$from+12*14; echo("["); @@ -1366,8 +1367,7 @@ { echo("[Week forward]"); } - - echo("\n"); + echo "
"; } # Show history @@ -1786,16 +1786,15 @@ function calculate_availability($triggerid) { - $result=DBselect("select min(clock),max(clock) from history"); - $ret["history_min_clock"]=DBget_field($result,0,0); - $ret["history_max_clock"]=DBget_field($result,0,1); + $result=DBselect("select min(clock),max(clock) from alarms where triggerid=$triggerid"); + $max=DBget_field($result,0,0); + $min=DBget_field($result,0,1); - $result=DBselect("select min(clock),max(clock) from alarms"); - $ret["alarms_min_clock"]=DBget_field($result,0,0); - $ret["alarms_max_clock"]=DBget_field($result,0,1); - - $min=min($ret["history_min_clock"],$ret["alarms_min_clock"]); - $max=max($ret["history_max_clock"],$ret["alarms_max_clock"]); + if($max=="") + { + $max=time(); + $min=time()-24*3600; + } $sql="select clock,istrue from alarms where triggerid=$triggerid and clock>=$min and clock<=$max"; $result=DBselect($sql); @@ -1804,7 +1803,7 @@ $state=-1; $true_time=0; $false_time=0; - $time=$ret["history_min_clock"]; + $time=$min; $max=time(); for($i=0;$i