82 protected static function getFieldValue($arUserField, $arAdditionalParameters = array())
84 if(!$arAdditionalParameters[
"bVarsFromForm"])
86 if($arUserField[
"ENTITY_VALUE_ID"] <= 0)
88 switch($arUserField[
'USER_TYPE_ID'])
90 case \CUserTypeDate::USER_TYPE_ID:
91 case \CUserTypeDateTime::USER_TYPE_ID:
93 $full = $arUserField[
'USER_TYPE_ID'] === \CUserTypeDateTime::USER_TYPE_ID;
94 if($arUserField[
"SETTINGS"][
"DEFAULT_VALUE"][
"TYPE"] ==
"NOW")
97 ? \ConvertTimeStamp(time() + \CTimeZone::getOffset(),
"FULL")
98 : \ConvertTimeStamp(time(),
'SHORT');
103 ? str_replace(
" 00:00:00",
"", \CDatabase::formatDate($arUserField[
"SETTINGS"][
"DEFAULT_VALUE"][
"VALUE"],
"YYYY-MM-DD HH:MI:SS", \CLang::getDateFormat(
"FULL")))
104 : \CDatabase::formatDate($arUserField[
"SETTINGS"][
"DEFAULT_VALUE"][
"VALUE"],
"YYYY-MM-DD", \CLang::getDateFormat(
'SHORT'));
108 case \CUserTypeEnum::USER_TYPE_ID:
110 $value = $arUserField[
'MULTIPLE'] ===
'Y' ? array() :
null;
111 foreach($arUserField[
'ENUM'] as $enum)
113 if($enum[
'DEF'] ===
'Y')
115 if($arUserField[
'MULTIPLE'] ===
'Y')
117 $value[] = $enum[
'ID'];
121 $value = $enum[
'ID'];
129 $value = $arUserField[
"SETTINGS"][
"DEFAULT_VALUE"];
136 $value = $arUserField[
"VALUE"];
141 $value = $_REQUEST[$arUserField[
"FIELD_NAME"]];
144 return static::normalizeFieldValue($value);