diff -uNrp zabbix-1.8.6.orig/frontends/php/httpconf.php zabbix-1.8.6/frontends/php/httpconf.php
--- zabbix-1.8.6.orig/frontends/php/httpconf.php	2011-08-12 01:33:40.000000000 +0900
+++ zabbix-1.8.6/frontends/php/httpconf.php	2011-08-12 01:34:11.000000000 +0900
@@ -46,6 +46,8 @@ include_once('include/page_header.php');
 		'application'=>	array(T_ZBX_STR, O_OPT,  null,	NOT_EMPTY, 'isset({save})'),
 		'name'=>		array(T_ZBX_STR, O_OPT,  null,	NOT_EMPTY, 'isset({save})'),
 		'delay'=>		array(T_ZBX_INT, O_OPT,  null,  BETWEEN(0,86400),'isset({save})'),
+		'history'=>		array(T_ZBX_INT, O_OPT,  null,  BETWEEN(0,65534),'isset({save})'),
+		'trends'=>		array(T_ZBX_INT, O_OPT,  null,  BETWEEN(0,65534),'isset({save})'),
 		'status'=>		array(T_ZBX_INT, O_OPT,  null,  IN('0,1'),'isset({save})'),
 		'agent'=>		array(T_ZBX_STR, O_OPT,  null,	null,'isset({save})'),
 		'macros'=>		array(T_ZBX_STR, O_OPT,  null,	null,'isset({save})'),
@@ -210,7 +212,7 @@ include_once('include/page_header.php');
 			$result = update_httptest($_REQUEST['httptestid'], $_REQUEST['hostid'], $_REQUEST['application'],
 				$_REQUEST['name'],$_REQUEST['authentication'],$http_user,$http_password,
 				$_REQUEST['delay'],$_REQUEST['status'],$_REQUEST['agent'],
-				$_REQUEST['macros'],$_REQUEST['steps']);
+				$_REQUEST['macros'],$_REQUEST['steps'],$_REQUEST['history'],$_REQUEST['trends']);
 
 			$httptestid = $_REQUEST['httptestid'];
 			$action = AUDIT_ACTION_UPDATE;
@@ -221,7 +223,7 @@ include_once('include/page_header.php');
 			$httptestid = add_httptest($_REQUEST['hostid'],$_REQUEST['application'],
 				$_REQUEST['name'],$_REQUEST['authentication'],$http_user,$http_password,
 				$_REQUEST['delay'],$_REQUEST['status'],$_REQUEST['agent'],
-				$_REQUEST['macros'],$_REQUEST['steps']);
+				$_REQUEST['macros'],$_REQUEST['steps'],$_REQUEST['history'],$_REQUEST['trends']);
 
 			$result = $httptestid;
 			$action = AUDIT_ACTION_ADD;
@@ -381,6 +383,8 @@ include_once('include/page_header.php');
 		$name = get_request('name', '');
 		$application = get_request('application', '');
 		$delay = get_request('delay', 60);
+		$history = get_request('history', 30);
+		$trends = get_request('trends', 90);
 		$status = get_request('status', HTTPTEST_STATUS_ACTIVE);
 		$agent = get_request('agent', '');
 		$macros = get_request('macros', array());
@@ -391,13 +395,16 @@ include_once('include/page_header.php');
 		$http_password = get_request('http_password', '');
 
 		if((isset($_REQUEST["httptestid"]) && !isset($_REQUEST["form_refresh"])) || isset($limited)){
-			$httptest_data = DBfetch(DBselect("SELECT wt.*, a.name as application ".
-				" FROM httptest wt,applications a WHERE wt.httptestid=".$_REQUEST["httptestid"].
+			$httptest_data = DBfetch(DBselect("SELECT DISTINCT wt.*, a.name as application, i.history, i.trends ".
+				" FROM items i, httpstepitem hsi, httpstep hs, httptest wt, applications a WHERE i.itemid=hsi.itemid ".
+				" AND hsi.httpstepid=hs.httpstepid AND hs.httptestid=wt.httptestid AND wt.httptestid=".$_REQUEST["httptestid"].
 				" AND a.applicationid=wt.applicationid"));
 
 			$name		= $httptest_data['name'];
 			$application	= $httptest_data['application'];
 			$delay		= $httptest_data['delay'];
+			$history	= $httptest_data['history'];
+			$trends		= $httptest_data['trends'];
 			$status		= $httptest_data['status'];
 			$agent		= $httptest_data['agent'];
 			$macros		= $httptest_data['macros'];
@@ -434,6 +441,8 @@ include_once('include/page_header.php');
 		}
 
 		$form->addRow(S_UPDATE_INTERVAL_IN_SEC, new CNumericBox('delay', $delay, 5));
+		$form->addRow(S_KEEP_HISTORY_IN_DAYS, new CNumericBox('history', $history, 5));
+		$form->addRow(S_KEEP_TRENDS_IN_DAYS, new CNumericBox('trends', $trends, 5));
 
 		$cmbAgent = new CEditableComboBox('agent', $agent, 80);
 // IE6
diff -uNrp zabbix-1.8.6.orig/frontends/php/include/httptest.inc.php zabbix-1.8.6/frontends/php/include/httptest.inc.php
--- zabbix-1.8.6.orig/frontends/php/include/httptest.inc.php	2011-08-12 01:33:40.000000000 +0900
+++ zabbix-1.8.6/frontends/php/include/httptest.inc.php	2011-08-12 01:34:11.000000000 +0900
@@ -166,10 +166,10 @@ require_once('include/items.inc.php');
 			else{
 				$itemid = $item_data['itemid'];
 
-				$item_args['history'] = $item_data['history'];
+				$item_args['history'] = $history;
 				$item_args['status'] = $item_data['status'];
 				$item_args['delta'] = $item_data['delta'];
-				$item_args['trends'] = $item_data['trends'];
+				$item_args['trends'] = $trends;
 				$item_args['valuemapid'] = $item_data['valuemapid'];
 
 				if(!update_item($itemid, $item_args)){
@@ -191,10 +191,7 @@ require_once('include/items.inc.php');
 		return $httpstepid;
 	}
 
-	function db_save_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps){
-		$history = 30; // TODO !!! Allow user to set this parameter
-		$trends = 90; // TODO !!! Allow user to set this parameter
-
+	function db_save_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps, $history, $trends){
 		if(!preg_match('/^(['.ZBX_PREG_PRINT.'])+$/u', $name)){
 			error(S_ONLY_CHARACTERS_ARE_ALLOWED);
 			return false;
@@ -396,16 +393,16 @@ require_once('include/items.inc.php');
 		}
 	}
 
-	function add_httptest($hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps){
-		$result = db_save_httptest(null, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps);
+	function add_httptest($hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps, $history, $trends){
+		$result = db_save_httptest(null, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps, $history, $trends);
 
 		if($result) info(S_SCENARIO.SPACE."'".$name."'".SPACE.S_ADDED_SMALL);
 
 	return $result;
 	}
 
-	function update_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps){
-		$result = db_save_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps);
+	function update_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps, $history, $trends){
+		$result = db_save_httptest($httptestid, $hostid, $application, $name, $authentication, $http_user, $http_password, $delay, $status, $agent, $macros, $steps, $history, $trends);
 
 		if($result)	info(S_SCENARIO.SPACE."'".$name."'".SPACE.S_UPDATED_SMALL);
 
