summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/forms.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-07-18 13:20:33 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-07-18 13:20:33 +0000
commitdef2e0a7def21050b352556ceb7c31cea4ebbb1c (patch)
tree16e811bda782fde81debd4199f2015fcdb103836 /frontends/php/include/forms.inc.php
parent125d97877ec6846cd8be946eb786621e3debec81 (diff)
downloadzabbix-def2e0a7def21050b352556ceb7c31cea4ebbb1c.tar.gz
zabbix-def2e0a7def21050b352556ceb7c31cea4ebbb1c.tar.xz
zabbix-def2e0a7def21050b352556ceb7c31cea4ebbb1c.zip
- developed template unlinking feature (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3057 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/forms.inc.php')
-rw-r--r--frontends/php/include/forms.inc.php37
1 files changed, 34 insertions, 3 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index ab210be8..870e016f 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -2019,10 +2019,12 @@
$location = get_request("location","");
$notes = get_request("notes","");
- $templateid= get_request("templateid",0);
+ $templateid = get_request("templateid",0);
$frm_title = $show_only_tmp ? S_TEMPLATE : S_HOST;
- if(isset($_REQUEST["hostid"])){
+
+ if(isset($_REQUEST["hostid"]))
+ {
$db_host=get_host_by_hostid($_REQUEST["hostid"]);
$frm_title .= SPACE."\"".$db_host["host"]."\"";
}
@@ -2066,6 +2068,12 @@
$notes = $db_profile["notes"];
}
}
+ $real_templateid = 0;
+ if(isset($db_host) && $db_host["templateid"] > 0)
+ {
+ $real_templateid = $templateid = $db_host["templateid"];
+ }
+
if($show_only_tmp){
$useip = "no";
}
@@ -2138,6 +2146,16 @@
}
$cmbHosts = new CComboBox("templateid",$templateid);
+ $btnUnlink = null;
+ $btnUnlinkAndClear = null;
+ if($real_templateid > 0)
+ {
+ $cmbHosts->SetEnabled(false);
+ $frmHost->AddVar("templateid",$templateid);
+ $btnUnlink = new CButton("unlink",S_UNLINK);
+ $btnUnlinkAndClear = new CButton("unlink_and_clear",S_UNLINK_AND_CLEAR);
+ }
+
$cmbHosts->AddItem(0,"...");
$hosts=DBselect("select host,hostid from hosts where status in (".HOST_STATUS_TEMPLATE.")".
" order by host");
@@ -2145,7 +2163,7 @@
{
$cmbHosts->AddItem($host["hostid"],$host["host"]);
}
- $frmHost->AddRow(S_LINK_WITH_TEMPLATE,$cmbHosts);
+ $frmHost->AddRow(S_LINK_WITH_TEMPLATE, array($cmbHosts,SPACE, $btnUnlink, $btnUnlinkAndClear));
if($show_only_tmp)
{
@@ -2197,6 +2215,19 @@
url_param("groupid")
)
);
+
+ if($show_only_tmp)
+ {
+ $frmHost->AddItemToBottomRow(SPACE);
+ $frmHost->AddItemToBottomRow(
+ new CButtonQMessage('delete_and_clear',
+ 'Delete and clear',
+ S_DELETE_SELECTED_HOSTS_Q,
+ url_param("form").url_param("config").url_param("hostid").
+ url_param("groupid")
+ )
+ );
+ }
}
$frmHost->AddItemToBottomRow(SPACE);
$frmHost->AddItemToBottomRow(new CButtonCancel(url_param("config").url_param("groupid")));