diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-04-02 11:22:22 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-04-02 11:22:22 +0000 |
commit | d2a3e65806eb484b59de7c3d8b7a8612249e70ca (patch) | |
tree | a86c165cd36fe5284a3e59bcbcf6a10eb56077dc /frontends/php/popup.php | |
parent | 5297145c0a145eea288a0488e24e08d56c2b7dee (diff) | |
download | zabbix-d2a3e65806eb484b59de7c3d8b7a8612249e70ca.tar.gz zabbix-d2a3e65806eb484b59de7c3d8b7a8612249e70ca.tar.xz zabbix-d2a3e65806eb484b59de7c3d8b7a8612249e70ca.zip |
- Developed action configurations for discodery events (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3965 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/popup.php')
-rw-r--r-- | frontends/php/popup.php | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/frontends/php/popup.php b/frontends/php/popup.php index 1adc08a0..dd170319 100644 --- a/frontends/php/popup.php +++ b/frontends/php/popup.php @@ -29,6 +29,7 @@ switch($srctbl) { + case 'host_templates': case 'templates': $page["title"] = "S_TEMPLATES_BIG"; $min_user_type = USER_TYPE_ZABBIX_ADMIN; @@ -108,6 +109,7 @@ include_once "include/page_header.php"; "groupid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null), "hostid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null), "templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null), + "host_templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null), "existed_templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null), "only_hostid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null), "monitored_hosts"=> array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), @@ -175,7 +177,7 @@ include_once "include/page_header.php"; array_push($validation_param, "always_select_first_host"); validate_group_with_host(PERM_READ_LIST,$validation_param); } - elseif(in_array($srctbl,array("hosts","templates"))) + elseif(in_array($srctbl,array('hosts','templates','host_templates'))) { validate_group(PERM_READ_LIST,$validation_param); } @@ -210,7 +212,7 @@ include_once "include/page_header.php"; if(!isset($ok)) $nodeid = $ZBX_CURNODEID; unset($ok); - if(in_array($srctbl,array("hosts","templates","triggers","logitems","items",'applications'))) + if(in_array($srctbl,array('hosts','templates','triggers','logitems','items','applications','host_templates'))) { $groupid = get_request("groupid",get_profile("web.popup.groupid",0)); @@ -472,6 +474,34 @@ include_once "include/page_header.php"; } $table->Show(); } + elseif(in_array($srctbl,array('host_templates'))) + { + $table = new CTableInfo(S_NO_TEMPLATES_DEFINED); + $table->SetHeader(array(S_NAME)); + + $sql = 'select distinct h.* from hosts h'; + if(isset($groupid)) + $sql .= ',hosts_groups hg where hg.groupid='.$groupid. + ' and h.hostid=hg.hostid and '; + else + $sql .= ' where '; + + $sql .= DBid2nodeid('h.hostid').'='.$nodeid.' and status='.HOST_STATUS_TEMPLATE. + ' and h.hostid in ('.$accessible_hosts.') '. + ' order by h.host,h.hostid'; + $db_hosts = DBselect($sql); + while($row = DBfetch($db_hosts)) + { + $name = new CLink($row['host'],'#','action'); + $name->SetAction( + get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]). + (isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : ''). + ' return close_window();'); + + $table->AddRow($name); + } + $table->Show(); + } elseif($srctbl == "usrgrp") { $table = new CTableInfo(S_NO_GROUPS_DEFINED); |