Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
triggerordercancel.php
1
<?
2
3
namespace
Bitrix\Sale\Sender
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\Loader
;
7
use
Bitrix\Sale
;
8
9
if
(!Loader::includeModule(
'sender'
))
10
{
11
return
;
12
}
13
14
Loc::loadMessages
(__FILE__);
15
16
class
TriggerOrderCancel
extends
\Bitrix\Sender\TriggerConnector
17
{
18
public
function
getName
()
19
{
20
return
Loc::getMessage
(
'sender_trigger_order_cancel_name'
);
21
}
22
23
public
function
getCode
()
24
{
25
return
"order_cancel"
;
26
}
27
28
public
function
getEventModuleId
()
29
{
30
return
'sale'
;
31
}
32
33
public
function
getEventType
()
34
{
35
return
"OnSaleCancelOrder"
;
36
}
37
39
public
static
function
canBeTarget
()
40
{
41
return
false
;
42
}
43
44
public
function
filter
()
45
{
46
$eventData = $this->getParam(
'EVENT'
);
47
if
($eventData[1] !=
'Y'
)
48
return
false
;
49
else
50
return
$this->
filterConnectorData
();
51
}
52
53
public
function
getConnector
()
54
{
55
$connector
= new \Bitrix\Sale\Sender\ConnectorOrder;
56
$connector
->setModuleId(
'sale'
);
57
58
return
$connector
;
59
}
60
62
public
function
getProxyFieldsFromEventToConnector
()
63
{
64
$eventData = $this->getParam(
'EVENT'
);
65
return
array(
'ID'
=> $eventData[0],
'LID'
=> $this->getSiteId());
66
}
67
69
public
function
getMailEventToPrevent
()
70
{
71
$eventData = $this->getParam(
'EVENT'
);
72
return
array(
73
'EVENT_NAME'
=>
'SALE_ORDER_CANCEL'
,
74
'FILTER'
=> array(
'ORDER_ID'
=> $eventData[0])
75
);
76
}
77
82
public
function
getPersonalizeFields()
83
{
84
$eventData = $this->getParam(
'EVENT'
);
85
$result = [
'ORDER_ID'
=> $eventData[0]];
86
if
((
int
)$eventData[0] <= 0)
87
return
$result;
88
89
$registry = Sale\Registry::getInstance(
Sale
\
Registry::REGISTRY_TYPE_ORDER
);
91
$orderClass = $registry->getOrderClassName();
92
93
$order = $orderClass::load($eventData[0]);
94
if
($order)
95
{
96
$result = [
97
'ORDER_ID'
=> $order->getField(
'ACCOUNT_NUMBER'
),
98
'ORDER_REAL_ID'
=> $order->getId()
99
];
100
}
101
return
$result;
102
}
103
107
public
static
function
getPersonalizeList
()
108
{
109
return
array(
110
array(
111
'CODE'
=>
'ORDER_ID'
,
112
'NAME'
=>
Loc::getMessage
(
'sender_trigger_order_cancel_pers_order_id_name'
),
113
'DESC'
=>
Loc::getMessage
(
'sender_trigger_order_cancel_pers_order_id_desc'
)
114
),
115
);
116
}
117
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Registry\REGISTRY_TYPE_ORDER
const REGISTRY_TYPE_ORDER
Definition
registry.php:16
Bitrix\Sale\Sender\TriggerOrderCancel
Definition
triggerordercancel.php:17
Bitrix\Sale\Sender\TriggerOrderCancel\getEventModuleId
getEventModuleId()
Definition
triggerordercancel.php:28
Bitrix\Sale\Sender\TriggerOrderCancel\getName
getName()
Definition
triggerordercancel.php:18
Bitrix\Sale\Sender\TriggerOrderCancel\getEventType
getEventType()
Definition
triggerordercancel.php:33
Bitrix\Sale\Sender\TriggerOrderCancel\filter
filter()
Definition
triggerordercancel.php:44
Bitrix\Sale\Sender\TriggerOrderCancel\getConnector
getConnector()
Definition
triggerordercancel.php:53
Bitrix\Sale\Sender\TriggerOrderCancel\getProxyFieldsFromEventToConnector
getProxyFieldsFromEventToConnector()
Definition
triggerordercancel.php:62
Bitrix\Sale\Sender\TriggerOrderCancel\getCode
getCode()
Definition
triggerordercancel.php:23
Bitrix\Sale\Sender\TriggerOrderCancel\getPersonalizeList
static getPersonalizeList()
Definition
triggerordercancel.php:107
Bitrix\Sale\Sender\TriggerOrderCancel\canBeTarget
static canBeTarget()
Definition
triggerordercancel.php:39
Bitrix\Sale\Sender\TriggerOrderCancel\getMailEventToPrevent
getMailEventToPrevent()
Definition
triggerordercancel.php:69
Bitrix\Sender\Trigger\TriggerConnector
Definition
triggerconnector.php:13
Bitrix\Sender\Trigger\TriggerConnector\$connector
$connector
Definition
triggerconnector.php:15
Bitrix\Sender\Trigger\TriggerConnector\filterConnectorData
filterConnectorData()
Definition
triggerconnector.php:43
Bitrix\Sale\Sender
Definition
connectororder.php:3
Bitrix\Sale
Sale
modules
sale
lib
sender
triggerordercancel.php
Создано системой
1.10.0