diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-31 08:05:54 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-31 08:05:54 +0000 |
| commit | 3eea91a6fdd3ae1c667e25de6ffdf5546774f915 (patch) | |
| tree | 9b531ac2bb71cff205afd097e92bc91eba589404 /frontends/php/items.php | |
| parent | cf058c2ec2bff2902940ebcb7b753267ac7bea98 (diff) | |
| download | zabbix-3eea91a6fdd3ae1c667e25de6ffdf5546774f915.tar.gz zabbix-3eea91a6fdd3ae1c667e25de6ffdf5546774f915.tar.xz zabbix-3eea91a6fdd3ae1c667e25de6ffdf5546774f915.zip | |
recommited revisions r3410 and r3411
git-svn-id: svn://svn.zabbix.com/trunk@3416 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/items.php')
| -rw-r--r-- | frontends/php/items.php | 68 |
1 files changed, 52 insertions, 16 deletions
diff --git a/frontends/php/items.php b/frontends/php/items.php index 5b8d8aea..29ff36d2 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -148,7 +148,40 @@ include_once "include/page_header.php"; if(isset($_REQUEST["itemid"])) { - $result=update_item($_REQUEST["itemid"], + $item_data = get_item_by_itemid($_REQUEST["itemid"]); + if($item_data['templateid']) + { + foreach(array( + "description" => null, + "key" => "key_", + "hostid" => null, + //"delay" => null, + //"history" => null, + //"status" => null, + "type" => null, + "snmp_community" => null, + "snmp_oid" => null, + "value_type" => null, + "trapper_hosts" => null, + "snmp_port" => null, + "units" => null, + "multiplier" => null, + //"delta" => null, + "snmpv3_securityname" => null, + "snmpv3_securitylevel" => null, + "snmpv3_authpassphrase" => null, + "snmpv3_privpassphrase" => null, + "formula" => null, + //"trends" => null, + "logtimefmt" => null, + "valuemapid" => null + ) as $req_var_name => $db_varname) + { + if(!isset($db_varname)) $db_varname = $req_var_name; + $_REQUEST[$req_var_name] = $item_data[$db_varname]; + } + } + $result = update_item($_REQUEST["itemid"], $_REQUEST["description"],$_REQUEST["key"],$_REQUEST["hostid"],$_REQUEST["delay"], $_REQUEST["history"],$_REQUEST["status"],$_REQUEST["type"], $_REQUEST["snmp_community"],$_REQUEST["snmp_oid"],$_REQUEST["value_type"], @@ -156,7 +189,8 @@ include_once "include/page_header.php"; $_REQUEST["multiplier"],$_REQUEST["delta"],$_REQUEST["snmpv3_securityname"], $_REQUEST["snmpv3_securitylevel"],$_REQUEST["snmpv3_authpassphrase"], $_REQUEST["snmpv3_privpassphrase"],$_REQUEST["formula"],$_REQUEST["trends"], - $_REQUEST["logtimefmt"],$_REQUEST["valuemapid"],$db_delay_flex,$applications); + $_REQUEST["logtimefmt"],$_REQUEST["valuemapid"],$db_delay_flex,$applications, + $item_data['templateid']); $itemid = $_REQUEST["itemid"]; $action = AUDIT_ACTION_UPDATE; @@ -496,27 +530,29 @@ include_once "include/page_header.php"; $show_applications == 1 ? S_APPLICATIONS : NULL, S_ERROR)); - $db_items = DBselect("select i.* from hosts h,items i where h.hostid=i.hostid and". - " h.hostid=".$_REQUEST["hostid"]." order by i.templateid,i.description, i.key_"); + $db_items = DBselect('select i.*,th.host as template_host,th.hostid as template_hostid from items i '. + ' left join items ti on i.templateid=ti.itemid left join hosts th on ti.hostid=th.hostid '. + ' where i.hostid='.$_REQUEST['hostid']. + ' order by th.host,i.description, i.key_'); while($db_item = DBfetch($db_items)) { - if($db_item["templateid"]==0) + $description = array(); + + if($db_item["templateid"]) { - $description = new CLink( - item_description($db_item["description"],$db_item["key_"]), - "items.php?form=update&itemid=". - $db_item["itemid"].url_param("hostid").url_param("groupid"), - 'action'); - } else { $template_host = get_realhost_by_itemid($db_item["templateid"]); - $description = array( + array_push($description, new CLink($template_host["host"],"items.php?". "hostid=".$template_host["hostid"], - 'action'), - ":", - item_description($db_item["description"],$db_item["key_"]), - ); + 'uncnown'), + ":"); } + + array_push($description, new CLink( + item_description($db_item["description"],$db_item["key_"]), + "items.php?form=update&itemid=". + $db_item["itemid"].url_param("hostid").url_param("groupid"), + 'action')); $status=new CCol(new CLink(item_status2str($db_item["status"]), "items.php?group_itemid%5B%5D=".$db_item["itemid"]. |
