diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-03 10:46:04 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-03 10:46:04 +0000 |
commit | 7d149aa95e95bd330eddf3b89b4d12a247eaea93 (patch) | |
tree | 0c2514937f4ee0957ddcdf74caab5493f1edc716 /frontends/php/latest.php | |
parent | 9e13643b3cfdaf32f457e6325d24bcd8094f0ffb (diff) | |
download | zabbix-7d149aa95e95bd330eddf3b89b4d12a247eaea93.tar.gz zabbix-7d149aa95e95bd330eddf3b89b4d12a247eaea93.tar.xz zabbix-7d149aa95e95bd330eddf3b89b4d12a247eaea93.zip |
- merged rev. 4508:4509 of branches/1.4.2 (Eugene) [- improved item and trigger filtering]
git-svn-id: svn://svn.zabbix.com/trunk@4510 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/latest.php')
-rw-r--r-- | frontends/php/latest.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/frontends/php/latest.php b/frontends/php/latest.php index c7745bbc..e63206ed 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -170,11 +170,6 @@ include_once "include/page_header.php"; S_LAST_CHECK,S_LAST_VALUE,S_CHANGE,S_HISTORY)); $table->ShowStart(); - if($_REQUEST["select"] != "") - $compare_description = " and i.description like ".zbx_dbstr("%".$_REQUEST["select"]."%"); - else - $compare_description = ""; - if($_REQUEST["hostid"] > 0) $compare_host = " and h.hostid=".$_REQUEST["hostid"]; else @@ -189,13 +184,17 @@ include_once "include/page_header.php"; { $db_items = DBselect("select distinct i.* from items i,items_applications ia". " where ia.applicationid=".$db_app["applicationid"]." and i.itemid=ia.itemid". - " and i.status=".ITEM_STATUS_ACTIVE.$compare_description. - " order by i.description"); + " and i.status=".ITEM_STATUS_ACTIVE. + " order by i.description, i.itemid"); $app_rows = array(); $item_cnt = 0; while($db_item = DBfetch($db_items)) { + $description = item_description($db_item["description"],$db_item["key_"]); + + if( '' != $_REQUEST["select"] && !stristr($description, $_REQUEST["select"]) ) continue; + ++$item_cnt; if(!in_array($db_app["applicationid"],$_REQUEST["applications"]) && !isset($show_all_apps)) continue; @@ -234,7 +233,7 @@ include_once "include/page_header.php"; array_push($app_rows, new CRow(array( $_REQUEST["hostid"] > 0 ? NULL : SPACE, - str_repeat(SPACE,6).item_description($db_item["description"],$db_item["key_"]), + str_repeat(SPACE,6).$description, $lastclock, new CCol($lastvalue, $lastvalue=='-' ? 'center' : null), $change, @@ -268,12 +267,16 @@ include_once "include/page_header.php"; } $db_items = DBselect("select h.host,h.hostid,i.* from hosts h, items i LEFT JOIN items_applications ia ON ia.itemid=i.itemid". " where ia.itemid is NULL and h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=".ITEM_STATUS_ACTIVE. - $compare_description.$compare_host.' and h.hostid in ('.$availiable_hosts.") order by i.description,h.host"); + $compare_host.' and h.hostid in ('.$availiable_hosts.") order by i.description,h.host,i.itemid"); $app_rows = array(); $item_cnt = 0; while($db_item = DBfetch($db_items)) { + $description = item_description($db_item["description"],$db_item["key_"]); + + if( '' != $_REQUEST["select"] && !stristr($description, $_REQUEST["select"]) ) continue; + ++$item_cnt; if(!in_array(0,$_REQUEST["applications"]) && $any_app_exist && !isset($show_all_apps)) continue; @@ -314,7 +317,7 @@ include_once "include/page_header.php"; array_push($app_rows, new CRow(array( $_REQUEST["hostid"] > 0 ? NULL : $db_item["host"], - str_repeat(SPACE, ($any_app_exist ? 6 : 0)).item_description($db_item["description"],$db_item["key_"]), + str_repeat(SPACE, ($any_app_exist ? 6 : 0)).$description, $lastclock, new CCol($lastvalue, $lastvalue == '-' ? 'center' : null), $change, |