Explorar o código

Properly handle all types of fields when entering values via the state transition "wizard" screen

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2280 a333f486-631f-4898-b8df-5754b55c2be0
dflaven %!s(int64=12) %!d(string=hai) anos
pai
achega
f37e64b790
Modificáronse 1 ficheiros con 8 adicións e 8 borrados
  1. 8 8
      pages/UI.php

+ 8 - 8
pages/UI.php

@@ -1685,13 +1685,13 @@ EOF
 								{
 									$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
 									$aErrors[] = Dict::Format('UI:AttemptingToSetASlaveAttribute_Name', $oAttDef->GetLabel());
-								}
-								else
-								{
-									$oObj->Set($sAttCode, $paramValue);
+									unset($aExpectedAttributes[$sAttCode]);
 								}
 							}
 						}
+						
+						$oObj->UpdateObjectFromPostedForm('', array_keys($aExpectedAttributes), $sTargetState);
+						
 						if (count($aErrors) == 0)
 						{
 							if ($oObj->ApplyStimulus($sStimulus))
@@ -1928,13 +1928,13 @@ EOF
 						{
 							$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
 							$aErrors[] = Dict::Format('UI:AttemptingToChangeASlaveAttribute_Name', $oAttDef->GetLabel());
+							unset($aExpectedAttributes[$sAttCode]);
 						}
-						else
-						{
-						$oObj->Set($sAttCode, $paramValue);
 					}
 				}
-				}
+				
+				$oObj->UpdateObjectFromPostedForm('', array_keys($aExpectedAttributes), $sTargetState);
+				
 				if (count($aErrors) == 0)
 				{
 					if ($oObj->ApplyStimulus($sStimulus))