30 public function add(array $params)
36 $property = $params[
"ORDER_PROP"];
41 if (!empty($errorList))
43 foreach($errorList as $error)
45 $result->addError(
new Error(str_replace(
'<br>',
'', $error[
'TEXT'])));
50 $propertyOrders = static::getPropertyOrdersByPersonalTypeId(
$fields[
"PERSON_TYPE_ID"]);
52 if(is_array($propertyOrders))
54 foreach($propertyOrders as $filedsProperty)
56 $propertyId = $filedsProperty[
"ID"];
57 if(array_key_exists($propertyId, $property))
59 $propertyByConfigValue = $property[$propertyId];
60 if($profileId ==
null)
62 if(!empty($propertyByConfigValue))
64 $profileId = \CSaleOrderUserProps::Add(array(
65 "NAME" =>
$fields[
"AGENT_NAME"],
67 "PERSON_TYPE_ID" =>
$fields[
'PERSON_TYPE_ID'],
69 "VERSION_1C" =>
$fields[
"VERSION_1C"]
74 \CSaleOrderUserPropsValue::Add(array(
75 "USER_PROPS_ID" => $profileId,
76 "ORDER_PROPS_ID" => $propertyId,
77 "NAME" => $filedsProperty[
"NAME"],
78 "VALUE" => $propertyByConfigValue
85 if($result->isSuccess())