parent
5c46fad8a2
commit
81e309be5f
4 changed files with 12 additions and 6 deletions
|
@ -522,7 +522,11 @@ class RCrmActions
|
|||
$result = $value;
|
||||
|
||||
if ($type === 'boolean') {
|
||||
$result = $value === 'Y' ? 1 : 0;
|
||||
$result = $value === '1' ? 1 : 0;
|
||||
}
|
||||
|
||||
if ($type === 'datetime') {
|
||||
$result = date('Y-m-d', strtotime($value));
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
|
@ -99,7 +99,7 @@ class RestNormalizer
|
|||
$formatted[ $code ] = $this->formatting($value, true);
|
||||
}
|
||||
|
||||
if (empty($formatted[$code])) {
|
||||
if (empty($formatted[$code] && $formatted[$code] !== 0)) {
|
||||
if ($this->clear === true) {
|
||||
unset($formatted[ $code ]);
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ class RetailCrmUser
|
|||
$result = [];
|
||||
|
||||
foreach ($customUserFields as $code => $codeCrm) {
|
||||
if (!empty($arFields[$code])) {
|
||||
if (isset($arFields[$code])) {
|
||||
$type = $typeList[$code] ?? '';
|
||||
$result[$codeCrm] = RCrmActions::convertFieldToCrmValue($arFields[$code], $type);
|
||||
}
|
||||
|
|
|
@ -950,9 +950,11 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($arResult['bitrixCustomUserFields'] as $code => $text) {
|
||||
if (!empty($_POST['bitrixUserField_' . $code]) && !empty($_POST['crmUserField_' . $code])) {
|
||||
$customUserFields[htmlspecialchars($_POST['bitrixUserField_' . $code])] = htmlspecialchars($_POST['crmUserField_' . $code]);
|
||||
foreach ($arResult['bitrixCustomUserFields'] as $list) {
|
||||
foreach ($list as $code => $text) {
|
||||
if (!empty($_POST['bitrixUserField_' . $code]) && !empty($_POST['crmUserField_' . $code])) {
|
||||
$customUserFields[htmlspecialchars($_POST['bitrixUserField_' . $code])] = htmlspecialchars($_POST['crmUserField_' . $code]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue