summaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-03 10:46:04 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-03 10:46:04 +0000
commit7d149aa95e95bd330eddf3b89b4d12a247eaea93 (patch)
tree0c2514937f4ee0957ddcdf74caab5493f1edc716 /frontends
parent9e13643b3cfdaf32f457e6325d24bcd8094f0ffb (diff)
downloadzabbix-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')
-rw-r--r--frontends/php/items.php8
-rw-r--r--frontends/php/latest.php23
-rw-r--r--frontends/php/tr_status.php14
3 files changed, 20 insertions, 25 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php
index 030c38a7..f03db801 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -576,10 +576,6 @@ include_once "include/page_header.php";
$where_case[] = 'ia.applicationid=a.applicationid';
$where_case[] = 'a.name like '.zbx_dbstr('%'.$_REQUEST['with_application'].'%');
}
- if(isset($_REQUEST['with_description']))
- {
- $where_case[] = 'i.description like '.zbx_dbstr('%'.$_REQUEST['with_description'].'%');
- }
if(isset($_REQUEST['with_type']) && $_REQUEST['with_type'] != -1)
{
$where_case[] = 'i.type='.$_REQUEST['with_type'];
@@ -761,6 +757,10 @@ include_once "include/page_header.php";
{
$description = array();
+ $item_description = item_description($db_item["description"],$db_item["key_"]);
+
+ if( $_REQUEST['external_filter'] && isset($_REQUEST['with_description']) && !stristr($item_description, $_REQUEST['with_description']) ) continue;
+
if($db_item["templateid"])
{
$template_host = get_realhost_by_itemid($db_item["templateid"]);
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,
diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php
index 071a5d2c..249329cf 100644
--- a/frontends/php/tr_status.php
+++ b/frontends/php/tr_status.php
@@ -292,15 +292,6 @@ include_once "include/page_header.php";
default: $sort="order by t.priority desc, t.description";
}
- if(isset($_REQUEST["btnSelect"])&&($_REQUEST["btnSelect"]=="Inverse select"))
- {
- $select_cond="not like '%$txt_select%'";
- }
- else
- {
- $select_cond="like '%$txt_select%'";
- }
-
$cond="";
if($_REQUEST["hostid"] > 0) $cond=" and h.hostid=".$_REQUEST["hostid"]." ";
@@ -309,7 +300,7 @@ include_once "include/page_header.php";
$result = DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,".
" t.lastchange,t.comments,t.url,t.value,h.host from triggers t,hosts h,items i,functions f".
" where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and t.status=".TRIGGER_STATUS_ENABLED.
- " and t.description $select_cond and i.status=".ITEM_STATUS_ACTIVE.
+ " and i.status=".ITEM_STATUS_ACTIVE.
" and ".DBid2nodeid("t.triggerid")."=".$ZBX_CURNODEID.
" and h.hostid not in (".get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY, PERM_MODE_LT).") ".
" and h.status=".HOST_STATUS_MONITORED." $cond $sort");
@@ -328,9 +319,10 @@ include_once "include/page_header.php";
$elements=array();
-
$description = expand_trigger_description($row["triggerid"]);
+ if(isset($_REQUEST["btnSelect"]) && '' != $txt_select && ((stristr($description, $txt_select)) == ($_REQUEST["btnSelect"]=="Inverse select"))) continue;
+
if($row["url"] != "")
{
$description = new CLink($description, $row["url"]);