13Loc::loadMessages(__FILE__);
18 private static array $arUsers = [];
30 public static function DoProcessOrder(&$arOrder, $arOrderPropsValues, &$arErrors, &$arWarnings, $paysystemId = 0, $deliveryId =
"",
$arOptions =
array())
32 if (!is_array($arOrderPropsValues))
33 $arOrderPropsValues =
array();
35 $arUser = self::$arUsers[$arOrder[
'USER_ID']] ??
null;
38 "=PERSON_TYPE_ID" => $arOrder[
"PERSON_TYPE_ID"],
46 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_TYPE' =>
'P',
47 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_ID' => $paysystemId,
51 if ($deliveryId <>
'')
55 $relationFilter[
'LOGIC'] =
'OR';
59 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_TYPE' =>
'D',
68 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.PROPERTY_ID' => null
77 $property = $registry->getPropertyClassName();
81 $property = \Bitrix\Sale\Property::class;
85 $dbRes = $property::getlist([
87 'ID',
'NAME',
'TYPE',
'IS_LOCATION',
'IS_LOCATION4TAX',
'IS_PROFILE_NAME',
'IS_PAYER',
'IS_EMAIL',
88 'REQUIRED',
'SORT',
'IS_ZIP',
'CODE',
'DEFAULT_VALUE'
91 'order' => [
'SORT' =>
'ASC']
94 while ($arOrderProp =
$dbRes->fetch())
97 if (!array_key_exists($arOrderProp[
"ID"], $arOrderPropsValues))
99 $curVal = $arOrderProp[
"DEFAULT_VALUE"];
101 if (!is_array($curVal) && $curVal ==
'')
103 if ($arOrderProp[
"IS_EMAIL"] ==
"Y" || $arOrderProp[
"IS_PAYER"] ==
"Y")
107 $dbUser = CUser::GetList(
110 [
'ID_EQUAL_EXACT' => $arOrder[
'USER_ID']],
112 'FIELDS' => [
'EMAIL',
'NAME',
'LAST_NAME'],
115 $arUser = $dbUser->Fetch();
116 self::$arUsers[$arOrder[
'USER_ID']] = $arUser;
118 if ($arOrderProp[
'IS_EMAIL'] ===
'Y')
120 $curVal = is_array($arUser) ? $arUser[
'EMAIL'] :
'';
122 elseif ($arOrderProp[
'IS_PAYER'] ===
'Y')
126 ? $arUser[
'NAME'].($arUser[
'NAME'] ==
'' || $arUser[
'LAST_NAME'] ==
'' ?
'' :
' ') . $arUser[
'LAST_NAME']
135 $curVal = $arOrderPropsValues[$arOrderProp[
"ID"]];
138 if ((!is_array($curVal) && $curVal <>
'') || (is_array($curVal) &&
count($curVal) > 0))
141 if ($arOrderProp[
"TYPE"] ==
"SELECT" || $arOrderProp[
"TYPE"] ==
"RADIO")
143 $arVariants =
array();
145 array(
"SORT" =>
"ASC",
"NAME" =>
"ASC"),
146 array(
"ORDER_PROPS_ID" => $arOrderProp[
"ID"]),
151 while ($arVariant = $dbVariants->Fetch())
152 $arVariants[] = $arVariant[
"VALUE"];
154 if (!is_array($curVal))
155 $curVal =
array($curVal);
157 $arKeys = array_keys($curVal);
158 foreach ($arKeys as
$k)
160 if (!in_array($curVal[
$k], $arVariants))
164 if ($arOrderProp[
"TYPE"] ==
"SELECT" || $arOrderProp[
"TYPE"] ==
"RADIO")
165 $curVal = array_shift($curVal);
167 elseif ($arOrderProp[
"TYPE"] ==
"LOCATION")
169 if (is_array($curVal))
170 $curVal = array_shift($curVal);
176 $res = CSaleLocation::GetById($curVal);
179 $curVal =
$res[
'ID'];
192 array(
"ID" => $curVal),
197 if ($arVariant = $dbVariants->Fetch())
198 $curVal = intval($arVariant[
"ID"]);
205 if ($arOrderProp[
"TYPE"] ==
"LOCATION" && ($arOrderProp[
"IS_LOCATION"] ==
"Y" || $arOrderProp[
"IS_LOCATION4TAX"] ==
"Y"))
209 if ($arOrderProp[
"IS_LOCATION"] ===
"Y")
211 $arOrder[
"DELIVERY_LOCATION"] = $locId;
214 if ($arOrderProp[
"IS_LOCATION4TAX"] ===
"Y")
216 $arOrder[
"TAX_LOCATION"] = $locId;
224 elseif ($arOrderProp[
"IS_PROFILE_NAME"] ==
"Y" || $arOrderProp[
"IS_PAYER"] ==
"Y" || $arOrderProp[
"IS_EMAIL"] ==
"Y" || $arOrderProp[
"IS_ZIP"] ==
"Y")
226 $curVal = trim($curVal);
227 if ($arOrderProp[
"IS_PROFILE_NAME"] ==
"Y")
228 $arOrder[
"PROFILE_NAME"] = $curVal;
229 if ($arOrderProp[
"IS_PAYER"] ==
"Y")
230 $arOrder[
"PAYER_NAME"] = $curVal;
231 if ($arOrderProp[
"IS_ZIP"] ==
"Y")
232 $arOrder[
"DELIVERY_LOCATION_ZIP"] = $curVal;
233 if ($arOrderProp[
"IS_EMAIL"] ==
"Y")
235 $arOrder[
"USER_EMAIL"] = $curVal;
243 elseif ($arOrderProp[
"REQUIED"] ==
"Y")
245 if ($arOrderProp[
"TYPE"] ==
"TEXT" || $arOrderProp[
"TYPE"] ==
"TEXTAREA" || $arOrderProp[
"TYPE"] ==
"RADIO" || $arOrderProp[
"TYPE"] ==
"SELECT" || $arOrderProp[
"TYPE"] ==
"CHECKBOX")
250 elseif ($arOrderProp[
"TYPE"] ==
"LOCATION")
252 if (intval($curVal) <= 0)
255 elseif ($arOrderProp[
"TYPE"] ==
"MULTISELECT")
261 elseif ($arOrderProp[
"TYPE"] ==
"FILE")
263 if (is_array($curVal))
265 foreach ($curVal as $index => $arFileData)
267 if (!array_key_exists(
"name", $arFileData) && !array_key_exists(
"file_id", $arFileData))
278 if ($bErrorField ??
false)
281 $bErrorField =
false;
284 $arOrder[
"ORDER_PROP"][$arOrderProp[
"ID"]] = $curVal;
305 array(
"ID",
"ORDER_PROPS_ID")
311 "PERSON_TYPE_ID" => $personTypeId,
315 if ($paysystemId != 0)
317 $arFilter[
"RELATED"][
"PAYSYSTEM_ID"] = $paysystemId;
318 $arFilter[
"RELATED"][
"TYPE"] =
"WITH_NOT_RELATED";
321 if ($deliveryId <>
'')
323 $arFilter[
"RELATED"][
"DELIVERY_ID"] = $deliveryId;
324 $arFilter[
"RELATED"][
"TYPE"] =
"WITH_NOT_RELATED";
328 array(
"SORT" =>
"ASC"),
332 array(
"ID",
"TYPE",
"NAME",
"CODE",
"USER_PROPS",
"SORT")
334 while ($arOrderProperty = $dbOrderProperties->Fetch())
336 $curVal = $arOrderProps[$arOrderProperty[
"ID"]];
338 if (($arOrderProperty[
"TYPE"] ==
"MULTISELECT") && is_array($curVal))
339 $curVal = implode(
",", $curVal);
341 if ($arOrderProperty[
"TYPE"] ==
"FILE" && is_array($curVal))
344 foreach ($curVal as $index => $fileData)
347 if (isset($fileData[
"file_id"]))
349 if (isset($fileData[
"del"]))
351 $arFile = CFile::MakeFileArray($fileData[
"file_id"]);
352 $arFile[
"del"] = $fileData[
"del"];
353 $arFile[
"old_file"] = $fileData[
"file_id"];
359 $tmpVal .=
", ".$fileData[
"file_id"];
361 $tmpVal = $fileData[
"file_id"];
367 if (isset($arFile[
"name"]) && $arFile[
"name"] <>
'' && $bModify)
369 $arFile[
"MODULE_ID"] =
"sale";
370 $fid = CFile::SaveFile($arFile,
"sale");
371 if (intval($fid) > 0)
374 $tmpVal .=
", ".$fid;
388 "ORDER_PROPS_ID" => $arOrderProperty[
"ID"],
389 "NAME" => $arOrderProperty[
"NAME"],
390 "CODE" => $arOrderProperty[
"CODE"],
394 if (array_key_exists($arOrderProperty[
"ID"], $arIDs))
397 unset($arIDs[$arOrderProperty[
"ID"]]);
406 foreach ($arIDs as $id)
412 if (!is_array($arOrder) && !is_array(
$arFilter))
414 $arOrder = strval($arOrder);
420 if (is_array($arGroupBy))
426 $arSelectFields =
array();
434 $defaultSelectFields =
array(
441 "DEFAULT_VALUE_ORIG",
458 "INPUT_FIELD_LOCATION",
464 if (! $arSelectFields)
466 $arSelectFields = $defaultSelectFields;
469 if (is_array($arSelectFields) && in_array(
"*", $arSelectFields))
471 $key = array_search(
'*', $arSelectFields);
472 unset($arSelectFields[
$key]);
474 $arSelectFields = array_merge($arSelectFields, $defaultSelectFields);
476 $arSelectFields = array_unique($arSelectFields);
481 $query = new \Bitrix\Sale\Compatible\OrderQueryLocation(OrderPropsTable::getEntity());
482 $query->addLocationRuntimeField(
'DEFAULT_VALUE');
485 'REQUIED' =>
'REQUIRED',
486 'GROUP_ID' =>
'GROUP.ID',
487 'GROUP_PERSON_TYPE_ID' =>
'GROUP.PERSON_TYPE_ID',
488 'GROUP_NAME' =>
'GROUP.NAME',
489 'GROUP_SORT' =>
'GROUP.SORT',
490 'PERSON_TYPE_LID' =>
'PERSON_TYPE.LID',
491 'PERSON_TYPE_NAME' =>
'PERSON_TYPE.NAME',
492 'PERSON_TYPE_SORT' =>
'PERSON_TYPE.SORT',
493 'PERSON_TYPE_ACTIVE' =>
'PERSON_TYPE.ACTIVE',
498 $aliases[
'PAYSYSTEM_ID'] =
'RELATION_PS.ENTITY_ID';
499 $aliases[
'DELIVERY_ID'] =
'RELATION_DLV.ENTITY_ID';
502 $query->addAliases($aliases);
509 $query->registerRuntimeField(
512 'data_type' =>
'\Bitrix\Sale\Internals\OrderPropsRelationTable',
514 'ref.PROPERTY_ID' =>
'this.ID',
517 'join_type' =>
'left'
521 $query->registerRuntimeField(
524 'data_type' =>
'\Bitrix\Sale\Internals\OrderPropsRelationTable',
526 'ref.PROPERTY_ID' =>
'this.ID',
529 'join_type' =>
'left'
533 $relationFilter =
array();
535 if (
$arFilter[
'RELATED'][
'PAYSYSTEM_ID'])
537 $relationFilter[
'=RELATION_PS.ENTITY_ID'] =
$arFilter[
'RELATED'][
'PAYSYSTEM_ID'];
542 $relationFilter[
'=RELATION_DLV.ENTITY_ID'] =
$arFilter[
'RELATED'][
'DELIVERY_ID'];
545 $relationFilter[
'LOGIC'] =
$arFilter[
'RELATED'][
'LOGIC'] ==
'AND' ?
'AND' :
'OR';
550 if (
$arFilter[
'RELATED'][
'TYPE'] ==
'WITH_NOT_RELATED')
555 '=RELATION_PS.ENTITY_ID' =>
null,
556 '=RELATION_DLV.ENTITY_ID' => null
564 $query->addFilter(
null, $relationFilter);
570 $query->registerRuntimeField(
573 'data_type' =>
'\Bitrix\Sale\Internals\OrderPropsRelationTable',
575 'ref.PROPERTY_ID' =>
'this.ID',
577 'join_type' =>
'left'
581 $query->addFilter(
'RELATION.PROPERTY_ID',
null);
583 if ((
$key = array_search(
'PAYSYSTEM_ID', $arSelectFields)) !==
false)
585 unset($arSelectFields[
$key]);
588 if ((
$key = array_search(
'DELIVERY_ID', $arSelectFields)) !==
false)
590 unset($arSelectFields[
$key]);
599 foreach (
$arFilter[
'PERSON_TYPE_ID'] as $personTypeKey => $personTypeValue)
601 if (!is_array($personTypeValue) && !empty($personTypeValue) && intval($personTypeValue) > 0)
603 unset(
$arFilter[
'PERSON_TYPE_ID'][$personTypeKey]);
604 $arFilter[
'PERSON_TYPE_ID'][] = $personTypeValue;
615 return $query->exec()->getSelectedRowsCount();
619 $result = new \Bitrix\Sale\Compatible\CDBResult;
621 $adapter->addFieldProxy(
'DEFAULT_VALUE');
622 $result->addFetchAdapter($adapter);
630 return $id > 0 && $id ==
$ID
644 $APPLICATION->ThrowException(Loc::getMessage(
"SKGOP_EMPTY_PERS_TYPE"),
"ERROR_NO_PERSON_TYPE");
649 $APPLICATION->ThrowException(Loc::getMessage(
"SKGOP_EMPTY_PROP_NAME"),
"ERROR_NO_NAME");
654 $APPLICATION->ThrowException(Loc::getMessage(
"SKGOP_EMPTY_PROP_TYPE"),
"ERROR_NO_TYPE");
679 $APPLICATION->ThrowException(Loc::getMessage(
"SKGOP_WRONG_PROP_TYPE"),
"ERROR_WRONG_TYPE1");
684 $APPLICATION->ThrowException(Loc::getMessage(
"SKGOP_WRONG_PROP_TYPE"),
"ERROR_WRONG_TYPE2");
690 $APPLICATION->ThrowException(Loc::getMessage(
"SKGOP_EMPTY_PROP_GROUP"),
"ERROR_NO_GROUP");
698 $APPLICATION->ThrowException(str_replace(
"#ID#",
$arFields[
"PERSON_TYPE_ID"], Loc::getMessage(
"SKGOP_NO_PERS_TYPE")),
"ERROR_NO_PERSON_TYPE");
708 foreach (
GetModuleEvents(
'sale',
'OnBeforeOrderPropsAdd',
true) as $arEvent)
712 if (! self::CheckFields(
'ADD',
$arFields))
732 foreach (
GetModuleEvents(
'sale',
'OnBeforeOrderPropsUpdate',
true) as $arEvent)
745 foreach(
GetModuleEvents(
'sale',
'OnOrderPropsUpdate',
true) as $arEvent)
756 foreach (
GetModuleEvents(
'sale',
'OnBeforeOrderPropsDelete',
true) as $arEvent)
764 $DB->Query(
"DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = ".
$ID,
true);
765 $DB->Query(
"UPDATE b_sale_order_props_value SET ORDER_PROPS_ID = NULL WHERE ORDER_PROPS_ID = ".
$ID,
true);
766 $DB->Query(
"DELETE FROM b_sale_user_props_value WHERE ORDER_PROPS_ID = ".
$ID,
true);
767 $DB->Query(
"DELETE FROM b_sale_order_props_relation WHERE PROPERTY_ID = ".
$ID,
true);
770 foreach(
GetModuleEvents(
'sale',
'OnOrderPropsDelete',
true) as $arEvent)
773 return $DB->Query(
"DELETE FROM b_sale_order_props WHERE ID = ".
$ID,
true);
776 public static function GetRealValue($propertyID, $propertyCode, $propertyType, $value,
$lang =
false)
778 $propertyID = intval($propertyID);
779 $propertyCode = Trim($propertyCode);
780 $propertyType = Trim($propertyType);
787 $curKey = (($propertyCode <>
'') ? $propertyCode : $propertyID);
789 if ($propertyType ==
"SELECT" || $propertyType ==
"RADIO")
794 elseif ($propertyType ==
"MULTISELECT")
798 if (!is_array($value))
799 $value = explode(
",", $value);
807 $curValue .= $arValue1[
"NAME"];
813 elseif ($propertyType ==
"LOCATION")
826 $locationStreetPropertyValue =
'';
828 $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached();
830 while($item =
$res->fetch())
833 if($types[
'ID2CODE'][$item[
'TYPE_ID']] ==
'STREET')
835 $arResult[$curKey.
"_STREET"] = $item[
'LNAME'];
838 if($types[
'ID2CODE'][$item[
'TYPE_ID']] ==
'COUNTRY')
840 $arValue[
"COUNTRY_NAME"] = $item[
'LNAME'];
843 if($types[
'ID2CODE'][$item[
'TYPE_ID']] ==
'REGION')
845 $arValue[
"REGION_NAME"] = $item[
'LNAME'];
848 if($types[
'ID2CODE'][$item[
'TYPE_ID']] ==
'CITY')
850 $arValue[
"CITY_NAME"] = $item[
'LNAME'];
853 if($types[
'ID2CODE'][$item[
'TYPE_ID']] ==
'VILLAGE')
855 $arResult[$curKey.
"_VILLAGE"] = $item[
'LNAME'];
858 $path[] = $item[
'LNAME'];
861 $curValue = implode(
' - ',
$path);
872 $curValue = $arValue[
"COUNTRY_NAME"].(($arValue[
"COUNTRY_NAME"] ==
'' || $arValue[
"REGION_NAME"] ==
'') ?
"" :
" - ").$arValue[
"REGION_NAME"].(($arValue[
"COUNTRY_NAME"] ==
'' || $arValue[
"CITY_NAME"] ==
'') ?
"" :
" - ").$arValue[
"CITY_NAME"];
876 $arResult[$curKey.
"_COUNTRY"] = $arValue[
"COUNTRY_NAME"];
877 $arResult[$curKey.
"_REGION"] = $arValue[
"REGION_NAME"];
878 $arResult[$curKey.
"_CITY"] = $arValue[
"CITY_NAME"];
904 switch(mb_strtoupper(
$key))
907 $strSqlSearch .=
" AND PROPERTY_ID = '".trim(
$val).
"' ";
910 $strSqlSearch .=
" AND ENTITY_ID = '".trim(
$val).
"' ";
913 $strSqlSearch .=
" AND ENTITY_TYPE = '".trim(
$val).
"' ";
920 "FROM b_sale_order_props_relation ".
923 if ($strSqlSearch <>
'')
924 $strSql .=
" ".$strSqlSearch;
950 if (is_array($arEntityIDs))
952 foreach ($arEntityIDs as &$id)
954 $id =
$DB->ForSql($id);
960 $entityType =
$DB->ForSql($entityType, 1);
962 $DB->Query(
"DELETE FROM b_sale_order_props_relation WHERE PROPERTY_ID = '".
$DB->ForSql(
$ID).
"' AND ENTITY_TYPE = '".$entityType.
"'");
964 if (is_array($arEntityIDs))
966 foreach ($arEntityIDs as
$val)
968 if (strval(trim(
$val)) ==
'')
972 $arInsert =
$DB->PrepareInsert(
"b_sale_order_props_relation",
$arTmp);
975 "INSERT INTO b_sale_order_props_relation (PROPERTY_ID, ".$arInsert[0].
") ".
976 "VALUES('".$ID.
"', ".$arInsert[1].
")";
996 private $fieldProxy =
array();
1000 $this->
select =
$query->getSelectNamesAssoc() + array_flip($select);
1002 if (!
$query->aggregated())
1004 $query->addAliasSelect(
'TYPE');
1005 $query->addAliasSelect(
'SETTINGS');
1006 $query->addAliasSelect(
'MULTIPLE');
1008 $sel =
$query->getSelect();
1009 array_unshift($sel,
'PROPERTY_ID');
1016 if((
string) $field ==
'')
1019 $this->fieldProxy[
'PROXY_'.$field] = $field;
1026 if (!isset($newProperty[
'TYPE']))
1028 $newProperty[
'TYPE'] =
'STRING';
1031 if(is_array($newProperty))
1033 foreach($newProperty as
$k => $v)
1035 if(isset($this->fieldProxy[
$k]))
1037 unset($newProperty[
$k]);
1038 $newProperty[$this->fieldProxy[
$k]] = $v;
1044 if (array_key_exists(
'VALUE', $newProperty))
1046 $oldProperty[
'VALUE'] =
self::getOldValue($newProperty[
'VALUE'], $newProperty[
'TYPE']);
1049 return array_intersect_key($oldProperty, $this->
select);
1054 if (is_array($value))
1058 case 'ENUM': $value = implode(
',', $value);
break;
1059 case 'FILE': $value = implode(
', ', $value);
break;
1060 default : $value = reset($value);
1069 if (isset($property[
'REQUIRED']) && !empty($property[
'REQUIRED']))
1070 $property[
'REQUIED'] = $property[
'REQUIRED'];
1072 $settings = $property[
'SETTINGS'] ?? [];
1074 if (isset($property[
'TYPE']))
1076 switch ($property[
'TYPE'])
1082 $property[
'TYPE'] =
'TEXTAREA';
1083 $property[
'SIZE1'] =
$settings[
'COLS'] ??
null;
1084 $property[
'SIZE2'] =
$settings[
'ROWS'] ??
null;
1088 $property[
'TYPE'] =
'TEXT';
1089 $property[
'SIZE1'] =
$settings[
'SIZE'] ??
null;
1096 $property[
'TYPE'] =
'NUMBER';
1102 $property[
'TYPE'] =
'CHECKBOX';
1108 $property[
'TYPE'] =
'DATE';
1114 $property[
'TYPE'] =
'FILE';
1120 if ($property[
'MULTIPLE'] ==
'Y')
1122 $property[
'TYPE'] =
'MULTISELECT';
1123 $property[
'SIZE1'] =
$settings[
'SIZE'] ??
null;
1127 $property[
'TYPE'] =
'RADIO';
1131 $property[
'TYPE'] =
'SELECT';
1132 $property[
'SIZE1'] =
$settings[
'SIZE'] ??
null;
1139 $property[
'SIZE1'] =
$settings[
'SIZE'] ??
null;
1143 default: $property[
'TYPE'] =
'TEXT';
1154 if (isset($property[
'REQUIED']) && !empty($property[
'REQUIED']))
1155 $property[
'REQUIRED'] = $property[
'REQUIED'];
1157 $size1 = intval($property[
'SIZE1']);
1158 $size2 = intval($property[
'SIZE2']);
1163 switch ($property[
'TYPE'])
1167 $property[
'TYPE'] =
'STRING';
1176 $property[
'TYPE'] =
'STRING';
1190 $property[
'TYPE'] =
'Y/N';
1196 $property[
'TYPE'] =
'ENUM';
1204 $property[
'TYPE'] =
'ENUM';
1213 $property[
'TYPE'] =
'ENUM';
1215 $property[
'MULTIPLE'] =
'Y';
1225 if (intval($property[
'DEFAULT_VALUE']))
1227 $res = \Bitrix\Sale\Location\LocationTable::getList(
array(
'filter' =>
array(
'=ID' => intval($property[
'DEFAULT_VALUE'])),
'select' =>
array(
'CODE')))->fetch();
1228 if(is_array(
$res) && (
string)
$res[
'CODE'] !=
'')
1230 $property[
'DEFAULT_VALUE'] =
$res[
'CODE'];
1240 $propertySettings =
array();
1241 if (isset($property[
'SETTINGS']) && is_array($property[
'SETTINGS']))
1243 $propertySettings = $property[
'SETTINGS'];
1246 $property[
'SETTINGS'] = $propertySettings +
$settings;
1252 'PERSON_TYPE_ID'=>1,
'NAME'=>1,
'TYPE'=>1,
'REQUIRED'=>1,
'DEFAULT_VALUE'=>1,
'SORT'=>1,
'USER_PROPS'=>1,
1253 'IS_LOCATION'=>1,
'PROPS_GROUP_ID'=>1,
'DESCRIPTION'=>1,
'IS_EMAIL'=>1,
'IS_PROFILE_NAME'=>1,
'IS_PAYER'=>1,
1254 'IS_LOCATION4TAX'=>1,
'IS_FILTERED'=>1,
'CODE'=>1,
'IS_ZIP'=>1,
'IS_PHONE'=>1,
'ACTIVE'=>1,
'UTIL'=>1,
1255 'INPUT_FIELD_LOCATION'=>1,
'MULTIPLE'=>1,
'IS_ADDRESS'=>1,
'SETTINGS'=>1,
1260 $correctFields =
array(
1271 while ($oldProperty =
$result->fetch())
1274 $newProperty[
'IS_ADDRESS'] =
'N';
1276 foreach ($newProperty as
$key => $value)
1278 if (mb_strpos(
$key,
'IS_') === 0)
1280 $newProperty[
$key] = mb_strtoupper($value);
1284 $newProperty[
$key] = mb_strtoupper($value);
1288 $update = OrderPropsTable::update($newProperty[
'ID'], array_intersect_key($newProperty, self::$allFields));
1290 if ($update->isSuccess())
1296 $errors .=
'cannot update property: '.$oldProperty[
'ID'].
"\n".implode(
"\n", $update->getErrorMessages()).
"\n\n";
static getConnection($name="")
static getPathToNode($primary, $parameters, $behaviour=array('SHOW_LEAF'=> true))
static getInstance($type)
const REGISTRY_TYPE_ORDER
static getIdByCode($code)
static isLocationProMigrated()
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static Update($ID, $arFields)
static GetByValue($PropID, $Value)
static GetList($arOrder=array("SORT"=>"ASC", "COUNTRY_NAME_LANG"=>"ASC", "CITY_NAME_LANG"=>"ASC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetByID($primary, $strLang=LANGUAGE_ID)
static convertNewToOld(array $property)
static convertOldToNew(array $property)
static getOldValue($value, $type)
adapt(array $newProperty)
__construct(OrderQuery $query, array $select)
static GetOrderPropsRelations($arFilter=array())
static PrepareRelation4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static DoSaveOrderProps($orderId, $personTypeId, $arOrderProps, &$arErrors, $paysystemId=0, $deliveryId="")
static CheckFields($ACTION, &$arFields, $ID=0)
static UpdateOrderPropsRelations($ID, $arEntityIDs, $entityType)
static Update($ID, $arFields)
static GetRealValue($propertyID, $propertyCode, $propertyType, $value, $lang=false)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(!defined('SITE_ID')) $lang
ExecuteModuleEventEx($arEvent, $arParams=[])
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
GetMessage($name, $aReplace=null)
check_email($email, $strict=false, $domainCheck=false)
if(intval($iTestTransaction) > 0) $arTmp
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"