1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
order_change.php
См. документацию.
1<?php
2
4
6{
7 public static function CheckFields($ACTION, &$arFields, $ID = 0)
8 {
9 if ((is_set($arFields, "ORDER_ID") || $ACTION=="ADD") && (int)$arFields["ORDER_ID"] === 0)
10 {
11 $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SOC_EMPTY_ORDER_ID"), "SOC_ADD_EMPTY_ORDER_ID");
12 return false;
13 }
14
15 if ((is_set($arFields, "USER_ID") || $ACTION=="ADD") && (int)$arFields["USER_ID"] === 0)
16 {
17 $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SOC_EMPTY_USER_ID"), "SOC_ADD_EMPTY_USER_ID");
18 return false;
19 }
20
21 if ((is_set($arFields, "TYPE") || $ACTION=="ADD") && (string)$arFields["TYPE"] === '')
22 {
23 $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SOC_EMPTY_TYPE"), "SOC_ADD_EMPTY_TYPE");
24 return false;
25 }
26
27 return true;
28 }
29
30 public static function GetByID($ID)
31 {
32 global $DB;
33
34 $ID = intval($ID);
35
36 $strSql =
37 "SELECT O.*, ".
38 " ".$DB->DateToCharFunction("O.DATE_CREATE", "FULL")." as DATE_CREATE, ".
39 "FROM b_sale_order_change SOC ".
40 "WHERE O.ID = ".$ID."";
41 $db_res = $DB->Query($strSql);
42
43 if ($res = $db_res->Fetch())
44 {
45 return $res;
46 }
47
48 return False;
49 }
50
51 public static function Delete($ID)
52 {
53 global $DB;
54
55 $ID = intval($ID);
56 if ($ID <= 0)
57 return False;
58
59 return $DB->Query("DELETE FROM b_sale_order_change WHERE ID = ".$ID." ", true);
60 }
61
62
68 public static function deleteByOrderId($id)
69 {
70 global $DB;
71
72 $id = intval($id);
73
74 if ($id <= 0)
75 return false;
76
77 return $DB->Query("DELETE FROM b_sale_order_change WHERE ORDER_ID = ".$id." ", true);
78 }
79
88 public static function deleteOld($days, $limit = null)
89 {
90 $days = (int)($days);
91
92 if ($days <= 0)
93 return false;
94
95 $expired = new \Bitrix\Main\Type\DateTime();
96 $expired->add('-'.$days.' days');
97 $expiredValue = $expired->format('Y-m-d H:i:s');
98
102 $sqlHelper = $connection->getSqlHelper();
103 $sqlExpiredDate = $sqlHelper->getDateToCharFunction("'" . $expiredValue . "'");
104
105 if ($connection instanceof \Bitrix\Main\DB\MysqlCommonConnection)
106 {
107 $query = "DELETE FROM b_sale_order_change WHERE DATE_CREATE < $sqlExpiredDate";
108 if ((int)$limit > 0)
109 $query .= " LIMIT ".(int)$limit;
110 $connection->queryExecute($query);
111 }
112
113 return true;
114 }
115
116 /*
117 * Adds record to the order change history
118 * Wrapper around CSaleOrderChange::Add method
119 *
120 * @param int $orderId - order ID
121 * @param string $type - operation type (@see CSaleOrderChangeFormat for full list of supported operations)
122 * @param array $data - array of information relevant for the record type (will be used in the record description)
123 * @param null|string $entityName -
124 * @return bool
125 */
126 public static function AddRecord($orderId, $type, $data = array(), $entityName = null, $entityId = null)
127 {
128 global $USER;
129
130 if (is_object($USER))
131 $userId = intval($USER->GetID());
132 else
133 $userId = 0;
134
136 "ORDER_ID" => intval($orderId),
137 "TYPE" => $type,
138 "DATA" => (is_array($data) ? serialize($data) : $data),
139 "USER_ID" => $userId,
140 "ENTITY" => $entityName,
141 "ENTITY_ID" => $entityId,
142 );
143
145 }
146
147 /*
148 * Automatically adds records to the order changes list based on changes in the fields of the Update method.
149 * By default changes in the CSaleOrder::Update and CSaleBasket::Update fields are supported.
150 *
151 * @see CSaleOrderChangeFormat - list of possible types of operations which will be used in analyzing incoming fields
152 *
153 * @param int $orderId - order ID
154 * @param array $OldFields - old fields with values (retrieved by entity GetById method)
155 * @param array $NewFields - new array of fields and their values
156 * @param array $arDeleteFields - array of fields to be ignored
157 * @param string $entityName - name of the entity (empty for order, "BASKET" for basket items etc). Used in filtering operations when creating records automatically
158 * @param $entity - entity
159 * @return bool
160 */
161 public static function AddRecordsByFields($orderId, array $arOldFields, array $arNewFields, $arDeleteFields = array(), $entityName = "", $entityId = null, $entity = null, array $data = array())
162 {
163 if ($orderId <= 0)
164 return false;
165
166 if ($entityName == "") // for order
167 {
168 if (isset($arNewFields["ID"]))
169 unset($arNewFields["ID"]);
170 }
171
172 foreach ($arNewFields as $key => $val)
173 {
174 if (is_array($val))
175 continue;
176
177 if (!array_key_exists($key, $arOldFields) || (array_key_exists($key, $arOldFields) && $val <> '' && $val != $arOldFields[$key]) && !in_array($key, $arDeleteFields))
178 {
179 $arRecord = CSaleOrderChange::MakeRecordFromField($key, $arNewFields, $entityName, $entity);
180 if ($arRecord)
181 {
182 $result = $arRecord["DATA"];
183 foreach ($arRecord["DATA"] as $fieldKey => $fieldValue)
184 {
185 if (!isset($result['OLD_'.$fieldKey]) && isset($data['OLD_'.$fieldKey]))
186 {
187 $result['OLD_'.$fieldKey] = TruncateText($data['OLD_'.$key], 128);
188 }
189 }
190
191 CSaleOrderChange::AddRecord($orderId, $arRecord["TYPE"], $result, $entityName, $entityId);
192 }
193 }
194 }
195
196 return true;
197 }
198
199
200 /*
201 * Creates an array of the order change record based on the necessary fields (DATA_FIELDS) if field is found among TRIGGER_FIELDS (@CSaleOrderChangeFormat)
202 *
203 * @param string $field - field name (if TRIGGER_FIELDS of any operation contains this field, a record about such operation will be created)
204 * @param array $arFields - any other fields which should be used for creating a record
205 * @param string $entity - name of the entity (empty for order, "BASKET" for basket items etc). Used in filtering operations when creating records automatically
206 * @return array with keys: TYPE - operation type @see CSaleOrderChangeFormat, DATA - array of the relevant parameters based on the DATA_FIELDS
207 */
208 public static function MakeRecordFromField($field, $arFields, $entityName = "", $entity = null)
209 {
210 foreach (CSaleOrderChangeFormat::$operationTypes as $code => $arInfo)
211 {
212 if ($entityName != "" && (!isset($arInfo["ENTITY"]) || (isset($arInfo["ENTITY"]) && $arInfo["ENTITY"] != $entityName)))
213 continue;
214
215 if (in_array($field, $arInfo["TRIGGER_FIELDS"]))
216 {
217 $originalValues = array();
218 if ($entity !== null)
219 {
221 $fields = $entity->getFields();
222 $originalValues = $fields->getOriginalValues();
223 }
224
225 $arData = array();
226 foreach ($arInfo["DATA_FIELDS"] as $fieldName)
227 {
228 $value = null;
229 $isValueGetting = false;
230 if (array_key_exists("DATA_METHOD", $arInfo) && isset($arInfo['DATA_METHOD'][$fieldName]))
231 {
232 $dataMethodCallback = $arInfo['DATA_METHOD'][$fieldName][0];
233 $dataMethodFields = $arInfo['DATA_METHOD'][$fieldName][1];
234 $dataMethodArgs = array();
235
236 foreach ($dataMethodFields as $dataMethodFieldName)
237 {
238 if (isset($arFields[$dataMethodFieldName]))
239 {
240 $dataMethodArgs[] = $arFields[$dataMethodFieldName];
241 }
242 }
243
244 if ($value = call_user_func_array($dataMethodCallback, $dataMethodArgs))
245 {
246 $isValueGetting = true;
247 }
248 }
249
250 if (!$isValueGetting)
251 {
252 if (isset($arInfo["DATA_FIELDS"]) && in_array('OLD_'.$fieldName, $arInfo["DATA_FIELDS"]))
253 {
254 if (isset($originalValues[$fieldName]))
255 {
256 $arFields['OLD_'.$fieldName] = $originalValues[$fieldName];
257 }
258 }
259
260 if (array_key_exists($fieldName, $arFields))
261 {
262 $value = $arFields[$fieldName];
263 }
264 elseif ($entity !== null)
265 {
266 $value = $entity->getField($fieldName);
267
268 if ($value === null)
269 continue;
270 }
271 }
272
273 $arData[$fieldName] = TruncateText($value, 128);
274 }
275
276 return array(
277 "TYPE" => $code,
278 "DATA" => $arData
279 );
280 }
281 }
282
283 return false;
284 }
285
286 /*
287 * Returns full description of the order change record based on the formatting function and data
288 * saved for this record. Only works if specified type is found among existing types.
289 *
290 * Function is used in the order history in the detailed order view.
291 *
292 * @param string $type - one of the operation types (@see CSaleOrderChangeFormat)
293 * @param string $data - serialized data saved in the database for the record of this type
294 * @return array with keys: NAME - record name, INFO - full description (string)
295 */
296 public static function GetRecordDescription($type, $data)
297 {
298 foreach (CSaleOrderChangeFormat::$operationTypes as $typeCode => $arInfo)
299 {
300 if ($type == $typeCode)
301 {
302 if (isset($arInfo["FUNCTION"]) && is_callable(array("CSaleOrderChangeFormat", $arInfo["FUNCTION"])))
303 {
304 $dataFields = unserialize($data, ['allowed_classes' => [DateTime::class, \Bitrix\Main\Type\DateTime::class, \Bitrix\Main\Type\Date::class]]);
305
306 if ($dataFields === false)
307 {
308 $dataFields = $data;
309 }
310
311 $dataFieldsNameList = array();
312
313 if (isset($arInfo["DATA_FIELDS"]) && is_array($arInfo["DATA_FIELDS"]))
314 {
315 $dataFieldsNameList = array_flip($arInfo["DATA_FIELDS"]);
316 }
317
318
319 if (is_array($dataFields))
320 {
321 foreach ($dataFields as $paramName => $paramData)
322 {
323 if (array_key_exists($paramName, $dataFieldsNameList))
324 {
325 unset($dataFieldsNameList[$paramName]);
326 }
327 }
328
329 if (!empty($dataFieldsNameList))
330 {
331 foreach($dataFieldsNameList as $fieldName => $fieldData)
332 {
333 $dataFields[$fieldName] = "";
334 }
335 }
336 }
337
338 $params = array($dataFields, $typeCode);
339
340 if (!empty($arInfo['ENTITY']))
341 {
342 $params[] = $arInfo['ENTITY'];
343 }
344
345 $arResult = call_user_func_array(array("CSaleOrderChangeFormat", $arInfo["FUNCTION"]), $params);
346 return $arResult;
347 }
348 }
349 }
350
351 return false;
352 }
353}
354
356{
357 public static $operationTypes = array(
358 "ORDER_DEDUCTED" => array(
359 "TRIGGER_FIELDS" => array("DEDUCTED"),
360 "FUNCTION" => "FormatOrderDeducted",
361 "DATA_FIELDS" => array("DEDUCTED", "REASON_UNDO_DEDUCTED"),
362 "ENTITY" => 'ORDER',
363 ),
364 "ORDER_MARKED" => array(
365 "TRIGGER_FIELDS" => array("MARKED"),
366 "FUNCTION" => "FormatOrderMarked",
367 "DATA_FIELDS" => array("REASON_MARKED", "MARKED"),
368 "ENTITY" => 'ORDER',
369 ),
370 "ORDER_RESERVED" => array(
371 "TRIGGER_FIELDS" => array("RESERVED"),
372 "FUNCTION" => "FormatOrderReserved",
373 "DATA_FIELDS" => array("RESERVED"),
374 "ENTITY" => 'SHIPMENT',
375 ),
376 "ORDER_CANCELED" => array(
377 "TRIGGER_FIELDS" => array("CANCELED"),
378 "FUNCTION" => "FormatOrderCanceled",
379 "DATA_FIELDS" => array("CANCELED", "REASON_CANCELED"),
380 "ENTITY" => 'ORDER',
381 ),
382 "ORDER_COMMENTED" => array(
383 "TRIGGER_FIELDS" => array("COMMENTS"),
384 "FUNCTION" => "FormatOrderCommented",
385 "DATA_FIELDS" => array("COMMENTS", 'OLD_COMMENTS'),
386 "ENTITY" => 'ORDER',
387 ),
388 "ORDER_STATUS_CHANGED" => array(
389 "TRIGGER_FIELDS" => array("STATUS_ID"),
390 "FUNCTION" => "FormatOrderStatusChanged",
391 "DATA_FIELDS" => array("STATUS_ID"),
392 "ENTITY" => 'ORDER',
393 ),
394 "ORDER_DELIVERY_ALLOWED" => array(
395 "TRIGGER_FIELDS" => array("ALLOW_DELIVERY"),
396 "FUNCTION" => "FormatOrderDeliveryAllowed",
397 "DATA_FIELDS" => array("ALLOW_DELIVERY"),
398 "ENTITY" => 'SHIPMENT',
399 ),
400 "ORDER_DELIVERY_DOC_CHANGED" => array(
401 "TRIGGER_FIELDS" => array("DELIVERY_DOC_NUM"),
402 "FUNCTION" => "FormatOrderDeliveryDocChanged",
403 "DATA_FIELDS" => array("DELIVERY_DOC_NUM", "DELIVERY_DOC_DATE"),
404 "ENTITY" => 'SHIPMENT',
405 ),
406 "ORDER_PAYMENT_SYSTEM_CHANGED" => array(
407 "TRIGGER_FIELDS" => array("PAY_SYSTEM_ID"),
408 "FUNCTION" => "FormatOrderPaymentSystemChanged",
409 "DATA_FIELDS" => array("PAY_SYSTEM_ID"),
410 "ENTITY" => 'PAYMENT',
411 ),
412 "ORDER_PAYMENT_VOUCHER_CHANGED" => array(
413 "TRIGGER_FIELDS" => array("PAY_VOUCHER_NUM"),
414 "FUNCTION" => "FormatOrderPaymentVoucherChanged",
415 "DATA_FIELDS" => array("PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE"),
416 "ENTITY" => 'PAYMENT',
417 ),
418 "ORDER_DELIVERY_SYSTEM_CHANGED" => array(
419 "TRIGGER_FIELDS" => array("DELIVERY_ID"),
420 "FUNCTION" => "FormatOrderDeliverySystemChanged",
421 "DATA_FIELDS" => array("DELIVERY_ID", "DELIVERY_NAME"),
422 "ENTITY" => 'SHIPMENT',
423 ),
424 "ORDER_PERSON_TYPE_CHANGED" => array(
425 "TRIGGER_FIELDS" => array("PERSON_TYPE_ID"),
426 "FUNCTION" => "FormatOrderPersonTypeChanged",
427 "DATA_FIELDS" => array("PERSON_TYPE_ID"),
428 "ENTITY" => 'ORDER',
429 ),
430 "ORDER_PAYED" => array(
431 "TRIGGER_FIELDS" => array("PAYED"),
432 "FUNCTION" => "FormatOrderPayed",
433 "DATA_FIELDS" => array("PAYED"),
434 "ENTITY" => 'PAYMENT',
435 ),
436 "ORDER_TRACKING_NUMBER_CHANGED" => array(
437 "TRIGGER_FIELDS" => array("TRACKING_NUMBER"),
438 "FUNCTION" => "FormatOrderTrackingNumberChanged",
439 "DATA_FIELDS" => array("TRACKING_NUMBER"),
440 "ENTITY" => 'SHIPMENT',
441 ),
442 "ORDER_USER_DESCRIPTION_CHANGED" => array(
443 "TRIGGER_FIELDS" => array("USER_DESCRIPTION"),
444 "FUNCTION" => "FormatOrderUserDescriptionChanged",
445 "DATA_FIELDS" => array("USER_DESCRIPTION", "OLD_USER_DESCRIPTION"),
446 "ENTITY" => 'ORDER',
447 ),
448 "ORDER_PRICE_DELIVERY_CHANGED" => array(
449 "TRIGGER_FIELDS" => array("PRICE_DELIVERY"),
450 "FUNCTION" => "FormatOrderPriceDeliveryChanged",
451 "DATA_FIELDS" => array("PRICE_DELIVERY", "CURRENCY"),
452 "ENTITY" => 'SHIPMENT',
453 ),
454 "ORDER_PRICE_CHANGED" => array(
455 "TRIGGER_FIELDS" => array("PRICE"),
456 "FUNCTION" => "FormatOrderPriceChanged",
457 "DATA_FIELDS" => array("PRICE", "OLD_PRICE", "CURRENCY"),
458 "ENTITY" => 'ORDER',
459 ),
460 "ORDER_1C_IMPORT" => array(
461 "TRIGGER_FIELDS" => array(),
462 "FUNCTION" => "FormatOrder1CImport",
463 "DATA_FIELDS" => array(),
464 "ENTITY" => 'ORDER',
465 ),
466 "ORDER_ADDED" => array(
467 "TRIGGER_FIELDS" => array(),
468 "FUNCTION" => "FormatOrderAdded",
469 "DATA_FIELDS" => array(),
470 "ENTITY" => 'ORDER',
471 ),
472
473 "ORDER_UPDATED" => array(
474 "TRIGGER_FIELDS" => array(),
475 "FUNCTION" => "FormatOrderUpdated",
476 "DATA_FIELDS" => array(),
477 "ENTITY" => 'ORDER',
478 ),
479
480 "ORDER_RESPONSIBLE_CHANGE" => array(
481 "TRIGGER_FIELDS" => array("RESPONSIBLE_ID"),
482 "FUNCTION" => "FormatOrderChange",
483 "DATA_FIELDS" => array("RESPONSIBLE_ID", "RESPONSIBLE_NAME", "OLD_RESPONSIBLE_ID", "OLD_RESPONSIBLE_NAME"),
484 "DATA_METHOD" => array(
485 "RESPONSIBLE_NAME" => array('CSaleOrderChangeFormat::getOrderResponsibleName', array("RESPONSIBLE_ID")),
486 "OLD_RESPONSIBLE_NAME" => array('CSaleOrderChangeFormat::getOrderResponsibleName', array("OLD_RESPONSIBLE_ID"))
487 ),
488 "ENTITY" => 'ORDER',
489 ),
490
491 "BASKET_ADDED" => array(
492 "ENTITY" => "BASKET",
493 "TRIGGER_FIELDS" => array(),
494 "FUNCTION" => "FormatBasketAdded",
495 "DATA_FIELDS" => array("PRODUCT_ID", "NAME", "QUANTITY", "SET_PARENT_ID"),
496 ),
497 "BASKET_REMOVED" => array(
498 "ENTITY" => "BASKET",
499 "TRIGGER_FIELDS" => array(),
500 "FUNCTION" => "FormatBasketRemoved",
501 "DATA_FIELDS" => array("PRODUCT_ID", "NAME")
502 ),
503 "BASKET_QUANTITY_CHANGED" => array(
504 "ENTITY" => "BASKET",
505 "TRIGGER_FIELDS" => array("QUANTITY"),
506 "FUNCTION" => "FormatBasketQuantityChanged",
507 "DATA_FIELDS" => array("PRODUCT_ID", "NAME", "QUANTITY")
508 ),
509 "BASKET_PRICE_CHANGED" => array(
510 "ENTITY" => "BASKET",
511 "TRIGGER_FIELDS" => array("PRICE"),
512 "FUNCTION" => "FormatBasketPriceChanged",
513 "DATA_FIELDS" => array("PRODUCT_ID", "NAME", "PRICE", "CURRENCY")
514 ),
515
516
517 "BASKET_SAVED" => array(
518 "TRIGGER_FIELDS" => array(),
519 "FUNCTION" => "FormatOrderChange",
520 "DATA_FIELDS" => array(),
521 "ENTITY" => 'BASKET'
522 ),
523
524 "ORDER_DELIVERY_REQUEST_SENT" => array(
525 "TRIGGER_FIELDS" => array(),
526 "FUNCTION" => "FormatOrderDeliveryRequestSent",
527 "DATA_FIELDS" => array()
528 ),
529
530 "PAYMENT_ADDED" => array(
531 "TRIGGER_FIELDS" => array(),
532 "FUNCTION" => "FormatPaymentAdded",
533 "DATA_FIELDS" => array("PAY_SYSTEM_NAME", "SUM"),
534 "ENTITY" => 'PAYMENT'
535 ),
536
537 "PAYMENT_REMOVED" => array(
538 "TRIGGER_FIELDS" => array(),
539 "FUNCTION" => "FormatPaymentRemoved",
540 "DATA_FIELDS" => array("PAY_SYSTEM_ID", "PAY_SYSTEM_NAME"),
541 "ENTITY" => "PAYMENT",
542 ),
543
544 "PAYMENT_PAID" => array(
545 "TRIGGER_FIELDS" => array("PAID"),
546 "FUNCTION" => "FormatPaymentPaid",
547 "DATA_FIELDS" => array("PAID", "ID", "PAY_SYSTEM_NAME"),
548 "ENTITY" => 'PAYMENT'
549 ),
550
551 "PAYMENT_SYSTEM_CHANGED" => array(
552 "TRIGGER_FIELDS" => array("PAY_SYSTEM_ID"),
553 "FUNCTION" => "FormatPaymentSystemChanged",
554 "DATA_FIELDS" => array("PAY_SYSTEM_ID"),
555 "ENTITY" => 'PAYMENT'
556 ),
557 "PAYMENT_VOUCHER_CHANGED" => array(
558 "TRIGGER_FIELDS" => array("PAY_VOUCHER_NUM"),
559 "FUNCTION" => "FormatPaymentVoucherChanged",
560 "DATA_FIELDS" => array("PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE"),
561 "ENTITY" => 'PAYMENT'
562 ),
563
564 "PAYMENT_PRICE_CHANGED" => array(
565 "TRIGGER_FIELDS" => array("PRICE"),
566 "FUNCTION" => "FormatPaymentPriceChanged",
567 "DATA_FIELDS" => array("PRICE", "CURRENCY"),
568 "ENTITY" => 'PAYMENT'
569 ),
570
571 "PAYMENT_SAVED" => array(
572 "TRIGGER_FIELDS" => array(),
573 "FUNCTION" => "FormatOrderChange",
574 "DATA_FIELDS" => array(),
575 "ENTITY" => 'PAYMENT'
576 ),
577
578 "SHIPMENT_ADDED" => array(
579 "TRIGGER_FIELDS" => array(),
580 "FUNCTION" => "FormatShipmentAdded",
581 "DATA_FIELDS" => array('DELIVERY_NAME'),
582 "ENTITY" => 'SHIPMENT'
583 ),
584
585 "SHIPMENT_REMOVED" => array(
586 "TRIGGER_FIELDS" => array(),
587 "FUNCTION" => "FormatShipmentRemoved",
588 "DATA_FIELDS" => array("ID", "DELIVERY_NAME"),
589 "ENTITY" => "SHIPMENT",
590 ),
591
592 "SHIPMENT_ITEM_BASKET_ADDED" => array(
593 "TRIGGER_FIELDS" => array(),
594 "FUNCTION" => "FormatShipmentItemBasketAdded",
595 "DATA_FIELDS" => array("PRODUCT_ID", "NAME", "QUANTITY"),
596 "ENTITY" => 'SHIPMENT'
597 ),
598
599 "SHIPMENT_ITEM_BASKET_REMOVED" => array(
600 "TRIGGER_FIELDS" => array(),
601 "FUNCTION" => "FormatShipmentItemBasketRemoved",
602 "DATA_FIELDS" => array("PRODUCT_ID", "NAME", "QUANTITY"),
603 "ENTITY" => 'SHIPMENT'
604 ),
605
606
607 "SHIPMENT_DELIVERY_ALLOWED" => array(
608 "TRIGGER_FIELDS" => array("ALLOW_DELIVERY"),
609 "FUNCTION" => "FormatShipmentDeliveryAllowed",
610 "DATA_FIELDS" => array("ALLOW_DELIVERY"),
611 "ENTITY" => 'SHIPMENT'
612 ),
613
614 "SHIPMENT_SHIPPED" => array(
615 "TRIGGER_FIELDS" => array("DEDUCTED"),
616 "FUNCTION" => "FormatShipmentDeducted",
617 "DATA_FIELDS" => array("DELIVERY_NAME", "DEDUCTED"),
618 "ENTITY" => 'SHIPMENT'
619 ),
620
621 "SHIPMENT_MARKED" => array(
622 "TRIGGER_FIELDS" => array("MARKED"),
623 "FUNCTION" => "FormatShipmentMarked",
624 "DATA_FIELDS" => array("REASON_MARKED", "MARKED"),
625 "ENTITY" => 'SHIPMENT'
626 ),
627
628 "SHIPMENT_RESERVED" => array(
629 "TRIGGER_FIELDS" => array("RESERVED"),
630 "FUNCTION" => "FormatShipmentReserved",
631 "DATA_FIELDS" => array("RESERVED"),
632 "ENTITY" => 'SHIPMENT'
633 ),
634
635 "SHIPMENT_CANCELED" => array(
636 "TRIGGER_FIELDS" => array("CANCELED"),
637 "FUNCTION" => "FormatShipmentCanceled",
638 "DATA_FIELDS" => array("CANCELED", "REASON_CANCELED"),
639 "ENTITY" => 'SHIPMENT'
640 ),
641
642 "SHIPMENT_STATUS_CHANGED" => array(
643 "TRIGGER_FIELDS" => array("STATUS_ID"),
644 "FUNCTION" => "FormatShipmentStatusChanged",
645 "DATA_FIELDS" => array("STATUS_ID"),
646 "ENTITY" => 'SHIPMENT'
647 ),
648
649 "SHIPMENT_DELIVERY_DOC_CHANGED" => array(
650 "TRIGGER_FIELDS" => array("DELIVERY_DOC_NUM"),
651 "FUNCTION" => "FormatShipmentDeliveryDocChanged",
652 "DATA_FIELDS" => array("DELIVERY_DOC_NUM", "DELIVERY_DOC_DATE"),
653 "ENTITY" => 'SHIPMENT'
654 ),
655
656 "SHIPMENT_TRACKING_NUMBER_CHANGED" => array(
657 "TRIGGER_FIELDS" => array("TRACKING_NUMBER"),
658 "FUNCTION" => "FormatShipmentTrackingNumberChanged",
659 "DATA_FIELDS" => array("TRACKING_NUMBER"),
660 "ENTITY" => 'SHIPMENT',
661 ),
662
663 "SHIPMENT_PRICE_DELIVERY_CHANGED" => array(
664 "TRIGGER_FIELDS" => array("PRICE_DELIVERY"),
665 "FUNCTION" => "FormatShipmentPriceDeliveryChanged",
666 "DATA_FIELDS" => array("PRICE_DELIVERY", "CURRENCY"),
667 "ENTITY" => 'SHIPMENT',
668 ),
669
670 "SHIPMENT_AMOUNT_CHANGED" => array(
671 "TRIGGER_FIELDS" => array("QUANTITY"),
672 "FUNCTION" => "FormatShipmentQuantityChanged",
673 "DATA_FIELDS" => array("QUANTITY"),
674 "ENTITY" => 'SHIPMENT_ITEM_STORE',
675 ),
676
677 "SHIPMENT_QUANTITY_CHANGED" => array(
678 "TRIGGER_FIELDS" => array("QUANTITY"),
679 "FUNCTION" => "FormatShipmentQuantityChanged",
680 "DATA_FIELDS" => array("QUANTITY", "ORDER_DELIVERY_ID", "NAME", "PRODUCT_ID"),
681 "ENTITY" => 'SHIPMENT_ITEM',
682 ),
683
684
685 "SHIPMENT_RESPONSIBLE_CHANGE" => array(
686 "TRIGGER_FIELDS" => array("RESPONSIBLE_ID"),
687 "FUNCTION" => "FormatOrderChange",
688 "DATA_FIELDS" => array("RESPONSIBLE_ID", "RESPONSIBLE_NAME", "OLD_RESPONSIBLE_ID", "OLD_RESPONSIBLE_NAME"),
689 "DATA_METHOD" => array(
690 "RESPONSIBLE_NAME" => array('CSaleOrderChangeFormat::getOrderResponsibleName', array("RESPONSIBLE_ID")),
691 "OLD_RESPONSIBLE_NAME" => array('CSaleOrderChangeFormat::getOrderResponsibleName', array("OLD_RESPONSIBLE_ID"))
692 ),
693 "ENTITY" => 'SHIPMENT',
694 ),
695
696
697 "SHIPMENT_SAVED" => array(
698 "TRIGGER_FIELDS" => array(),
699 "FUNCTION" => "FormatOrderChange",
700 "DATA_FIELDS" => array(),
701 "ENTITY" => 'SHIPMENT'
702 ),
703
704 "ORDER_UPDATE" => array(
705 "TRIGGER_FIELDS" => array(),
706 "FUNCTION" => "FormatLog",
707 "DATA_FIELDS" => array(
708 "PERSON_TYPE_ID",
709 "CANCELED",
710 "STATUS_ID",
711 "MARKED",
712 "PRICE",
713 "SUM_PAID",
714 "USER_ID",
715 "EXTERNAL_ORDER",
716 ),
717 "ENTITY" => "ORDER",
718 ),
719
720 "BASKET_ITEM_UPDATE" => array(
721 "TRIGGER_FIELDS" => array(),
722 "FUNCTION" => "FormatLog",
723 "DATA_FIELDS" => array(
724 "QUANTITY",
725 "PRICE",
726 "PRODUCT_ID",
727 "DISCOUNT_VALUE",
728 "VAT_RATE",
729 "OLD_QUANTITY",
730 "OLD_PRICE",
731 "OLD_PRODUCT_ID",
732 "OLD_DISCOUNT_VALUE",
733 "OLD_VAT_RATE"
734 ),
735 "ENTITY" => "BASKET",
736 ),
737
738 "BASKET_ITEM_DELETE_BUNDLE" => array(
739 "TRIGGER_FIELDS" => array(),
740 "FUNCTION" => "FormatLog",
741 "DATA_FIELDS" => array(),
742 "ENTITY" => "BASKET",
743 ),
744
745 "BASKET_ITEM_DELETED" => array(
746 "TRIGGER_FIELDS" => array(),
747 "FUNCTION" => "FormatLog",
748 "DATA_FIELDS" => array(),
749 "ENTITY" => "BASKET",
750 ),
751
752 "PAYMENT_ADD" => array(
753 "TRIGGER_FIELDS" => array(),
754 "FUNCTION" => "FormatLog",
755 "DATA_FIELDS" => array(
756 "PAID",
757 "PAY_SYSTEM_ID",
758 "PAY_SYSTEM_NAME",
759 "SUM",
760 "IS_RETURN",
761 "ACCOUNT_NUMBER",
762 "EXTERNAL_PAYMENT",
763 ),
764 "ENTITY" => "PAYMENT",
765 ),
766
767 "PAYMENT_UPDATE" => array(
768 "TRIGGER_FIELDS" => array(),
769 "FUNCTION" => "FormatLog",
770 "DATA_FIELDS" => array(
771 "PAID",
772 "PAY_SYSTEM_ID",
773 "PAY_SYSTEM_NAME",
774 "SUM",
775 "IS_RETURN",
776 "ACCOUNT_NUMBER",
777 "EXTERNAL_PAYMENT",
778 "OLD_PAID",
779 "OLD_PAY_SYSTEM_ID",
780 "OLD_PAY_SYSTEM_NAME",
781 "OLD_SUM",
782 "OLD_IS_RETURN",
783 "OLD_ACCOUNT_NUMBER",
784 "OLD_EXTERNAL_PAYMENT",
785 ),
786 "ENTITY" => "PAYMENT",
787 ),
788
789 "SHIPMENT_ADD" => array(
790 "TRIGGER_FIELDS" => array(),
791 "FUNCTION" => "FormatLog",
792 "DATA_FIELDS" => array(
793 "DELIVERY_LOCATION",
794 "PRICE_DELIVERY",
795 "CUSTOM_PRICE_DELIVERY",
796 "ALLOW_DELIVERY",
797 "DEDUCTED",
798 "RESERVED",
799 "DELIVERY_NAME",
800 "DELIVERY_ID",
801 "CANCELED",
802 "MARKED",
803 "SYSTEM",
804 "COMPANY_ID",
805 "DISCOUNT_PRICE",
806 "BASE_PRICE_DELIVERY",
807 "EXTERNAL_DELIVERY",
808
809 "OLD_DELIVERY_LOCATION",
810 "OLD_PRICE_DELIVERY",
811 "OLD_CUSTOM_PRICE_DELIVERY",
812 "OLD_ALLOW_DELIVERY",
813 "OLD_DEDUCTED",
814 "OLD_RESERVED",
815 "OLD_DELIVERY_NAME",
816 "OLD_DELIVERY_ID",
817 "OLD_CANCELED",
818 "OLD_MARKED",
819 "OLD_SYSTEM",
820 "OLD_COMPANY_ID",
821 "OLD_DISCOUNT_PRICE",
822 "OLD_BASE_PRICE_DELIVERY",
823 "OLD_EXTERNAL_DELIVERY",
824 ),
825 "ENTITY" => "SHIPMENT",
826 ),
827
828 "SHIPMENT_UPDATE" => array(
829 "TRIGGER_FIELDS" => array(),
830 "FUNCTION" => "FormatLog",
831 "DATA_FIELDS" => array("DELIVERY_NAME", "DELIVERY_ID", "OLD_DELIVERY_NAME", "OLD_DELIVERY_ID"),
832 "ENTITY" => "SHIPMENT",
833 ),
834
835 "SHIPMENT_ITEM_ADD" => array(
836 "TRIGGER_FIELDS" => array(),
837 "FUNCTION" => "FormatLog",
838 "DATA_FIELDS" => array(
839 "QUANTITY",
840 "RESERVED_QUANTITY",
841 "BASKET_ID",
842 "BASKET_ITEM_NAME",
843 "BASKET_ITEM_PRODUCT_ID",
844 "ORDER_DELIVERY_ID",
845 ),
846 "ENTITY" => "SHIPMENT_ITEM",
847 ),
848
849 "SHIPMENT_ITEM_UPDATE" => array(
850 "TRIGGER_FIELDS" => array(),
851 "FUNCTION" => "FormatLog",
852 "DATA_FIELDS" => array(
853 "BASKET_ID",
854 "BASKET_ITEM_NAME",
855 "BASKET_ITEM_PRODUCT_ID",
856 "ORDER_DELIVERY_ID",
857 "QUANTITY",
858 "RESERVED_QUANTITY",
859 "OLD_QUANTITY",
860 "OLD_RESERVED_QUANTITY",
861 ),
862 "ENTITY" => "SHIPMENT_ITEM",
863 ),
864
865 "TAX_ADD" => array(
866 "TRIGGER_FIELDS" => array(),
867 "FUNCTION" => "FormatLog",
868 "DATA_FIELDS" => array(),
869 "ENTITY" => "TAX",
870 ),
871
872 "TAX_UPDATE" => array(
873 "TRIGGER_FIELDS" => array(),
874 "FUNCTION" => "FormatLog",
875 "DATA_FIELDS" => array(),
876 "ENTITY" => "TAX",
877 ),
878
879 "TAX_DELETED" => array(
880 "TRIGGER_FIELDS" => array(),
881 "FUNCTION" => "FormatLog",
882 "DATA_FIELDS" => array(),
883 "ENTITY" => "TAX",
884 ),
885
886 "TAX_DUPLICATE_DELETED" => array(
887 "TRIGGER_FIELDS" => array(),
888 "FUNCTION" => "FormatLog",
889 "DATA_FIELDS" => array(),
890 "ENTITY" => "TAX",
891 ),
892
893
894 "TAX_SAVED" => array(
895 "TRIGGER_FIELDS" => array(),
896 "FUNCTION" => "FormatOrderChange",
897 "DATA_FIELDS" => array(),
898 "ENTITY" => 'TAX'
899 ),
900
901 "PROPERTY_ADD" => array(
902 "TRIGGER_FIELDS" => array(),
903 "FUNCTION" => "FormatLog",
904 "DATA_FIELDS" => array("NAME", "VALUE", "CODE"),
905 "ENTITY" => "PROPERTY",
906 ),
907
908 "PROPERTY_UPDATE" => array(
909 "TRIGGER_FIELDS" => array(),
910 "FUNCTION" => "FormatLog",
911 "DATA_FIELDS" => array(
912 "NAME",
913 "VALUE",
914 "CODE",
915 "OLD_NAME",
916 "OLD_VALUE",
917 "OLD_CODE"
918 ),
919 "ENTITY" => "PROPERTY",
920 ),
921
922 "PROPERTY_REMOVE" => array(
923 "TRIGGER_FIELDS" => array(),
924 "FUNCTION" => "FormatLog",
925 "DATA_FIELDS" => array("NAME", "CODE", "VALUE"),
926 "ENTITY" => "PROPERTY",
927 ),
928
929 "PROPERTY_SAVED" => array(
930 "TRIGGER_FIELDS" => array(),
931 "FUNCTION" => "FormatOrderChange",
932 "DATA_FIELDS" => array(),
933 "ENTITY" => 'PROPERTY'
934 ),
935
936 "DISCOUNT_SAVED" => array(
937 "TRIGGER_FIELDS" => array(),
938 "FUNCTION" => "FormatLog",
939 "DATA_FIELDS" => array(),
940 "ENTITY" => "DISCOUNT",
941 ),
942
943 "ORDER_UPDATE_ERROR" => array(
944 "TRIGGER_FIELDS" => array(),
945 "FUNCTION" => "FormatErrorLog",
946 "DATA_FIELDS" => array("ERROR"),
947 "ENTITY" => 'ORDER'
948 ),
949
950 "BASKET_ITEM_ADD_ERROR" => array(
951 "TRIGGER_FIELDS" => array(),
952 "FUNCTION" => "FormatErrorLog",
953 "DATA_FIELDS" => array("ERROR"),
954 "ENTITY" => 'BASKET_ITEM'
955 ),
956
957 "BASKET_ITEM_UPDATE_ERROR" => array(
958 "TRIGGER_FIELDS" => array(),
959 "FUNCTION" => "FormatErrorLog",
960 "DATA_FIELDS" => array("ERROR"),
961 "ENTITY" => 'BASKET_ITEM'
962 ),
963
964 "SHIPMENT_ADD_ERROR" => array(
965 "TRIGGER_FIELDS" => array(),
966 "FUNCTION" => "FormatErrorLog",
967 "DATA_FIELDS" => array("ERROR"),
968 "ENTITY" => 'SHIPMENT'
969 ),
970
971 "SHIPMENT_UPDATE_ERROR" => array(
972 "TRIGGER_FIELDS" => array(),
973 "FUNCTION" => "FormatErrorLog",
974 "DATA_FIELDS" => array("ERROR"),
975 "ENTITY" => 'SHIPMENT'
976 ),
977
978 "SHIPMENT_ITEM_ADD_ERROR" => array(
979 "TRIGGER_FIELDS" => array(),
980 "FUNCTION" => "FormatErrorLog",
981 "DATA_FIELDS" => array("ERROR"),
982 "ENTITY" => 'SHIPMENT_ITEM'
983 ),
984
985 "SHIPMENT_ITEM_UPDATE_ERROR" => array(
986 "TRIGGER_FIELDS" => array(),
987 "FUNCTION" => "FormatErrorLog",
988 "DATA_FIELDS" => array("ERROR"),
989 "ENTITY" => 'SHIPMENT_ITEM'
990 ),
991
992 "SHIPMENT_ITEM_STORE_ADD_ERROR" => array(
993 "TRIGGER_FIELDS" => array(),
994 "FUNCTION" => "FormatErrorLog",
995 "DATA_FIELDS" => array("ERROR"),
996 "ENTITY" => 'SHIPMENT_ITEM_STORE'
997 ),
998
999 "SHIPMENT_ITEM_STORE_UPDATE_ERROR" => array(
1000 "TRIGGER_FIELDS" => array(),
1001 "FUNCTION" => "FormatErrorLog",
1002 "DATA_FIELDS" => array("ERROR"),
1003 "ENTITY" => 'SHIPMENT_ITEM_STORE'
1004 ),
1005
1006 "SHIPMENT_ITEM_BASKET_ITEM_EMPTY_ERROR" => array(
1007 "TRIGGER_FIELDS" => array(),
1008 "FUNCTION" => "FormatErrorLog",
1009 "DATA_FIELDS" => array("ERROR"),
1010 "ENTITY" => 'SHIPMENT_ITEM'
1011 ),
1012
1013 "MARKER_SUCCESS" => array(
1014 "TRIGGER_FIELDS" => array(),
1015 "FUNCTION" => "FormatMarkerSuccess",
1016 "DATA_FIELDS" => array("ENTITY_ID", "MESSAGE"),
1017 "ENTITY" => 'SHIPMENT'
1018 ),
1019 "ORDER_SYNCHRONIZATION_IMPORT" => array(
1020 "TRIGGER_FIELDS" => array(),
1021 "FUNCTION" => "FormatLog",
1022 "DATA_FIELDS" => array(),
1023 "ENTITY" => 'ORDER'
1024 ),
1025 "ORDER_SYNCHRONIZATION_EXPORT" => array(
1026 "TRIGGER_FIELDS" => array(),
1027 "FUNCTION" => "FormatLog",
1028 "DATA_FIELDS" => array(),
1029 "ENTITY" => 'ORDER'
1030 ),
1031 "ORDER_SYNCHRONIZATION_EXPORT_ERROR" => array(
1032 "TRIGGER_FIELDS" => array(),
1033 "FUNCTION" => "FormatErrorLog",
1034 "DATA_FIELDS" => array("ERROR"),
1035 "ENTITY" => 'BASKET_ITEM'
1036 ),
1037 );
1038
1039 public static function FormatBasketAdded($data)
1040 {
1041 $info = GetMessage("SOC_BASKET_ADDED_INFO");
1042
1043 $info = static::doProcessLogMessage($info, $data);
1044
1045 return array(
1046 "NAME" => GetMessage("SOC_BASKET_ADDED"),
1047 "INFO" => $info,
1048 );
1049 }
1050
1051 public static function FormatBasketRemoved($data)
1052 {
1053 $info = GetMessage("SOC_BASKET_REMOVED_INFO");
1054
1055 $info = static::doProcessLogMessage($info, $data);
1056
1057 return array(
1058 "NAME" => GetMessage("SOC_BASKET_REMOVED"),
1059 "INFO" => $info,
1060 );
1061 }
1062
1063 public static function FormatOrderMarked($data)
1064 {
1065 if (is_array($data) && isset($data["REASON_MARKED"]) && $data["REASON_MARKED"] <> '')
1066 {
1067 $info = GetMessage("SOC_ORDER_MARKED_INFO");
1068
1069 $info = static::doProcessLogMessage($info, $data);
1070 }
1071 else
1072 $info = GetMessage("SOC_ORDER_NOT_MARKED");
1073
1074 return array(
1075 "NAME" => GetMessage("SOC_ORDER_MARKED"),
1076 "INFO" => $info
1077 );
1078 }
1079
1080 public static function FormatOrderReserved($data)
1081 {
1082 return array(
1083 "NAME" => GetMessage("SOC_ORDER_RESERVED"),
1084 "INFO" => (is_array($data) && $data["RESERVED"] == "Y") ? GetMessage("SOC_ORDER_RESERVED_Y") : GetMessage("SOC_ORDER_RESERVED_N")
1085 );
1086 }
1087
1088 public static function FormatOrderDeducted($data)
1089 {
1090 if (is_array($data) && $data["DEDUCTED"] == "Y")
1091 {
1092 $info = GetMessage("SOC_ORDER_DEDUCTED_Y");
1093 $info = static::doProcessLogMessage($info, $data);
1094 }
1095 else
1096 {
1097 $info = GetMessage("SOC_ORDER_DEDUCTED_N");
1098 $info = static::doProcessLogMessage($info, $data);
1099 }
1100
1101 return array(
1102 "NAME" => GetMessage("SOC_ORDER_DEDUCTED"),
1103 "INFO" => $info
1104 );
1105 }
1106
1107 public static function FormatOrderCanceled($data)
1108 {
1109 if (is_array($data) && $data["CANCELED"] == "Y")
1110 {
1111 $info = GetMessage("SOC_ORDER_CANCELED_Y");
1112 $info = static::doProcessLogMessage($info, $data);
1113 }
1114 else
1115 {
1116 $info = GetMessage("SOC_ORDER_CANCELED_N");
1117 $info = static::doProcessLogMessage($info, $data);
1118 }
1119
1120 return array(
1121 "NAME" => GetMessage("SOC_ORDER_CANCELED"),
1122 "INFO" => $info
1123 );
1124 }
1125
1126 public static function FormatOrderCommented($data)
1127 {
1128 $info = GetMessage("SOC_ORDER_COMMENTED_INFO");
1129 $info = static::doProcessLogMessage($info, $data);
1130
1131 return array(
1132 "NAME" => GetMessage("SOC_ORDER_COMMENTED"),
1133 "INFO" => $info
1134 );
1135 }
1136
1137 public static function FormatOrderStatusChanged($data)
1138 {
1139 $info = GetMessage("SOC_ORDER_STATUS_CHANGED_INFO");
1140 if (is_array($data))
1141 {
1142 foreach ($data as $param => $value)
1143 {
1144 if ($param == "STATUS_ID")
1145 {
1146 $res = CSaleStatus::GetByID($value);
1147 $value = "\"".$res["NAME"]."\"";
1148 }
1149
1150 $info = str_replace("#".$param."#", $value, $info);
1151 }
1152 }
1153 else
1154 {
1155 $info = $data;
1156 }
1157
1158 return array(
1159 "NAME" => GetMessage("SOC_ORDER_STATUS_CHANGED"),
1160 "INFO" => $info
1161 );
1162 }
1163
1164 public static function FormatOrderDeliveryAllowed($data)
1165 {
1166 return array(
1167 "NAME" => GetMessage("SOC_ORDER_DELIVERY_ALLOWED"),
1168 "INFO" => (is_array($data) && $data["ALLOW_DELIVERY"] == "Y") ? GetMessage("SOC_ORDER_DELIVERY_ALLOWED_Y") : GetMessage("SOC_ORDER_DELIVERY_ALLOWED_N")
1169 );
1170 }
1171
1172 public static function FormatOrderDeliveryDocChanged($data)
1173 {
1174 $info = GetMessage("SOC_ORDER_DELIVERY_DOC_CHANGED_INFO");
1175 $info = static::doProcessLogMessage($info, $data);
1176
1177 return array(
1178 "NAME" => GetMessage("SOC_ORDER_DELIVERY_DOC_CHANGED"),
1179 "INFO" => $info
1180 );
1181 }
1182
1184 {
1185 $info = GetMessage("SOC_ORDER_PAYMENT_SYSTEM_CHANGED_INFO");
1186
1187 if (is_array($data))
1188 {
1189 foreach ($data as $param => $value)
1190 {
1191 if ($param == "PAY_SYSTEM_ID")
1192 {
1193 $res = CSalePaySystem::GetByID($value);
1194 $value = "\"".$res["NAME"]."\"";
1195 }
1196
1197 $info = str_replace("#".$param."#", $value, $info);
1198 }
1199 }
1200 else
1201 {
1202 $info = $data;
1203 }
1204
1205 return array(
1206 "NAME" => GetMessage("SOC_ORDER_PAYMENT_SYSTEM_CHANGED"),
1207 "INFO" => $info
1208 );
1209 }
1210
1212 {
1213 $isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'Y');
1214 $info = GetMessage("SOC_ORDER_DELIVERY_SYSTEM_CHANGED_INFO");
1215 if (is_array($data))
1216 {
1217 foreach ($data as $param => $value)
1218 {
1219 if ($param == "DELIVERY_ID")
1220 {
1221 if (!array_key_exists('DELIVERY_NAME', $data) && strval($data['DELIVERY_NAME']) != '')
1222 {
1223 if (mb_strpos($value, ":") !== false)
1224 {
1225 $arId = explode(":", $value);
1226 $dbDelivery = CSaleDeliveryHandler::GetBySID($arId[0]);
1227 $arDelivery = $dbDelivery->Fetch();
1228
1229 $value = "\"".htmlspecialcharsEx($arDelivery["NAME"])."\"";
1230 }
1231 elseif (intval($value) > 0)
1232 {
1233 if ($isOrderConverted != 'N')
1234 {
1236 }
1237 else
1238 {
1239 $arDelivery = CSaleDelivery::GetByID($value);
1240 }
1241 $value = "\"".$arDelivery["NAME"]."\"";
1242 }
1243 }
1244 else
1245 {
1246 $value = "\"".$data['DELIVERY_NAME']."\"";
1247 }
1248 }
1249 elseif($param == "DELIVERY_NAME")
1250 {
1251 $value = "\"".$value."\"";
1252 }
1253 else
1254 {
1255 continue;
1256 }
1257
1258 $info = str_replace("#".$param."#", $value, $info);
1259 }
1260 }
1261 else
1262 {
1263 $info = $data;
1264 }
1265
1266 return array(
1267 "NAME" => GetMessage("SOC_ORDER_DELIVERY_SYSTEM_CHANGED"),
1268 "INFO" => $info
1269 );
1270 }
1271
1272 public static function FormatOrderPersonTypeChanged($data)
1273 {
1274 $info = GetMessage("SOC_ORDER_PERSON_TYPE_CHANGED_INFO");
1275
1276 if (is_array($data))
1277 {
1278 foreach ($data as $param => $value)
1279 {
1280 if ($param == "PERSON_TYPE_ID")
1281 {
1283 $value = "\"".$res["NAME"]."\"";
1284 }
1285
1286 $info = str_replace("#".$param."#", $value, $info);
1287 }
1288 }
1289 else
1290 {
1291 $info = $data;
1292 }
1293
1294 return array(
1295 "NAME" => GetMessage("SOC_ORDER_PERSON_TYPE_CHANGED"),
1296 "INFO" => $info
1297 );
1298 }
1299
1301 {
1302 $info = GetMessage("SOC_ORDER_PAYMENT_VOUCHER_CHANGED_INFO");
1303 $info = static::doProcessLogMessage($info, $data);
1304
1305 return array(
1306 "NAME" => GetMessage("SOC_ORDER_PAYMENT_VOUCHER_CHANGED"),
1307 "INFO" => $info
1308 );
1309 }
1310
1311 public static function FormatOrderPayed($data)
1312 {
1313 return array(
1314 "NAME" => GetMessage("SOC_ORDER_PAYED"),
1315 "INFO" => (is_array($data) && $data["PAYED"] == "Y") ? GetMessage("SOC_ORDER_PAYED_Y") : GetMessage("SOC_ORDER_PAYED_N")
1316 );
1317 }
1318
1320 {
1321 $info = GetMessage("SOC_ORDER_TRACKING_NUMBER_CHANGED_INFO");
1322 $info = static::doProcessLogMessage($info, $data);
1323
1324 return array(
1325 "NAME" => GetMessage("SOC_ORDER_TRACKING_NUMBER_CHANGED"),
1326 "INFO" => $info
1327 );
1328 }
1329
1331 {
1332 $info = GetMessage("SOC_ORDER_USER_DESCRIPTION_CHANGED_INFO");
1333 $info = static::doProcessLogMessage($info, $data);
1334
1335 return array(
1336 "NAME" => GetMessage("SOC_ORDER_USER_DESCRIPTION_CHANGED"),
1337 "INFO" => $info
1338 );
1339 }
1340
1342 {
1343 if (is_array($data))
1344 {
1345 $info = GetMessage("SOC_ORDER_PRICE_DELIVERY_CHANGED_INFO", array("#AMOUNT#" => CCurrencyLang::CurrencyFormat($data["PRICE_DELIVERY"], $data["CURRENCY"], true)));
1346 }
1347 else
1348 {
1349 $info = GetMessage("SOC_ORDER_PRICE_DELIVERY_CHANGED_INFO");
1350 }
1351
1352
1353 return array(
1354 "NAME" => GetMessage("SOC_ORDER_PRICE_DELIVERY_CHANGED"),
1355 "INFO" => $info
1356 );
1357 }
1358
1359 public static function FormatOrderPriceChanged($data)
1360 {
1361 if (is_array($data))
1362 {
1363 $info = GetMessage(
1364 'SOC_ORDER_PRICE_CHANGED_INFO',
1365 [
1366 '#AMOUNT#' => CCurrencyLang::CurrencyFormat($data['PRICE'], $data['CURRENCY'], true),
1367 '#OLD_AMOUNT#' => CCurrencyLang::CurrencyFormat($data['OLD_PRICE'], $data['CURRENCY'], true),
1368 ]
1369 );
1370 }
1371 else
1372 {
1373 $info = GetMessage("SOC_ORDER_PRICE_CHANGED_INFO");
1374 }
1375
1376 return [
1377 'NAME' => GetMessage('SOC_ORDER_PRICE_CHANGED'),
1378 'INFO' => $info,
1379 ];
1380 }
1381
1382 public static function FormatBasketQuantityChanged($data)
1383 {
1384 $info = GetMessage("SOC_BASKET_QUANTITY_CHANGED_INFO");
1385 $info = static::doProcessLogMessage($info, $data);
1386
1387 return array(
1388 "NAME" => GetMessage("SOC_BASKET_QUANTITY_CHANGED"),
1389 "INFO" => $info
1390 );
1391 }
1392
1393 public static function FormatOrder1CImport($data)
1394 {
1395 return array(
1396 "NAME" => GetMessage("SOC_ORDER_1C_IMPORT"),
1397 "INFO" => "",
1398 );
1399 }
1400
1401 public static function FormatOrderAdded($data)
1402 {
1403 return array(
1404 "NAME" => GetMessage("SOC_ORDER_ADDED"),
1405 "INFO" => "",
1406 );
1407 }
1408
1409 public static function FormatOrderUpdated($data)
1410 {
1411 return array(
1412 "NAME" => GetMessage("SOC_ORDER_UPDATED"),
1413 "INFO" => "",
1414 );
1415 }
1416
1417 public static function FormatBasketPriceChanged($data)
1418 {
1419 $info = GetMessage("SOC_BASKET_PRICE_CHANGED_INFO");
1420 $info = static::doProcessLogMessage($info, $data);
1421
1422 if (is_array($data))
1423 {
1424 $info = str_replace("#AMOUNT#", CCurrencyLang::CurrencyFormat($data["PRICE"], $data["CURRENCY"], true), $info);
1425 }
1426
1427 return array(
1428 "NAME" => GetMessage("SOC_BASKET_PRICE_CHANGED"),
1429 "INFO" => $info
1430 );
1431 }
1432
1434 {
1435 if(is_array($data) && $data["RESULT"] == "OK")
1436 {
1437 $reqDescription = GetMessage("SOC_ORDER_DELIVERY_REQUEST_SENT_SUCCESS");
1438 }
1439 else
1440 {
1441 $reqDescription = GetMessage("SOC_ORDER_DELIVERY_REQUEST_SENT_ERROR");
1442
1443 if (is_array($data))
1444 {
1445 if(isset($data["TEXT"]))
1446 $reqDescription .=": ".$data["TEXT"].".";
1447
1448 if(isset($data["DATA"]))
1449 $reqDescription .= GetMessage("SOC_ORDER_DELIVERY_REQUEST_SENT_ADD_INFO").": ".serialize($data["DATA"]);
1450 }
1451
1452 }
1453
1454 return array(
1455 "NAME" => GetMessage("SOC_ORDER_DELIVERY_REQUEST_SENT"),
1456 "INFO" => $reqDescription,
1457 );
1458 }
1459
1460 public static function FormatPaymentPaid($data)
1461 {
1462 $info = (is_array($data) && $data["PAID"] == "Y") ? GetMessage("SOC_PAYMENT_PAID_Y") : GetMessage("SOC_PAYMENT_PAID_N");
1463 $info = static::doProcessLogMessage($info, $data);
1464
1465 return array(
1466 "NAME" => GetMessage("SOC_PAYMENT_PAID"),
1467 "INFO" => $info
1468 );
1469 }
1470
1471 public static function FormatShipmentDeliveryAllowed($data)
1472 {
1473 return array(
1474 "NAME" => GetMessage("SOC_SHIPMENT_ALLOWED"),
1475 "INFO" => (is_array($data) && $data["ALLOW_DELIVERY"] == "Y") ? GetMessage("SOC_SHIPMENT_ALLOWED_Y") : GetMessage("SOC_SHIPMENT_ALLOWED_N")
1476 );
1477 }
1478
1479 public static function FormatShipmentAdded($data)
1480 {
1481 $info = GetMessage("SOC_SHIPMENT_CREATE_INFO");
1482 $info = static::doProcessLogMessage($info, $data);
1483
1484 return array(
1485 "NAME" => GetMessage("SOC_SHIPMENT_CREATE"),
1486 "INFO" => $info,
1487 );
1488 }
1489
1490 public static function FormatShipmentMarked($data)
1491 {
1492 $info = "";
1493 if (is_array($data) && isset($data["REASON_MARKED"]) && $data["REASON_MARKED"] <> '')
1494 {
1495 $info = GetMessage("SOC_SHIPMENT_MARKED_INFO");
1496 $info = static::doProcessLogMessage($info, $data);
1497 }
1498
1499 return array(
1500 "NAME" => GetMessage("SOC_SHIPMENT_MARKED"),
1501 "INFO" => $info
1502 );
1503 }
1504
1505 public static function FormatShipmentItemBasketAdded($data)
1506 {
1507 $info = GetMessage("SOC_SHIPMENT_ITEM_BASKET_ADDED_INFO");
1508 $info = static::doProcessLogMessage($info, $data);
1509
1510 return array(
1511 "NAME" => GetMessage("SOC_SHIPMENT_ITEM_BASKET_ADDED"),
1512 "INFO" => $info,
1513 );
1514 }
1515
1517 {
1518 $info = GetMessage("SOC_SHIPMENT_ITEM_BASKET_REMOVED_INFO");
1519 $info = static::doProcessLogMessage($info, $data);
1520
1521 return array(
1522 "NAME" => GetMessage("SOC_SHIPMENT_ITEM_BASKET_REMOVED"),
1523 "INFO" => $info,
1524 );
1525 }
1526
1527 public static function FormatShipmentRemoved($data)
1528 {
1529 $info = GetMessage("SOC_SHIPMENT_REMOVED_INFO");
1530 $info = static::doProcessLogMessage($info, $data);
1531
1532 return array(
1533 "NAME" => GetMessage("SOC_SHIPMENT_REMOVED"),
1534 "INFO" => $info,
1535 );
1536 }
1537
1538 public static function FormatShipmentCanceled($data)
1539 {
1540 if (is_array($data) && $data["CANCELED"] == "Y")
1541 {
1542 $info = GetMessage("SOC_SHIPMENT_CANCELED_Y");
1543 $info = static::doProcessLogMessage($info, $data);
1544 }
1545 else
1546 {
1547 $info = GetMessage("SOC_SHIPMENT_CANCELED_N");
1548 $info = static::doProcessLogMessage($info, $data);
1549 }
1550
1551 return array(
1552 "NAME" => GetMessage("SOC_SHIPMENT_CANCELED"),
1553 "INFO" => $info
1554 );
1555 }
1556
1557 public static function FormatPaymentAdded($data)
1558 {
1559 $info = GetMessage("SOC_PAYMENT_CREATE_INFO");
1560
1561 $info = static::doProcessLogMessage($info, $data);
1562
1563 return array(
1564 "NAME" => GetMessage("SOC_PAYMENT_CREATE"),
1565 "INFO" => $info,
1566 );
1567 }
1568
1569 public static function FormatPaymentRemoved($data)
1570 {
1571 $info = GetMessage("SOC_PAYMENT_REMOVED_INFO");
1572 $info = static::doProcessLogMessage($info, $data);
1573
1574 return array(
1575 "NAME" => GetMessage("SOC_PAYMENT_REMOVED"),
1576 "INFO" => $info,
1577 );
1578 }
1579
1580 public static function FormatShipmentDeducted($data)
1581 {
1582 return array(
1583 "NAME" => GetMessage("SOC_SHIPMENT_DEDUCTED"),
1584 "INFO" => ($data["DEDUCTED"] == "Y") ? GetMessage("SOC_SHIPMENT_DEDUCTED_Y") : GetMessage("SOC_SHIPMENT_DEDUCTED_N")
1585 );
1586 }
1587
1588 public static function FormatShipmentReserved($data)
1589 {
1590 return array(
1591 "NAME" => GetMessage("SOC_SHIPMENT_RESERVED"),
1592 "INFO" => ($data["RESERVED"] == "Y") ? GetMessage("SOC_SHIPMENT_RESERVED_Y") : GetMessage("SOC_SHIPMENT_RESERVED_N")
1593 );
1594 }
1595
1596 public static function FormatPaymentSystemChanged($data)
1597 {
1598 $info = GetMessage("SOC_PAYMENT_PAY_SYSTEM_CHANGE_INFO");
1599
1600 $info = static::doProcessLogMessage($info, $data);
1601
1602 return array(
1603 "NAME" => GetMessage("SOC_PAYMENT_PAY_SYSTEM_CHANGE"),
1604 "INFO" => $info
1605 );
1606 }
1607
1609 {
1610 $info = GetMessage("SOC_SHIPMENT_PRICE_DELIVERY_CHANGED_INFO");
1611
1612 $info = static::doProcessLogMessage($info, $data);
1613
1614 return array(
1615 "NAME" => GetMessage("SOC_SHIPMENT_PRICE_DELIVERY_CHANGED"),
1616 "INFO" => $info
1617 );
1618 }
1619
1620 public static function FormatPaymentVoucherChanged($arData)
1621 {
1623 }
1624
1625 public static function FormatPaymentPriceChanged($data)
1626 {
1627 $info = GetMessage("SOC_SHIPMENT_PRICE_DELIVERY_CHANGED_INFO");
1628
1629 $info = static::doProcessLogMessage($info, $data);
1630
1631 return array(
1632 "NAME" => GetMessage("SOC_SHIPMENT_PRICE_DELIVERY_CHANGED"),
1633 "INFO" => $info
1634 );
1635 }
1636
1637 public static function FormatShipmentTrackingNumberChanged($arData)
1638 {
1640 }
1641
1642 public static function FormatShipmentDeliveryDocChanged($arData)
1643 {
1645 }
1646
1647 public static function FormatShipmentStatusChanged($arData)
1648 {
1649 $info = GetMessage("SOC_SHIPMENT_STATUS_CHANGE_INFO");
1650
1651 foreach ($arData as $param => $value)
1652 {
1653 $status = \Bitrix\Sale\Helpers\Admin\Blocks\OrderShipmentStatus::getShipmentStatusList($arData['STATUS_ID']);
1654 $info = str_replace("#".$param."#", $status[$value], $info);
1655 }
1656
1657 return array(
1658 "NAME" => GetMessage("SOC_SHIPMENT_STATUS_CHANGE"),
1659 "INFO" => $info
1660 );
1661 }
1662
1663 public static function FormatShipmentQuantityChanged($data)
1664 {
1665 $info = GetMessage("SOC_SHIPMENT_ITEM_QUANTITY_CHANGE_INFO");
1666
1667 $info = static::doProcessLogMessage($info, $data);
1668
1669 return array(
1670 "NAME" => GetMessage("SOC_SHIPMENT_ITEM_QUANTITY_CHANGE"),
1671 "INFO" => $info
1672 );
1673 }
1674
1682 public static function FormatLog($data, $type, $entity = null)
1683 {
1684 $info = "";
1685 if (!empty($data))
1686 {
1687 $info = GetMessage("SOC_".mb_strtoupper($type)."_INFO");
1688
1689 if (is_array($data))
1690 {
1691 if (strval($info) != "")
1692 {
1693 foreach ($data as $param => $value)
1694 {
1695 $info = str_replace("#".$param."#", $value, $info);
1696
1697 if (array_key_exists("OLD_".$param, $data))
1698 {
1699 $info = str_replace("#OLD_".$param."#", $data["OLD_".$param], $info);
1700 }
1701 }
1702 }
1703 else
1704 {
1705 foreach ($data as $param => $value)
1706 {
1707 if (mb_strpos($param, "OLD_") === 0)
1708 continue;
1709
1710 $info .=(strval($info) != "" ? "; " : ""). $param.": ".$value;
1711
1712 if (array_key_exists("OLD_".$param, $data))
1713 {
1714 $info.= " OLD_".$param.": ".$data["OLD_".$param];
1715 }
1716 }
1717 }
1718 }
1719 else
1720 {
1721 $info = $data;
1722 }
1723 }
1724
1725 $title = GetMessage("SOC_".mb_strtoupper($type)."_TITLE");
1726
1727 if (strval($title) == "")
1728 $title = GetMessage("SOC_".mb_strtoupper($entity)."_TITLE");
1729
1730 return array(
1731 "NAME" => $title,
1732 "INFO" => $info
1733 );
1734 }
1735
1742 public static function FormatOrderChange($data, $type, $entity = null)
1743 {
1744 $info = "";
1745 if (!empty($data))
1746 {
1747 $info = GetMessage("SOC_".mb_strtoupper($type)."_INFO");
1748
1749 if (is_array($data))
1750 {
1751 if (strval($info) != "")
1752 {
1753 foreach ($data as $param => $value)
1754 {
1755 $info = str_replace("#".$param."#", $value, $info);
1756
1757 if (array_key_exists("OLD_".$param, $data))
1758 {
1759 $info = str_replace("#OLD_".$param."#", $data["OLD_".$param], $info);
1760 }
1761 else
1762 {
1763 $info = str_replace("#OLD_".$param."#", "", $info);
1764 }
1765 }
1766 }
1767 else
1768 {
1769 foreach ($data as $param => $value)
1770 {
1771 if (mb_strpos($param, "OLD_") === 0)
1772 continue;
1773
1774 $info .=(strval($info) != "" ? "; " : ""). $param.": ".$value;
1775
1776 if (array_key_exists("OLD_".$param, $data))
1777 {
1778 $info.= " OLD_".$param.": ".$data["OLD_".$param];
1779 }
1780 }
1781 }
1782 }
1783 else
1784 {
1785 $info = $data;
1786 }
1787 }
1788
1789 $title = GetMessage("SOC_".mb_strtoupper($type)."_TITLE");
1790
1791 if (strval($title) == "")
1792 $title = GetMessage("SOC_".mb_strtoupper($entity)."_TITLE");
1793
1794 return array(
1795 "NAME" => $title,
1796 "INFO" => $info
1797 );
1798 }
1799
1807 public static function FormatErrorLog($data, $type, $entity = null)
1808 {
1809 $info = "";
1810 if (!empty($data))
1811 {
1812 $info = GetMessage("SOC_".mb_strtoupper($type)."_INFO");
1813
1814 if (is_array($data))
1815 {
1816
1817 foreach ($data as $param => $value)
1818 {
1819 if (is_array($value) && !empty($value))
1820 {
1821 $errorList = $value;
1822 $value = "";
1823 foreach ($errorList as $errorMsg)
1824 {
1825 $value .= (strval($value) != "" ? "\n" : ""). $errorMsg;
1826 }
1827 }
1828
1829 $info = str_replace("#".$param."#", $value, $info);
1830 }
1831 }
1832 else
1833 {
1834 $info = $data;
1835 }
1836 }
1837
1838 $title = GetMessage("SOC_".mb_strtoupper($type)."_TITLE");
1839
1840 if (strval($title) == "")
1841 $title = GetMessage("SOC_".mb_strtoupper($entity)."_TITLE");
1842
1843 return array(
1844 "NAME" => $title,
1845 "INFO" => $info
1846 );
1847 }
1848
1856 public static function getOrderResponsibleName($id = null)
1857 {
1858 if (intval($id) <= 0)
1859 return false;
1860
1861 static $orderResponsibleList = array();
1862
1863 if (isset($orderResponsibleList[$id]))
1864 {
1865 return $orderResponsibleList[$id];
1866 }
1867 $userIterator = \Bitrix\Main\UserTable::getList(array(
1868 'select' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'EMAIL'),
1869 'filter' => array('=ID' => intval($id))
1870 ));
1871
1872 $userName = false;
1873 if ($userData = $userIterator->fetch())
1874 {
1875 $userName = \CUser::FormatName(\CSite::GetNameFormat(true), $userData, true);
1876 $orderResponsibleList[$id] = $userName;
1877 }
1878
1879 return $userName;
1880 }
1881
1888 private static function doProcessLogMessage($text, $data)
1889 {
1890 if (is_array($data))
1891 {
1892 foreach ($data as $param => $value)
1893 {
1894 $text = str_replace("#".$param."#", $value, $text);
1895 }
1896 }
1897
1898 return $text;
1899 }
1900
1901 public static function FormatMarkerSuccess($data)
1902 {
1903 $info = GetMessage("SOC_MARKER_SUCCESS_INFO");
1904
1905
1906 if (!empty($data['ENTITY_TYPE']))
1907 {
1908 $data['ENTITY_NAME'] = \Bitrix\Main\Localization\Loc::getMessage('SOC_MARKER_'. $data['ENTITY_TYPE'] .'_INFO');
1909 }
1910
1911 $info = static::doProcessLogMessage($info, $data);
1912
1913
1914 return array(
1915 "NAME" => GetMessage("SOC_MARKER_SUCCESS"),
1916 "INFO" => $info,
1917 );
1918 }
1919}
$arParams
Определения access_dialog.php:21
$connection
Определения actionsdefinitions.php:38
$type
Определения options.php:106
$db_res
Определения options_user_settings.php:8
$arResult
Определения generate_coupon.php:16
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getConnection($name="")
Определения application.php:638
static get($moduleId, $name, $default="", $siteId=false)
Определения option.php:30
static getMessage($code, $replace=null, $language=null)
Определения loc.php:30
static getList(array $parameters=array())
Определения datamanager.php:431
static getById($deliveryId)
Определения manager.php:53
static GetBySID($SID, $SITE_ID=false)
Определения delivery_handler.php:519
static GetByID($ID)
Определения delivery.php:249
static Delete($ID)
Определения order_change.php:51
static GetByID($ID)
Определения order_change.php:30
static GetRecordDescription($type, $data)
Определения order_change.php:296
static CheckFields($ACTION, &$arFields, $ID=0)
Определения order_change.php:7
static deleteByOrderId($id)
Определения order_change.php:68
static AddRecordsByFields($orderId, array $arOldFields, array $arNewFields, $arDeleteFields=array(), $entityName="", $entityId=null, $entity=null, array $data=array())
Определения order_change.php:161
static AddRecord($orderId, $type, $data=array(), $entityName=null, $entityId=null)
Определения order_change.php:126
static GetByID($id, $personTypeId=0)
Определения pay_system.php:82
static GetByID($ID)
Определения person_type.php:69
static FormatOrder1CImport($data)
Определения order_change.php:1393
static FormatOrderReserved($data)
Определения order_change.php:1080
static FormatShipmentPriceDeliveryChanged($data)
Определения order_change.php:1608
static FormatOrderDeducted($data)
Определения order_change.php:1088
static FormatOrderPaymentVoucherChanged($data)
Определения order_change.php:1300
static FormatPaymentPriceChanged($data)
Определения order_change.php:1625
static FormatShipmentItemBasketAdded($data)
Определения order_change.php:1505
static FormatOrderPayed($data)
Определения order_change.php:1311
static FormatBasketPriceChanged($data)
Определения order_change.php:1417
static FormatShipmentDeliveryDocChanged($arData)
Определения order_change.php:1642
static FormatOrderPersonTypeChanged($data)
Определения order_change.php:1272
static FormatShipmentCanceled($data)
Определения order_change.php:1538
static FormatOrderUserDescriptionChanged($data)
Определения order_change.php:1330
static FormatOrderDeliveryRequestSent($data)
Определения order_change.php:1433
static FormatLog($data, $type, $entity=null)
Определения order_change.php:1682
static FormatShipmentReserved($data)
Определения order_change.php:1588
static FormatShipmentDeducted($data)
Определения order_change.php:1580
static FormatBasketAdded($data)
Определения order_change.php:1039
static FormatOrderDeliverySystemChanged($data)
Определения order_change.php:1211
static getOrderResponsibleName($id=null)
Определения order_change.php:1856
static FormatOrderStatusChanged($data)
Определения order_change.php:1137
static FormatShipmentMarked($data)
Определения order_change.php:1490
static FormatShipmentRemoved($data)
Определения order_change.php:1527
static FormatShipmentTrackingNumberChanged($arData)
Определения order_change.php:1637
static FormatOrderUpdated($data)
Определения order_change.php:1409
static FormatPaymentPaid($data)
Определения order_change.php:1460
static FormatPaymentSystemChanged($data)
Определения order_change.php:1596
static FormatShipmentStatusChanged($arData)
Определения order_change.php:1647
static FormatBasketRemoved($data)
Определения order_change.php:1051
static FormatShipmentQuantityChanged($data)
Определения order_change.php:1663
static FormatOrderPaymentSystemChanged($data)
Определения order_change.php:1183
static FormatOrderAdded($data)
Определения order_change.php:1401
static FormatOrderMarked($data)
Определения order_change.php:1063
static FormatMarkerSuccess($data)
Определения order_change.php:1901
static FormatOrderTrackingNumberChanged($data)
Определения order_change.php:1319
static FormatPaymentVoucherChanged($arData)
Определения order_change.php:1620
static FormatErrorLog($data, $type, $entity=null)
Определения order_change.php:1807
static FormatOrderDeliveryDocChanged($data)
Определения order_change.php:1172
static $operationTypes
Определения order_change.php:357
static FormatPaymentRemoved($data)
Определения order_change.php:1569
static FormatShipmentAdded($data)
Определения order_change.php:1479
static FormatOrderChange($data, $type, $entity=null)
Определения order_change.php:1742
static FormatShipmentDeliveryAllowed($data)
Определения order_change.php:1471
static FormatBasketQuantityChanged($data)
Определения order_change.php:1382
static FormatShipmentItemBasketRemoved($data)
Определения order_change.php:1516
static FormatOrderPriceDeliveryChanged($data)
Определения order_change.php:1341
static FormatOrderCommented($data)
Определения order_change.php:1126
static FormatOrderPriceChanged($data)
Определения order_change.php:1359
static FormatOrderDeliveryAllowed($data)
Определения order_change.php:1164
static FormatOrderCanceled($data)
Определения order_change.php:1107
static FormatPaymentAdded($data)
Определения order_change.php:1557
static Add($arFields)
Определения order_change.php:9
static GetByID($statusId, $languageId=LANGUAGE_ID, $type=null)
Определения status.php:23
$arFields
Определения dblapprove.php:5
$data['IS_AVAILABLE']
Определения .description.php:13
$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
$entity
global $DB
Определения cron_frame.php:29
global $USER
Определения csv_new_run.php:40
$ACTION
Определения csv_new_setup.php:27
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$status
Определения session.php:10
if($NS['step']==6) if( $NS[ 'step']==7) if(COption::GetOptionInt('main', 'disk_space', 0) > 0) $info
Определения backup.php:924
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
is_set($a, $k=false)
Определения tools.php:2133
GetMessage($name, $aReplace=null)
Определения tools.php:3397
TruncateText($strText, $intLen)
Определения tools.php:2185
$value
Определения Param.php:39
$entityId
Определения payment.php:4
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
$text
Определения template_pdf.php:79
$errorMsg
Определения refund.php:16
else $userName
Определения order_form.php:75
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$title
Определения pdf.php:123
$val
Определения options.php:1793
$GLOBALS['_____370096793']
Определения update_client.php:1
$fields
Определения yandex_run.php:501