1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
order_props.php
См. документацию.
1<?
2
3use
12
13Loc::loadMessages(__FILE__);
14
17{
18 private static array $arUsers = [];
19
20 /*
21 * Checks order properties' values on the basis of order properties' restrictions
22 *
23 * @param array $arOrder - order data
24 * @param array $arOrderPropsValues - array of order properties values to be checked
25 * @param array $arErrors
26 * @param array $arWarnings
27 * @param int $paysystemId - id of the paysystem, will be used to get order properties related to this paysystem
28 * @param int $deliveryId - id of the delivery sysetm, will be used to get order properties related to this delivery system
29 */
30 public static function DoProcessOrder(&$arOrder, $arOrderPropsValues, &$arErrors, &$arWarnings, $paysystemId = 0, $deliveryId = "", $arOptions = array())
31 {
32 if (!is_array($arOrderPropsValues))
33 $arOrderPropsValues = array();
34
35 $arUser = self::$arUsers[$arOrder['USER_ID']] ?? null;
36
37 $arFilter = [
38 "=PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
39 "=ACTIVE" => "Y"
40 ];
41
42 $relationFilter = [];
43 if ($paysystemId > 0)
44 {
45 $relationFilter[] = [
46 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_TYPE' => 'P',
47 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_ID' => $paysystemId,
48 ];
49 }
50
51 if ($deliveryId <> '')
52 {
53 if ($paysystemId > 0)
54 {
55 $relationFilter['LOGIC'] = 'OR';
56 }
57
58 $relationFilter[] = [
59 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_TYPE' => 'D',
60 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.ENTITY_ID' => \CSaleDelivery::getIdByCode($deliveryId),
61 ];
62 }
63
64 $arFilter[] = [
65 'LOGIC' => 'OR',
66 $relationFilter,
67 [
68 '=Bitrix\Sale\Internals\OrderPropsRelationTable:lPROPERTY.PROPERTY_ID' => null
69 ],
70 ];
71
72 if (isset($arOptions['ORDER'])
73 && $arOptions['ORDER'] instanceof \Bitrix\Sale\Order
74 )
75 {
76 $registry = \Bitrix\Sale\Registry::getInstance($arOptions['ORDER']::getRegistryType());
77 $property = $registry->getPropertyClassName();
78 }
79 else
80 {
81 $property = \Bitrix\Sale\Property::class;
82 }
83
85 $dbRes = $property::getlist([
86 'select' => [
87 'ID', 'NAME', 'TYPE', 'IS_LOCATION', 'IS_LOCATION4TAX', 'IS_PROFILE_NAME', 'IS_PAYER', 'IS_EMAIL',
88 'REQUIRED', 'SORT', 'IS_ZIP', 'CODE', 'DEFAULT_VALUE'
89 ],
90 'filter' => $arFilter,
91 'order' => ['SORT' => 'ASC']
92 ]);
93
94 while ($arOrderProp = $dbRes->fetch())
95 {
96 $arOrderProp = CSaleOrderPropsAdapter::convertNewToOld($arOrderProp);
97 if (!array_key_exists($arOrderProp["ID"], $arOrderPropsValues))
98 {
99 $curVal = $arOrderProp["DEFAULT_VALUE"];
100
101 if (!is_array($curVal) && $curVal == '')
102 {
103 if ($arOrderProp["IS_EMAIL"] == "Y" || $arOrderProp["IS_PAYER"] == "Y")
104 {
105 if ($arUser == null)
106 {
107 $dbUser = CUser::GetList(
108 'ID',
109 'desc',
110 ['ID_EQUAL_EXACT' => $arOrder['USER_ID']],
111 [
112 'FIELDS' => ['EMAIL', 'NAME', 'LAST_NAME'],
113 ],
114 );
115 $arUser = $dbUser->Fetch();
116 self::$arUsers[$arOrder['USER_ID']] = $arUser;
117 }
118 if ($arOrderProp['IS_EMAIL'] === 'Y')
119 {
120 $curVal = is_array($arUser) ? $arUser['EMAIL'] : '';
121 }
122 elseif ($arOrderProp['IS_PAYER'] === 'Y')
123 {
124 $curVal =
125 is_array($arUser)
126 ? $arUser['NAME'].($arUser['NAME'] == '' || $arUser['LAST_NAME'] == '' ? '' : ' ') . $arUser['LAST_NAME']
127 : ''
128 ;
129 }
130 }
131 }
132 }
133 else
134 {
135 $curVal = $arOrderPropsValues[$arOrderProp["ID"]];
136 }
137
138 if ((!is_array($curVal) && $curVal <> '') || (is_array($curVal) && count($curVal) > 0))
139 {
140 //if ($arOrderProp["TYPE"] == "SELECT" || $arOrderProp["TYPE"] == "MULTISELECT" || $arOrderProp["TYPE"] == "RADIO")
141 if ($arOrderProp["TYPE"] == "SELECT" || $arOrderProp["TYPE"] == "RADIO")
142 {
143 $arVariants = array();
145 array("SORT" => "ASC", "NAME" => "ASC"),
146 array("ORDER_PROPS_ID" => $arOrderProp["ID"]),
147 false,
148 false,
149 array("*")
150 );
151 while ($arVariant = $dbVariants->Fetch())
152 $arVariants[] = $arVariant["VALUE"];
153
154 if (!is_array($curVal))
155 $curVal = array($curVal);
156
157 $arKeys = array_keys($curVal);
158 foreach ($arKeys as $k)
159 {
160 if (!in_array($curVal[$k], $arVariants))
161 unset($curVal[$k]);
162 }
163
164 if ($arOrderProp["TYPE"] == "SELECT" || $arOrderProp["TYPE"] == "RADIO")
165 $curVal = array_shift($curVal);
166 }
167 elseif ($arOrderProp["TYPE"] == "LOCATION")
168 {
169 if (is_array($curVal))
170 $curVal = array_shift($curVal);
171
173 {
174 // if we came from places like CRM, we got location in CODEs, because CRM knows nothing about location IDs.
175 // so, CRM sends LOCATION_IN_CODES in options array. In the other case, we assume we got locations as IDs
176 $res = CSaleLocation::GetById($curVal);
177 if ($res)
178 {
179 $curVal = $res['ID'];
180 $locId = $res['ID'];
181 }
182 else
183 {
184 $curVal = null;
185 $locId = false;
186 }
187 }
188 else // dead branch in 15.5.x
189 {
190 $dbVariants = CSaleLocation::GetList(
191 array(),
192 array("ID" => $curVal),
193 false,
194 false,
195 array("ID")
196 );
197 if ($arVariant = $dbVariants->Fetch())
198 $curVal = intval($arVariant["ID"]);
199 else
200 $curVal = null;
201 }
202 }
203 }
204
205 if ($arOrderProp["TYPE"] == "LOCATION" && ($arOrderProp["IS_LOCATION"] == "Y" || $arOrderProp["IS_LOCATION4TAX"] == "Y"))
206 {
207 $locId ??= null;
208
209 if ($arOrderProp["IS_LOCATION"] === "Y")
210 {
211 $arOrder["DELIVERY_LOCATION"] = $locId;
212 }
213
214 if ($arOrderProp["IS_LOCATION4TAX"] === "Y")
215 {
216 $arOrder["TAX_LOCATION"] = $locId;
217 }
218
219 if (!$locId)
220 {
221 $bErrorField = true;
222 }
223 }
224 elseif ($arOrderProp["IS_PROFILE_NAME"] == "Y" || $arOrderProp["IS_PAYER"] == "Y" || $arOrderProp["IS_EMAIL"] == "Y" || $arOrderProp["IS_ZIP"] == "Y")
225 {
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")
234 {
235 $arOrder["USER_EMAIL"] = $curVal;
236 if (!check_email($curVal))
237 $arWarnings[] = array("CODE" => "PARAM", "TEXT" => str_replace(array("#EMAIL#", "#NAME#"), array(htmlspecialcharsbx($curVal), htmlspecialcharsbx($arOrderProp["NAME"])), GetMessage("SALE_GOPE_WRONG_EMAIL")));
238 }
239
240 if ($curVal == '')
241 $bErrorField = true;
242 }
243 elseif ($arOrderProp["REQUIED"] == "Y")
244 {
245 if ($arOrderProp["TYPE"] == "TEXT" || $arOrderProp["TYPE"] == "TEXTAREA" || $arOrderProp["TYPE"] == "RADIO" || $arOrderProp["TYPE"] == "SELECT" || $arOrderProp["TYPE"] == "CHECKBOX")
246 {
247 if ($curVal == '')
248 $bErrorField = true;
249 }
250 elseif ($arOrderProp["TYPE"] == "LOCATION")
251 {
252 if (intval($curVal) <= 0)
253 $bErrorField = true;
254 }
255 elseif ($arOrderProp["TYPE"] == "MULTISELECT")
256 {
257 //if (!is_array($curVal) || count($curVal) <= 0)
258 if ($curVal == '')
259 $bErrorField = true;
260 }
261 elseif ($arOrderProp["TYPE"] == "FILE")
262 {
263 if (is_array($curVal))
264 {
265 foreach ($curVal as $index => $arFileData)
266 {
267 if (!array_key_exists("name", $arFileData) && !array_key_exists("file_id", $arFileData))
268 $bErrorField = true;
269 }
270 }
271 else
272 {
273 $bErrorField = true;
274 }
275 }
276 }
277
278 if ($bErrorField ?? false)
279 {
280 $arWarnings[] = array("CODE" => "PARAM", "TEXT" => str_replace("#NAME#", htmlspecialcharsbx($arOrderProp["NAME"]), GetMessage("SALE_GOPE_FIELD_EMPTY")));
281 $bErrorField = false;
282 }
283
284 $arOrder["ORDER_PROP"][$arOrderProp["ID"]] = $curVal;
285 }
286 }
287
288 /*
289 * Updates/adds order properties' values
290 *
291 * @param array $orderId
292 * @param array $personTypeId
293 * @param array $arOrderProps - array of order properties values
294 * @param array $arErrors
295 */
296 public static function DoSaveOrderProps($orderId, $personTypeId, $arOrderProps, &$arErrors, $paysystemId = 0, $deliveryId = "")
297 {
298 $arIDs = array();
300 array(),
301 //array("ORDER_ID" => $orderId, "PROP_UTIL" => "N"),
302 array("ORDER_ID" => $orderId),
303 false,
304 false,
305 array("ID", "ORDER_PROPS_ID")
306 );
307 while ($arResult = $dbResult->Fetch())
308 $arIDs[$arResult["ORDER_PROPS_ID"]] = $arResult["ID"];
309
311 "PERSON_TYPE_ID" => $personTypeId,
312 "ACTIVE" => "Y"
313 );
314
315 if ($paysystemId != 0)
316 {
317 $arFilter["RELATED"]["PAYSYSTEM_ID"] = $paysystemId;
318 $arFilter["RELATED"]["TYPE"] = "WITH_NOT_RELATED";
319 }
320
321 if ($deliveryId <> '')
322 {
323 $arFilter["RELATED"]["DELIVERY_ID"] = $deliveryId;
324 $arFilter["RELATED"]["TYPE"] = "WITH_NOT_RELATED";
325 }
326
327 $dbOrderProperties = CSaleOrderProps::GetList(
328 array("SORT" => "ASC"),
329 $arFilter,
330 false,
331 false,
332 array("ID", "TYPE", "NAME", "CODE", "USER_PROPS", "SORT")
333 );
334 while ($arOrderProperty = $dbOrderProperties->Fetch())
335 {
336 $curVal = $arOrderProps[$arOrderProperty["ID"]];
337
338 if (($arOrderProperty["TYPE"] == "MULTISELECT") && is_array($curVal))
339 $curVal = implode(",", $curVal);
340
341 if ($arOrderProperty["TYPE"] == "FILE" && is_array($curVal))
342 {
343 $tmpVal = "";
344 foreach ($curVal as $index => $fileData)
345 {
346 $bModify = true;
347 if (isset($fileData["file_id"])) // existing file
348 {
349 if (isset($fileData["del"]))
350 {
351 $arFile = CFile::MakeFileArray($fileData["file_id"]);
352 $arFile["del"] = $fileData["del"];
353 $arFile["old_file"] = $fileData["file_id"];
354 }
355 else
356 {
357 $bModify = false;
358 if ($tmpVal <> '')
359 $tmpVal .= ", ".$fileData["file_id"];
360 else
361 $tmpVal = $fileData["file_id"];
362 }
363 }
364 else // new file array
365 $arFile = $fileData;
366
367 if (isset($arFile["name"]) && $arFile["name"] <> '' && $bModify)
368 {
369 $arFile["MODULE_ID"] = "sale";
370 $fid = CFile::SaveFile($arFile, "sale");
371 if (intval($fid) > 0)
372 {
373 if ($tmpVal <> '')
374 $tmpVal .= ", ".$fid;
375 else
376 $tmpVal = $fid;
377 }
378 }
379 }
380
381 $curVal = $tmpVal;
382 }
383
384 if ($curVal <> '')
385 {
387 "ORDER_ID" => $orderId,
388 "ORDER_PROPS_ID" => $arOrderProperty["ID"],
389 "NAME" => $arOrderProperty["NAME"],
390 "CODE" => $arOrderProperty["CODE"],
391 "VALUE" => $curVal
392 );
393
394 if (array_key_exists($arOrderProperty["ID"], $arIDs))
395 {
396 CSaleOrderPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
397 unset($arIDs[$arOrderProperty["ID"]]);
398 }
399 else
400 {
402 }
403 }
404 }
405
406 foreach ($arIDs as $id)
408 }
409
410 public static function GetList($arOrder = array(), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
411 {
412 if (!is_array($arOrder) && !is_array($arFilter))
413 {
414 $arOrder = strval($arOrder);
415 $arFilter = strval($arFilter);
416 if ($arOrder <> '' && $arFilter <> '')
417 $arOrder = array($arOrder => $arFilter);
418 else
419 $arOrder = array();
420 if (is_array($arGroupBy))
421 $arFilter = $arGroupBy;
422 else
423 $arFilter = array();
424 $arGroupBy = false;
425
426 $arSelectFields = array();
427 }
428
429 if (is_array($arFilter))
430 {
431 $arFilter['ENTITY_REGISTRY_TYPE'] = \Bitrix\Sale\Registry::REGISTRY_TYPE_ORDER;
432 }
433
434 $defaultSelectFields = array(
435 "ID",
436 "PERSON_TYPE_ID",
437 "NAME",
438 "TYPE",
439 "REQUIED",
440 "DEFAULT_VALUE",
441 "DEFAULT_VALUE_ORIG",
442 "SORT",
443 "USER_PROPS",
444 "IS_LOCATION",
445 "PROPS_GROUP_ID",
446 "SIZE1",
447 "SIZE2",
448 "DESCRIPTION",
449 "IS_EMAIL",
450 "IS_PROFILE_NAME",
451 "IS_PAYER",
452 "IS_LOCATION4TAX",
453 "IS_ZIP",
454 "CODE",
455 "IS_FILTERED",
456 "ACTIVE",
457 "UTIL",
458 "INPUT_FIELD_LOCATION",
459 "MULTIPLE",
460 "PAYSYSTEM_ID",
461 "DELIVERY_ID"
462 );
463
464 if (! $arSelectFields)
465 {
466 $arSelectFields = $defaultSelectFields;
467 }
468
469 if (is_array($arSelectFields) && in_array("*", $arSelectFields))
470 {
471 $key = array_search('*', $arSelectFields);
472 unset($arSelectFields[$key]);
473
474 $arSelectFields = array_merge($arSelectFields, $defaultSelectFields);
475
476 $arSelectFields = array_unique($arSelectFields);
477 }
478
479 // add aliases
480
481 $query = new \Bitrix\Sale\Compatible\OrderQueryLocation(OrderPropsTable::getEntity());
482 $query->addLocationRuntimeField('DEFAULT_VALUE');
483
484 $aliases = [
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',
494 ];
495
496 if (isset($arFilter['RELATED']) && is_array($arFilter['RELATED']))
497 {
498 $aliases['PAYSYSTEM_ID'] = 'RELATION_PS.ENTITY_ID';
499 $aliases['DELIVERY_ID'] = 'RELATION_DLV.ENTITY_ID';
500 }
501
502 $query->addAliases($aliases);
503
504 // relations
505 if (isset($arFilter['RELATED']))
506 {
507 if (is_array($arFilter['RELATED']))
508 {
509 $query->registerRuntimeField(
510 'RELATION_DLV',
511 [
512 'data_type' => '\Bitrix\Sale\Internals\OrderPropsRelationTable',
513 'reference' => [
514 'ref.PROPERTY_ID' => 'this.ID',
515 "=ref.ENTITY_TYPE" => new DB\SqlExpression('?', 'D')
516 ],
517 'join_type' => 'left'
518 ]
519 );
520
521 $query->registerRuntimeField(
522 'RELATION_PS',
523 [
524 'data_type' => '\Bitrix\Sale\Internals\OrderPropsRelationTable',
525 'reference' => [
526 'ref.PROPERTY_ID' => 'this.ID',
527 "=ref.ENTITY_TYPE" => new DB\SqlExpression('?', 'P')
528 ],
529 'join_type' => 'left'
530 ]
531 );
532
533 $relationFilter = array();
534
535 if ($arFilter['RELATED']['PAYSYSTEM_ID'])
536 {
537 $relationFilter['=RELATION_PS.ENTITY_ID'] = $arFilter['RELATED']['PAYSYSTEM_ID'];
538 }
539
540 if ($arFilter['RELATED']['DELIVERY_ID'])
541 {
542 $relationFilter['=RELATION_DLV.ENTITY_ID'] = $arFilter['RELATED']['DELIVERY_ID'];
543 if ($relationFilter)
544 {
545 $relationFilter['LOGIC'] = $arFilter['RELATED']['LOGIC'] == 'AND' ? 'AND' : 'OR';
546 }
547 }
548
549
550 if ($arFilter['RELATED']['TYPE'] == 'WITH_NOT_RELATED')
551 {
552 $relationFilter = [
553 'LOGIC' => 'OR',
554 [
555 '=RELATION_PS.ENTITY_ID' => null,
556 '=RELATION_DLV.ENTITY_ID' => null
557 ],
558 $relationFilter
559 ];
560 }
561
562 if ($relationFilter)
563 {
564 $query->addFilter(null, $relationFilter);
565 }
566 }
567 // 2. filter all not related to anything
568 else
569 {
570 $query->registerRuntimeField(
571 'RELATION',
572 [
573 'data_type' => '\Bitrix\Sale\Internals\OrderPropsRelationTable',
574 'reference' => [
575 'ref.PROPERTY_ID' => 'this.ID',
576 ],
577 'join_type' => 'left'
578 ]
579 );
580
581 $query->addFilter('RELATION.PROPERTY_ID', null);
582
583 if (($key = array_search('PAYSYSTEM_ID', $arSelectFields)) !== false)
584 {
585 unset($arSelectFields[$key]);
586 }
587
588 if (($key = array_search('DELIVERY_ID', $arSelectFields)) !== false)
589 {
590 unset($arSelectFields[$key]);
591 }
592 }
593
594 unset($arFilter['RELATED']);
595 }
596
597 if (isset($arFilter['PERSON_TYPE_ID']) && is_array($arFilter['PERSON_TYPE_ID']))
598 {
599 foreach ($arFilter['PERSON_TYPE_ID'] as $personTypeKey => $personTypeValue)
600 {
601 if (!is_array($personTypeValue) && !empty($personTypeValue) && intval($personTypeValue) > 0)
602 {
603 unset($arFilter['PERSON_TYPE_ID'][$personTypeKey]);
604 $arFilter['PERSON_TYPE_ID'][] = $personTypeValue;
605 }
606 }
607 }
608
609 // execute
610
611 $query->prepare($arOrder, $arFilter, $arGroupBy, $arSelectFields);
612
613 if ($query->counted())
614 {
615 return $query->exec()->getSelectedRowsCount();
616 }
617 else
618 {
619 $result = new \Bitrix\Sale\Compatible\CDBResult;
620 $adapter = new CSaleOrderPropsAdapter($query, $arSelectFields);
621 $adapter->addFieldProxy('DEFAULT_VALUE');
622 $result->addFetchAdapter($adapter);
623 return $query->compatibleExec($result, $arNavStartParams);
624 }
625 }
626
627 public static function GetByID($ID)
628 {
629 $id = (int) $ID;
630 return $id > 0 && $id == $ID
631 ? self::GetList(array(), array('ID' => $ID))->Fetch()
632 : false;
633 }
634
635 public static function CheckFields($ACTION, &$arFields, $ID = 0)
636 {
637 global $APPLICATION;
638
639 if (is_set($arFields, "PERSON_TYPE_ID") && $ACTION != "ADD")
640 UnSet($arFields["PERSON_TYPE_ID"]);
641
642 if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION=="ADD") && intval($arFields["PERSON_TYPE_ID"]) <= 0)
643 {
644 $APPLICATION->ThrowException(Loc::getMessage("SKGOP_EMPTY_PERS_TYPE"), "ERROR_NO_PERSON_TYPE");
645 return false;
646 }
647 if ((is_set($arFields, "NAME") || $ACTION=="ADD") && $arFields["NAME"] == '')
648 {
649 $APPLICATION->ThrowException(Loc::getMessage("SKGOP_EMPTY_PROP_NAME"), "ERROR_NO_NAME");
650 return false;
651 }
652 if ((is_set($arFields, "TYPE") || $ACTION=="ADD") && $arFields["TYPE"] == '')
653 {
654 $APPLICATION->ThrowException(Loc::getMessage("SKGOP_EMPTY_PROP_TYPE"), "ERROR_NO_TYPE");
655 return false;
656 }
657
658 if (is_set($arFields, "REQUIED") && $arFields["REQUIED"]!="Y")
659 $arFields["REQUIED"]="N";
660 if (is_set($arFields, "USER_PROPS") && $arFields["USER_PROPS"]!="Y")
661 $arFields["USER_PROPS"]="N";
662 if (is_set($arFields, "IS_LOCATION") && $arFields["IS_LOCATION"]!="Y")
663 $arFields["IS_LOCATION"]="N";
664 if (is_set($arFields, "IS_LOCATION4TAX") && $arFields["IS_LOCATION4TAX"]!="Y")
665 $arFields["IS_LOCATION4TAX"]="N";
666 if (is_set($arFields, "IS_EMAIL") && $arFields["IS_EMAIL"]!="Y")
667 $arFields["IS_EMAIL"]="N";
668 if (is_set($arFields, "IS_PROFILE_NAME") && $arFields["IS_PROFILE_NAME"]!="Y")
669 $arFields["IS_PROFILE_NAME"]="N";
670 if (is_set($arFields, "IS_PAYER") && $arFields["IS_PAYER"]!="Y")
671 $arFields["IS_PAYER"]="N";
672 if (is_set($arFields, "IS_FILTERED") && $arFields["IS_FILTERED"]!="Y")
673 $arFields["IS_FILTERED"]="N";
674 if (is_set($arFields, "IS_ZIP") && $arFields["IS_ZIP"]!="Y")
675 $arFields["IS_ZIP"]="N";
676
677 if (is_set($arFields, "IS_LOCATION") && is_set($arFields, "TYPE") && $arFields["IS_LOCATION"]=="Y" && $arFields["TYPE"]!="LOCATION")
678 {
679 $APPLICATION->ThrowException(Loc::getMessage("SKGOP_WRONG_PROP_TYPE"), "ERROR_WRONG_TYPE1");
680 return false;
681 }
682 if (is_set($arFields, "IS_LOCATION4TAX") && is_set($arFields, "TYPE") && $arFields["IS_LOCATION4TAX"]=="Y" && $arFields["TYPE"]!="LOCATION")
683 {
684 $APPLICATION->ThrowException(Loc::getMessage("SKGOP_WRONG_PROP_TYPE"), "ERROR_WRONG_TYPE2");
685 return false;
686 }
687
688 if ((is_set($arFields, "PROPS_GROUP_ID") || $ACTION=="ADD") && intval($arFields["PROPS_GROUP_ID"])<=0)
689 {
690 $APPLICATION->ThrowException(Loc::getMessage("SKGOP_EMPTY_PROP_GROUP"), "ERROR_NO_GROUP");
691 return false;
692 }
693
694 if (is_set($arFields, "PERSON_TYPE_ID"))
695 {
696 if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"])))
697 {
698 $APPLICATION->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], Loc::getMessage("SKGOP_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE");
699 return false;
700 }
701 }
702
703 return true;
704 }
705
706 public static function Add($arFields)
707 {
708 foreach (GetModuleEvents('sale', 'OnBeforeOrderPropsAdd', true) as $arEvent)
709 if (ExecuteModuleEventEx($arEvent, array(&$arFields)) === false)
710 return false;
711
712 if (! self::CheckFields('ADD', $arFields))
713 return false;
714
716 $fields = array_intersect_key($newProperty, CSaleOrderPropsAdapter::$allFields);
717 $fields['ENTITY_REGISTRY_TYPE'] = \Bitrix\Sale\Registry::REGISTRY_TYPE_ORDER;
718
719 $ID = OrderPropsTable::add($fields)->getId();
720
721 foreach(GetModuleEvents('sale', 'OnOrderPropsAdd', true) as $arEvent)
723
724 return $ID;
725 }
726
727 public static function Update($ID, $arFields)
728 {
729 if (! $ID)
730 return false;
731
732 foreach (GetModuleEvents('sale', 'OnBeforeOrderPropsUpdate', true) as $arEvent)
733 if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false)
734 return false;
735
736 if (! self::CheckFields('UPDATE', $arFields, $ID))
737 return false;
738
739 $oldFields = self::GetList(array(), array('ID' => $ID), false, false, array('SETTINGS', '*' ))->Fetch();
740 $propertyFields = $arFields + $oldFields;
741
743 OrderPropsTable::update($ID, array_intersect_key($newProperty, CSaleOrderPropsAdapter::$allFields));
744
745 foreach(GetModuleEvents('sale', 'OnOrderPropsUpdate', true) as $arEvent)
747
748 return $ID;
749 }
750
751 public static function Delete($ID)
752 {
753 if (! $ID)
754 return false;
755
756 foreach (GetModuleEvents('sale', 'OnBeforeOrderPropsDelete', true) as $arEvent)
757 if (ExecuteModuleEventEx($arEvent, array($ID)) === false)
758 return false;
759
760 global $DB;
761
762 $ID = (int)$ID;
763
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);
769
770 foreach(GetModuleEvents('sale', 'OnOrderPropsDelete', true) as $arEvent)
771 ExecuteModuleEventEx($arEvent, array($ID));
772
773 return $DB->Query("DELETE FROM b_sale_order_props WHERE ID = ".$ID, true);
774 }
775
776 public static function GetRealValue($propertyID, $propertyCode, $propertyType, $value, $lang = false)
777 {
778 $propertyID = intval($propertyID);
779 $propertyCode = Trim($propertyCode);
780 $propertyType = Trim($propertyType);
781
782 if ($lang === false)
783 $lang = LANGUAGE_ID;
784
785 $arResult = array();
786
787 $curKey = (($propertyCode <> '') ? $propertyCode : $propertyID);
788
789 if ($propertyType == "SELECT" || $propertyType == "RADIO")
790 {
791 $arValue = CSaleOrderPropsVariant::GetByValue($propertyID, $value);
792 $arResult[$curKey] = $arValue["NAME"];
793 }
794 elseif ($propertyType == "MULTISELECT")
795 {
796 $curValue = "";
797
798 if (!is_array($value))
799 $value = explode(",", $value);
800
801 for ($i = 0, $max = count($value); $i < $max; $i++)
802 {
803 if ($arValue1 = CSaleOrderPropsVariant::GetByValue($propertyID, $value[$i]))
804 {
805 if ($i > 0)
806 $curValue .= ",";
807 $curValue .= $arValue1["NAME"];
808 }
809 }
810
811 $arResult[$curKey] = $curValue;
812 }
813 elseif ($propertyType == "LOCATION")
814 {
816 {
817 $curValue = '';
818 if($value <> '')
819 {
820 $arValue = array();
821
822 if(intval($value))
823 {
824 try
825 {
826 $locationStreetPropertyValue = '';
827 $res = \Bitrix\Sale\Location\LocationTable::getPathToNode($value, array('select' => array('LNAME' => 'NAME.NAME', 'TYPE_ID'), 'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID)));
828 $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached();
829 $path = array();
830 while($item = $res->fetch())
831 {
832 // copy street to STREET property
833 if($types['ID2CODE'][$item['TYPE_ID']] == 'STREET')
834 {
835 $arResult[$curKey."_STREET"] = $item['LNAME'];
836 }
837
838 if($types['ID2CODE'][$item['TYPE_ID']] == 'COUNTRY')
839 {
840 $arValue["COUNTRY_NAME"] = $item['LNAME'];
841 }
842
843 if($types['ID2CODE'][$item['TYPE_ID']] == 'REGION')
844 {
845 $arValue["REGION_NAME"] = $item['LNAME'];
846 }
847
848 if($types['ID2CODE'][$item['TYPE_ID']] == 'CITY')
849 {
850 $arValue["CITY_NAME"] = $item['LNAME'];
851 }
852
853 if($types['ID2CODE'][$item['TYPE_ID']] == 'VILLAGE')
854 {
855 $arResult[$curKey."_VILLAGE"] = $item['LNAME'];
856 }
857
858 $path[] = $item['LNAME'];
859 }
860
861 $curValue = implode(' - ', $path);
862 }
863 catch(\Bitrix\Main\SystemException $e)
864 {
865 }
866 }
867 }
868 }
869 else
870 {
871 $arValue = CSaleLocation::GetByID($value, $lang);
872 $curValue = $arValue["COUNTRY_NAME"].(($arValue["COUNTRY_NAME"] == '' || $arValue["REGION_NAME"] == '') ? "" : " - ").$arValue["REGION_NAME"].(($arValue["COUNTRY_NAME"] == '' || $arValue["CITY_NAME"] == '') ? "" : " - ").$arValue["CITY_NAME"];
873 }
874
875 $arResult[$curKey] = $curValue;
876 $arResult[$curKey."_COUNTRY"] = $arValue["COUNTRY_NAME"];
877 $arResult[$curKey."_REGION"] = $arValue["REGION_NAME"];
878 $arResult[$curKey."_CITY"] = $arValue["CITY_NAME"];
879 }
880 else
881 {
882 $arResult[$curKey] = $value;
883 }
884
885 return $arResult;
886 }
887
888 /*
889 * Get order property relations
890 *
891 * @param array $arFilter with keys: PROPERTY_ID, ENTITY_ID, ENTITY_TYPE
892 * @return dbResult
893 */
894 public static function GetOrderPropsRelations($arFilter = array())
895 {
896 global $DB;
897
898 $strSqlSearch = "";
899
900 foreach ($arFilter as $key => $val)
901 {
902 $val = $DB->ForSql($val);
903
904 switch(mb_strtoupper($key))
905 {
906 case "PROPERTY_ID":
907 $strSqlSearch .= " AND PROPERTY_ID = '".trim($val)."' ";
908 break;
909 case "ENTITY_ID":
910 $strSqlSearch .= " AND ENTITY_ID = '".trim($val)."' ";
911 break;
912 case "ENTITY_TYPE":
913 $strSqlSearch .= " AND ENTITY_TYPE = '".trim($val)."' ";
914 break;
915 }
916 }
917
918 $strSql =
919 "SELECT * ".
920 "FROM b_sale_order_props_relation ".
921 "WHERE 1 = 1";
922
923 if ($strSqlSearch <> '')
924 $strSql .= " ".$strSqlSearch;
925
926 $dbRes = $DB->Query($strSql);
927
928 return $dbRes;
929 }
930
931 /*
932 * Update order property relations
933 *
934 * @param int $ID - property id
935 * @param array $arEntityIDs - array of IDs entities (payment or delivery systems)
936 * @param string $entityType - P/D (payment or delivery systems)
937 * @return dbResult
938 */
939 public static function UpdateOrderPropsRelations($ID, $arEntityIDs, $entityType)
940 {
941 global $DB;
942
943 $ID = intval($ID);
944 if ($ID <= 0)
945 return false;
946
947 $strUpdate = "";
948 $arFields = array();
949
950 if (is_array($arEntityIDs))
951 {
952 foreach ($arEntityIDs as &$id)
953 {
954 $id = $DB->ForSql($id);
955 }
956 }
957
958 unset($id);
959
960 $entityType = $DB->ForSql($entityType, 1);
961
962 $DB->Query("DELETE FROM b_sale_order_props_relation WHERE PROPERTY_ID = '".$DB->ForSql($ID)."' AND ENTITY_TYPE = '".$entityType."'");
963
964 if (is_array($arEntityIDs))
965 {
966 foreach ($arEntityIDs as $val)
967 {
968 if (strval(trim($val)) == '')
969 continue;
970
971 $arTmp = array("ENTITY_ID" => $val, "ENTITY_TYPE" => $entityType);
972 $arInsert = $DB->PrepareInsert("b_sale_order_props_relation", $arTmp);
973
974 $strSql =
975 "INSERT INTO b_sale_order_props_relation (PROPERTY_ID, ".$arInsert[0].") ".
976 "VALUES('".$ID."', ".$arInsert[1].")";
977
978 $DB->Query($strSql);
979 }
980 }
981
982 return true;
983 }
984
985 public static function PrepareRelation4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
986 {
987 return false;
988 }
989}
990
993{
994 private $select;
995
996 private $fieldProxy = array();
997
999 {
1000 $this->select = $query->getSelectNamesAssoc() + array_flip($select);
1001
1002 if (! $query->aggregated())
1003 {
1004 $query->addAliasSelect('TYPE');
1005 $query->addAliasSelect('SETTINGS');
1006 $query->addAliasSelect('MULTIPLE');
1007 $query->registerRuntimeField('PROPERTY_ID', new Entity\ExpressionField('PROPERTY_ID', 'DISTINCT(%s)', 'ID'));
1008 $sel = $query->getSelect();
1009 array_unshift($sel, 'PROPERTY_ID');
1010 $query->setSelect($sel);
1011 }
1012 }
1013
1014 public function addFieldProxy($field)
1015 {
1016 if((string) $field == '')
1017 return false;
1018
1019 $this->fieldProxy['PROXY_'.$field] = $field;
1020
1021 return true;
1022 }
1023
1024 public function adapt(array $newProperty)
1025 {
1026 if (!isset($newProperty['TYPE']))
1027 {
1028 $newProperty['TYPE'] = 'STRING';
1029 }
1030
1031 if(is_array($newProperty))
1032 {
1033 foreach($newProperty as $k => $v)
1034 {
1035 if(isset($this->fieldProxy[$k]))
1036 {
1037 unset($newProperty[$k]);
1038 $newProperty[$this->fieldProxy[$k]] = $v;
1039 }
1040 }
1041 }
1042
1043 $oldProperty = self::convertNewToOld($newProperty);
1044 if (array_key_exists('VALUE', $newProperty))
1045 {
1046 $oldProperty['VALUE'] = self::getOldValue($newProperty['VALUE'], $newProperty['TYPE']);
1047 }
1048
1049 return array_intersect_key($oldProperty, $this->select);
1050 }
1051
1052 static function getOldValue($value, $type)
1053 {
1054 if (is_array($value))
1055 {
1056 switch ($type)
1057 {
1058 case 'ENUM': $value = implode(',', $value); break;
1059 case 'FILE': $value = implode(', ', $value); break;
1060 default : $value = reset($value);
1061 }
1062 }
1063
1064 return $value;
1065 }
1066
1067 static public function convertNewToOld(array $property)
1068 {
1069 if (isset($property['REQUIRED']) && !empty($property['REQUIRED']))
1070 $property['REQUIED'] = $property['REQUIRED'];
1071
1072 $settings = $property['SETTINGS'] ?? [];
1073
1074 if (isset($property['TYPE']))
1075 {
1076 switch ($property['TYPE'])
1077 {
1078 case 'STRING':
1079
1080 if (isset($settings['MULTILINE']) && $settings['MULTILINE'] === 'Y')
1081 {
1082 $property['TYPE'] = 'TEXTAREA';
1083 $property['SIZE1'] = $settings['COLS'] ?? null;
1084 $property['SIZE2'] = $settings['ROWS'] ?? null;
1085 }
1086 else
1087 {
1088 $property['TYPE'] = 'TEXT';
1089 $property['SIZE1'] = $settings['SIZE'] ?? null;
1090 }
1091
1092 break;
1093
1094 case 'NUMBER':
1095
1096 $property['TYPE'] = 'NUMBER';
1097
1098 break;
1099
1100 case 'Y/N':
1101
1102 $property['TYPE'] = 'CHECKBOX';
1103
1104 break;
1105
1106 case 'DATE':
1107
1108 $property['TYPE'] = 'DATE';
1109
1110 break;
1111
1112 case 'FILE':
1113
1114 $property['TYPE'] = 'FILE';
1115
1116 break;
1117
1118 case 'ENUM':
1119
1120 if ($property['MULTIPLE'] == 'Y')
1121 {
1122 $property['TYPE'] = 'MULTISELECT';
1123 $property['SIZE1'] = $settings['SIZE'] ?? null;
1124 }
1125 elseif ($settings['MULTIELEMENT'] == 'Y')
1126 {
1127 $property['TYPE'] = 'RADIO';
1128 }
1129 else
1130 {
1131 $property['TYPE'] = 'SELECT';
1132 $property['SIZE1'] = $settings['SIZE'] ?? null;
1133 }
1134
1135 break;
1136
1137 case 'LOCATION':
1138
1139 $property['SIZE1'] = $settings['SIZE'] ?? null;
1140
1141 break;
1142
1143 default: $property['TYPE'] = 'TEXT';
1144 }
1145 }
1146
1147 return $property;
1148 }
1149
1150 // M I G R A T I O N
1151
1152 static function convertOldToNew(array $property)
1153 {
1154 if (isset($property['REQUIED']) && !empty($property['REQUIED']))
1155 $property['REQUIRED'] = $property['REQUIED'];
1156
1157 $size1 = intval($property['SIZE1']);
1158 $size2 = intval($property['SIZE2']);
1159
1160 $settings = array();
1161
1162 // TODO remove sale/include.php - $GLOBALS["SALE_FIELD_TYPES"]
1163 switch ($property['TYPE'])
1164 {
1165 case 'TEXT':
1166
1167 $property['TYPE'] = 'STRING';
1168
1169 if ($size1 > 0)
1170 $settings['SIZE'] = $size1;
1171
1172 break;
1173
1174 case 'TEXTAREA':
1175
1176 $property['TYPE'] = 'STRING';
1177
1178 $settings['MULTILINE'] = 'Y';
1179
1180 if ($size1 > 0)
1181 $settings['COLS'] = $size1;
1182
1183 if ($size2 > 0)
1184 $settings['ROWS'] = $size2;
1185
1186 break;
1187
1188 case 'CHECKBOX':
1189
1190 $property['TYPE'] = 'Y/N';
1191
1192 break;
1193
1194 case 'RADIO':
1195
1196 $property['TYPE'] = 'ENUM';
1197
1198 $settings['MULTIELEMENT'] = 'Y';
1199
1200 break;
1201
1202 case 'SELECT':
1203
1204 $property['TYPE'] = 'ENUM';
1205
1206 if ($size1 > 0)
1207 $settings['SIZE'] = $size1;
1208
1209 break;
1210
1211 case 'MULTISELECT':
1212
1213 $property['TYPE'] = 'ENUM';
1214
1215 $property['MULTIPLE'] = 'Y';
1216
1217 if ($size1 > 0)
1218 $settings['SIZE'] = $size1;
1219
1220 break;
1221
1222 case 'LOCATION':
1223
1224 // ID came, should store CODE
1225 if (intval($property['DEFAULT_VALUE']))
1226 {
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'] != '')
1229 {
1230 $property['DEFAULT_VALUE'] = $res['CODE'];
1231 }
1232 }
1233
1234 if ($size1 > 0)
1235 $settings['SIZE'] = $size1;
1236
1237 break;
1238 }
1239
1240 $propertySettings = array();
1241 if (isset($property['SETTINGS']) && is_array($property['SETTINGS']))
1242 {
1243 $propertySettings = $property['SETTINGS'];
1244 }
1245
1246 $property['SETTINGS'] = $propertySettings + $settings;
1247
1248 return $property;
1249 }
1250
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,
1256 );
1257
1258 static function migrate()
1259 {
1260 $correctFields = array(
1261 'REQUIRED',
1262 'USER_PROPS',
1263 'ACTIVE',
1264 'UTIL',
1265 'MULTIPLE',
1266 );
1267
1268 $errors = '';
1269 $result = Application::getConnection()->query('SELECT * FROM b_sale_order_props ORDER BY ID ASC');
1270
1271 while ($oldProperty = $result->fetch())
1272 {
1273 $newProperty = self::convertOldToNew($oldProperty);
1274 $newProperty['IS_ADDRESS'] = 'N'; // fix oracle's mb default
1275
1276 foreach ($newProperty as $key => $value)
1277 {
1278 if (mb_strpos($key, 'IS_') === 0)
1279 {
1280 $newProperty[$key] = mb_strtoupper($value);
1281 }
1282 elseif(in_array($key, $correctFields))
1283 {
1284 $newProperty[$key] = mb_strtoupper($value);
1285 }
1286 }
1287
1288 $update = OrderPropsTable::update($newProperty['ID'], array_intersect_key($newProperty, self::$allFields));
1289
1290 if ($update->isSuccess())
1291 {
1293 }
1294 else
1295 {
1296 $errors .= 'cannot update property: '.$oldProperty['ID']."\n".implode("\n", $update->getErrorMessages())."\n\n";
1297 }
1298 }
1299
1300 if ($errors)
1301 throw new SystemException($errors, 0, __FILE__, __LINE__);
1302 }
1303}
$path
Определения access_edit.php:21
return select
Определения access_edit.php:440
$type
Определения options.php:106
global $APPLICATION
Определения include.php:80
$arResult
Определения generate_coupon.php:16
static getConnection($name="")
Определения application.php:638
static getPathToNode($primary, $parameters, $behaviour=array('SHOW_LEAF'=> true))
Определения tree.php:360
static getInstance($type)
Определения registry.php:183
const REGISTRY_TYPE_ORDER
Определения registry.php:16
static getIdByCode($code)
Определения delivery.php:1641
static isLocationProMigrated()
Определения location.php:58
static Delete($ID)
Определения order_props_values.php:360
static Add($arFields)
Определения order_props_values.php:242
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения order_props_values.php:12
static Update($ID, $arFields)
Определения order_props_values.php:273
static GetByValue($PropID, $Value)
Определения order_props_variant.php:7
static ClearEmpty()
Определения order_user_props.php:317
static GetByID($ID)
Определения person_type.php:69
static GetList($arOrder=array("SORT"=>"ASC", "COUNTRY_NAME_LANG"=>"ASC", "CITY_NAME_LANG"=>"ASC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения location.php:9
static GetByID($primary, $strLang=LANGUAGE_ID)
Определения location.php:118
static convertNewToOld(array $property)
Определения order_props.php:1067
addFieldProxy($field)
Определения order_props.php:1014
static convertOldToNew(array $property)
Определения order_props.php:1152
static getOldValue($value, $type)
Определения order_props.php:1052
adapt(array $newProperty)
Определения order_props.php:1024
static migrate()
Определения order_props.php:1258
__construct(OrderQuery $query, array $select)
Определения order_props.php:998
static $allFields
Определения order_props.php:1251
Определения order_props.php:17
static GetOrderPropsRelations($arFilter=array())
Определения order_props.php:894
static Delete($ID)
Определения order_props.php:751
static Add($arFields)
Определения order_props.php:706
static GetByID($ID)
Определения order_props.php:627
static PrepareRelation4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
Определения order_props.php:985
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения order_props.php:410
static DoSaveOrderProps($orderId, $personTypeId, $arOrderProps, &$arErrors, $paysystemId=0, $deliveryId="")
Определения order_props.php:296
static CheckFields($ACTION, &$arFields, $ID=0)
Определения order_props.php:635
static UpdateOrderPropsRelations($ID, $arEntityIDs, $entityType)
Определения order_props.php:939
static Update($ID, $arFields)
Определения order_props.php:727
static GetRealValue($propertyID, $propertyCode, $propertyType, $value, $lang=false)
Определения order_props.php:776
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения order_props_variant.php:7
$arFields
Определения dblapprove.php:5
$orderId
Определения payment.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
$query
Определения get_search.php:11
if($ajaxMode) $ID
Определения get_user.php:27
$errors
Определения iblock_catalog_edit.php:74
global $DB
Определения cron_frame.php:29
$ACTION
Определения csv_new_setup.php:27
if(!defined('SITE_ID')) $lang
Определения include.php:91
$arOptions
Определения structure.php:223
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
Определения tools.php:5177
is_set($a, $k=false)
Определения tools.php:2133
GetMessage($name, $aReplace=null)
Определения tools.php:3397
check_email($email, $strict=false, $domainCheck=false)
Определения tools.php:4571
Определения arrayresult.php:2
Order
Определения order.php:6
Определения ufield.php:9
if(intval($iTestTransaction) > 0) $arTmp
Определения payment.php:22
$settings
Определения product_settings.php:43
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
$i
Определения factura.php:643
</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."%"
Определения waybill.php:936
$val
Определения options.php:1793
$k
Определения template_pdf.php:567
$max
Определения template_copy.php:262
$dbResult
Определения updtr957.php:3
$arFilter
Определения user_search.php:106
$dbRes
Определения yandex_detail.php:168
$propertyFields
Определения yandex_run.php:558
$fields
Определения yandex_run.php:501