浏览代码

N.445 Specifying a date format (other than the default one) and allowing to create a user request in the resolved status results in an error when selecting the resolved status.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4433 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 年之前
父节点
当前提交
e326e8e9b3
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      application/wizardhelper.class.inc.php

+ 16 - 0
application/wizardhelper.class.inc.php

@@ -138,6 +138,22 @@ class WizardHelper
 						$oObj->Set($sAttCode, $value);
 					}
 				}
+				else if ($oAttDef instanceof AttributeDateTime) // AttributeDate is derived from AttributeDateTime
+				{
+					if ($value != null)
+					{
+						$oDate = $oAttDef->GetFormat()->Parse($value);
+						if ($oDate instanceof DateTime)
+						{
+							$value = $oDate->format($oAttDef->GetInternalFormat());
+						}
+						else
+						{
+							$value = null;
+						}
+					}
+					$oObj->Set($sAttCode, $value);
+				}
 				else
 				{
 					$oObj->Set($sAttCode, $value);