--- zabbix-2.0.14/frontends/php/api/classes/CWebCheck.php.orig	2015-06-05 09:09:25.974323332 +0900
+++ zabbix-2.0.14/frontends/php/api/classes/CWebCheck.php	2015-06-05 09:09:47.438549909 +0900
@@ -279,9 +279,9 @@ class CWebCheck extends CZBXAPI {
 			);
 			while ($step = DBfetch($dbSteps)) {
 				$stepid = $step['httpstepid'];
-				$step['webstepid'] = $stepid;
+				$step['httpstepid'] = $stepid;
 				unset($step['httpstepid']);
-				$result[$step['httptestid']]['steps'][$step['webstepid']] = $step;
+				$result[$step['httptestid']]['steps'][$step['httpstepid']] = $step;
 			}
 		}
 
@@ -392,15 +392,15 @@ class CWebCheck extends CZBXAPI {
 
 			// update steps
 			$stepsCreate = $stepsUpdate = array();
-			$dbSteps = zbx_toHash($dbHttpTest[$httpTest['httptestid']]['steps'], 'webstepid');
+			$dbSteps = zbx_toHash($dbHttpTest[$httpTest['httptestid']]['steps'], 'httpstepid');
 
-			foreach ($httpTest['steps'] as $webstep) {
-				if (isset($webstep['webstepid']) && isset($dbSteps[$webstep['webstepid']])) {
-					$stepsUpdate[] = $webstep;
-					unset($dbSteps[$webstep['webstepid']]);
+			foreach ($httpTest['steps'] as $httpstep) {
+				if (isset($httpstep['httpstepid']) && isset($dbSteps[$httpstep['httpstepid']])) {
+					$stepsUpdate[] = $httpstep;
+					unset($dbSteps[$httpstep['httpstepid']]);
 				}
-				elseif (!isset($webstep['webstepid'])) {
-					$stepsCreate[] = $webstep;
+				elseif (!isset($httpstep['httpstepid'])) {
+					$stepsCreate[] = $httpstep;
 				}
 			}
 			$stepidsDelete = array_keys($dbSteps);
@@ -685,52 +685,52 @@ class CWebCheck extends CZBXAPI {
 	 * Create web scenario steps with items.
 	 *
 	 * @param $httpTest
-	 * @param $websteps
+	 * @param $httpsteps
 	 */
-	protected function createStepsReal($httpTest, $websteps) {
-		$webstepsNames = zbx_objectValues($websteps, 'name');
+	protected function createStepsReal($httpTest, $httpsteps) {
+		$httpstepsNames = zbx_objectValues($httpsteps, 'name');
 
-		if (!preg_grep('/'.ZBX_PREG_PARAMS.'/i', $webstepsNames)) {
+		if (!preg_grep('/'.ZBX_PREG_PARAMS.'/i', $httpstepsNames)) {
 			self::exception(ZBX_API_ERROR_PARAMETERS, _('Scenario step name should contain only printable characters.'));
 		}
 
 		$sql = 'SELECT h.httpstepid,h.name'.
 				' FROM httpstep h'.
 				' WHERE h.httptestid='.zbx_dbstr($httpTest['httptestid']).
-					' AND '.dbConditionString('h.name', $webstepsNames);
+					' AND '.dbConditionString('h.name', $httpstepsNames);
 		if ($httpstepData = DBfetch(DBselect($sql))) {
 			self::exception(ZBX_API_ERROR_PARAMETERS, _s('Step "%s" already exists.', $httpstepData['name']));
 		}
 
-		foreach ($websteps as $snum => $webstep) {
-			$websteps[$snum]['httptestid'] = $httpTest['httptestid'];
-			if ($webstep['no'] <= 0) {
+		foreach ($httpsteps as $snum => $httpstep) {
+			$httpsteps[$snum]['httptestid'] = $httpTest['httptestid'];
+			if ($httpstep['no'] <= 0) {
 				self::exception(ZBX_API_ERROR_PARAMETERS, _('Scenario step number cannot be less than 1.'));
 			}
 		}
-		$webstepids = DB::insert('httpstep', $websteps);
+		$httpstepids = DB::insert('httpstep', $httpsteps);
 
-		foreach ($websteps as $snum => $webstep) {
-			$webstepid = $webstepids[$snum];
+		foreach ($httpsteps as $snum => $httpstep) {
+			$httpstepid = $httpstepids[$snum];
 
 			$stepitems = array(
 				array(
 					'name'				=> _s('Download speed for step "%1$s" of scenario "%2$s".', '$2', '$1'),
-					'key_'				=> 'web.test.in['.$httpTest['name'].','.$webstep['name'].',bps]',
+					'key_'				=> 'web.test.in['.$httpTest['name'].','.$httpstep['name'].',bps]',
 					'value_type'		=> ITEM_VALUE_TYPE_FLOAT,
 					'units'				=> 'Bps',
 					'httpstepitemtype'	=> HTTPSTEP_ITEM_TYPE_IN
 				),
 				array(
 					'name'				=> _s('Response time for step "%1$s" of scenario "%2$s".', '$2', '$1'),
-					'key_'				=> 'web.test.time['.$httpTest['name'].','.$webstep['name'].',resp]',
+					'key_'				=> 'web.test.time['.$httpTest['name'].','.$httpstep['name'].',resp]',
 					'value_type'		=> ITEM_VALUE_TYPE_FLOAT,
 					'units'				=> 's',
 					'httpstepitemtype'	=> HTTPSTEP_ITEM_TYPE_TIME
 				),
 				array(
 					'name'				=> _s('Response code for step "%1$s" of scenario "%2$s".', '$2', '$1'),
-					'key_'				=> 'web.test.rspcode['.$httpTest['name'].','.$webstep['name'].']',
+					'key_'				=> 'web.test.rspcode['.$httpTest['name'].','.$httpstep['name'].']',
 					'value_type'		=> ITEM_VALUE_TYPE_UINT64,
 					'units'				=> '',
 					'httpstepitemtype'	=> HTTPSTEP_ITEM_TYPE_RSPCODE
@@ -765,15 +765,15 @@ class CWebCheck extends CZBXAPI {
 			}
 			DB::insert('items_applications', $itemApplications);
 
-			$webstepitems = array();
+			$httpstepitems = array();
 			foreach ($stepitems as $inum => $item) {
-				$webstepitems[] = array(
-					'httpstepid' => $webstepid,
+				$httpstepitems[] = array(
+					'httpstepid' => $httpstepid,
 					'itemid' => $stepItemids[$inum],
 					'type' => $item['httpstepitemtype']
 				);
 			}
-			DB::insert('httpstepitem', $webstepitems);
+			DB::insert('httpstepitem', $httpstepitems);
 
 			foreach ($stepitems as $stepitem) {
 				info(_s('Web item "%s" created.', $stepitem['key_']));
@@ -785,33 +785,33 @@ class CWebCheck extends CZBXAPI {
 	 * Update web scenario steps.
 	 *
 	 * @param $httpTest
-	 * @param $websteps
+	 * @param $httpsteps
 	 */
-	protected function updateStepsReal($httpTest, $websteps) {
-		$webstepsNames = zbx_objectValues($websteps, 'name');
+	protected function updateStepsReal($httpTest, $httpsteps) {
+		$httpstepsNames = zbx_objectValues($httpsteps, 'name');
 
-		if (!preg_grep('/'.ZBX_PREG_PARAMS.'/i', $webstepsNames)) {
+		if (!preg_grep('/'.ZBX_PREG_PARAMS.'/i', $httpstepsNames)) {
 			self::exception(ZBX_API_ERROR_PARAMETERS, _('Scenario step name should contain only printable characters.'));
 		}
 
 		// get all used keys
-		$webstepids = zbx_objectValues($websteps, 'webstepid');
+		$httpstepids = zbx_objectValues($httpsteps, 'httpstepid');
 		$dbKeys = DBfetchArray(DBselect(
 			'SELECT i.key_'.
 			' FROM items i,httpstepitem hi'.
-			' WHERE '.dbConditionInt('hi.httpstepid', $webstepids).
+			' WHERE '.dbConditionInt('hi.httpstepid', $httpstepids).
 				' AND hi.itemid=i.itemid'
 		));
 		$dbKeys = zbx_toHash($dbKeys, 'key_');
 
-		foreach ($websteps as $webstep) {
-			if ($webstep['no'] <= 0) {
+		foreach ($httpsteps as $httpstep) {
+			if ($httpstep['no'] <= 0) {
 				self::exception(ZBX_API_ERROR_PARAMETERS, _('Scenario step number cannot be less than 1.'));
 			}
 
 			DB::update('httpstep', array(
-				'values' => $webstep,
-				'where' => array('httpstepid' => $webstep['webstepid'])
+				'values' => $httpstep,
+				'where' => array('httpstepid' => $httpstep['httpstepid'])
 			));
 
 			// update item keys
@@ -820,22 +820,22 @@ class CWebCheck extends CZBXAPI {
 			$dbStepItems = DBselect(
 				'SELECT i.itemid,hi.type'.
 				' FROM items i,httpstepitem hi'.
-				' WHERE hi.httpstepid='.zbx_dbstr($webstep['webstepid']).
+				' WHERE hi.httpstepid='.zbx_dbstr($httpstep['httpstepid']).
 					' AND hi.itemid=i.itemid'
 			);
 			while ($stepitem = DBfetch($dbStepItems)) {
 				$itemids[] = $stepitem['itemid'];
 
-				if (isset($httpTest['name']) || $webstep['name']) {
+				if (isset($httpTest['name']) || $httpstep['name']) {
 					switch ($stepitem['type']) {
 						case HTTPSTEP_ITEM_TYPE_IN:
-							$updateFields['key_'] = 'web.test.in['.$httpTest['name'].','.$webstep['name'].',bps]';
+							$updateFields['key_'] = 'web.test.in['.$httpTest['name'].','.$httpstep['name'].',bps]';
 							break;
 						case HTTPSTEP_ITEM_TYPE_TIME:
-							$updateFields['key_'] = 'web.test.time['.$httpTest['name'].','.$webstep['name'].',resp]';
+							$updateFields['key_'] = 'web.test.time['.$httpTest['name'].','.$httpstep['name'].',resp]';
 							break;
 						case HTTPSTEP_ITEM_TYPE_RSPCODE:
-							$updateFields['key_'] = 'web.test.rspcode['.$httpTest['name'].','.$webstep['name'].']';
+							$updateFields['key_'] = 'web.test.rspcode['.$httpTest['name'].','.$httpstep['name'].']';
 							break;
 					}
 				}
@@ -870,21 +870,21 @@ class CWebCheck extends CZBXAPI {
 	/**
 	 * Delete web scenario steps.
 	 *
-	 * @param $webstepids
+	 * @param $httpstepids
 	 */
-	protected function deleteStepsReal($webstepids) {
+	protected function deleteStepsReal($httpstepids) {
 		$itemids = array();
 		$dbStepItems = DBselect(
 			'SELECT i.itemid'.
 			' FROM items i,httpstepitem hi'.
-			' WHERE '.dbConditionInt('hi.httpstepid', $webstepids).
+			' WHERE '.dbConditionInt('hi.httpstepid', $httpstepids).
 				' AND hi.itemid=i.itemid'
 		);
 		while ($stepitem = DBfetch($dbStepItems)) {
 			$itemids[] = $stepitem['itemid'];
 		}
 
-		DB::delete('httpstep', array('httpstepid' => $webstepids));
+		DB::delete('httpstep', array('httpstepid' => $httpstepids));
 
 		if (!empty($itemids)) {
 			API::Item()->delete($itemids, true);
