summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-25 10:37:56 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-25 10:37:56 +0000
commit1b9900bb3e3059518fbed4f986ce83bb2d3102a2 (patch)
treee5589be98d6b04b624bdfdd3a82899b06642e19c /frontends/php
parent0a6110e779f37aaf9793e10c0778f715de2c6caf (diff)
- fixed error on items copy to host (Artem)
- fixed html code view in history (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5516 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/history.php18
-rw-r--r--frontends/php/include/items.inc.php12
-rw-r--r--frontends/php/items.php10
-rw-r--r--frontends/php/js/common.js6
4 files changed, 23 insertions, 23 deletions
diff --git a/frontends/php/history.php b/frontends/php/history.php
index 788d13fa..bf6beb95 100644
--- a/frontends/php/history.php
+++ b/frontends/php/history.php
@@ -536,20 +536,20 @@ COpt::profiling_start("history");
$value = $row["value"];
$new_row = array(date("Y.M.d H:i:s",$row["clock"]));
- if(str_in_array($item_type,array(ITEM_VALUE_TYPE_FLOAT,ITEM_VALUE_TYPE_UINT64)))
- {
+ if(str_in_array($item_type,array(ITEM_VALUE_TYPE_FLOAT,ITEM_VALUE_TYPE_UINT64))){
array_push($new_row,$value);
}
- else
- {
- array_push($new_row,array("<pre>",htmlspecialchars($value),"</pre>"));
+ else{
+ $pre = new CTag('pre','yes');
+ $pre->AddItem($value);
+
+ array_push($new_row,$pre);
}
- if(!isset($_REQUEST["plaintext"]))
- {
+
+ if(!isset($_REQUEST["plaintext"])){
$table->ShowRow($new_row);
}
- else
- {
+ else{
echo date("Y-m-d H:i:s",$row["clock"]);
echo "\t".$row["clock"]."\t".$row["value"]."\n";
}
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index dc0c5394..b78e3e9e 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -612,6 +612,7 @@
$db_tmp_item["logtimefmt"],
$db_tmp_item["valuemapid"],
$db_tmp_item["delay_flex"],
+ $db_tmp_item["params"],
get_same_applications_for_host(get_applications_by_itemid($db_tmp_item["itemid"]),$hostid),
$copy_mode ? 0 : $db_tmp_item["itemid"]);
}
@@ -647,7 +648,6 @@
while($db_tmp_item = DBfetch($db_tmp_items))
{
- $apps = get_same_applications_for_host(get_applications_by_itemid($db_tmp_item["itemid"]),$hostid);
add_item(
$db_tmp_item["description"],
$db_tmp_item["key_"],
@@ -674,7 +674,7 @@
$db_tmp_item["valuemapid"],
$db_tmp_item["delay_flex"],
$db_tmp_item["params"],
- $apps,
+ get_same_applications_for_host(get_applications_by_itemid($db_tmp_item["itemid"]),$hostid),
$copy_mode ? 0 : $db_tmp_item["itemid"]);
}
}
@@ -1048,19 +1048,17 @@ COpt::profiling_stop('prepare table');
* Comments: !!! Don't forget sync code with C !!! *
* *
******************************************************************************/
- function get_same_applications_for_host($applications, $hostid)
- {
+ function get_same_applications_for_host($applications, $hostid){
$child_applications = array();
- foreach($applications as $appid)
- {
+ foreach($applications as $appid){
$db_apps = DBselect("select a1.applicationid from applications a1, applications a2".
" where a1.name=a2.name and a1.hostid=".$hostid." and a2.applicationid=".$appid);
$db_app = DBfetch($db_apps);
if(!$db_app) continue;
array_push($child_applications,$db_app["applicationid"]);
}
- return $child_applications;
+ return $child_applications;
}
/******************************************************************************
diff --git a/frontends/php/items.php b/frontends/php/items.php
index 23d2b408..bb609d17 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -527,15 +527,15 @@ include_once "include/page_header.php";
show_table_header(S_CONFIGURATION_OF_ITEMS_BIG, $form);
- if(isset($_REQUEST["form_mass_update"]) && isset($_REQUEST["group_itemid"]))
- {
+ if(isset($_REQUEST["form_mass_update"]) && isset($_REQUEST["group_itemid"])){
echo SBR;
insert_mass_update_item_form("group_itemid");
- } else if(isset($_REQUEST["form_copy_to"]) && isset($_REQUEST["group_itemid"]))
- {
+ }
+ else if(isset($_REQUEST["form_copy_to"]) && isset($_REQUEST["group_itemid"])){
echo SBR;
insert_copy_elements_to_forms("group_itemid");
- } elseif (!isset($_REQUEST["form"]) || !str_in_array($_REQUEST["form"],array(S_CREATE_ITEM,"update","clone"))) {
+ }
+ else if (!isset($_REQUEST["form"]) || !str_in_array($_REQUEST["form"],array(S_CREATE_ITEM,"update","clone"))) {
echo SBR;
// Table HEADER
$form = new CForm();
diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js
index bfc8716f..37fde773 100644
--- a/frontends/php/js/common.js
+++ b/frontends/php/js/common.js
@@ -527,9 +527,11 @@ function remove_childs(form_name,rmvbyname,tag){
function remove_element(elmnt,tag){
if(elmnt.nodeName == tag){
elmnt.parentNode.removeChild(elmnt);
- } else if(elmnt.nodeType == 9){
+ }
+ else if(elmnt.nodeType == 9){
return;
- } else {
+ }
+ else {
remove_element(elmnt.parentNode,tag);
}
}