Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
managerexport.php
1
<?php
2
3
namespace
Bitrix\Sale\Exchange
;
4
5
6
7
use
Bitrix\Sale\Exchange\Internals\LoggerDiag
;
8
9
final
class
ManagerExport
extends
ManagerBase
10
{
11
const
SALE_MODE
= 1;
12
const
B24_MODE
= 2;
13
const
SALE_B24_MODE
= 3;
14
const
B24_SALE_MODE
= 4;
15
19
static
public
function
getDirectionType
()
20
{
21
return
self::EXCHANGE_DIRECTION_EXPORT
;
22
}
23
27
static
public
function
configure
(
ImportBase
$entity)
28
{
29
$config = static::getImportByType($entity->
getOwnerTypeId
());
30
31
$entity->
loadSettings
($config->settings);
32
$entity->
loadLogger
($config->logger);
33
}
34
42
static
public
function
registerInstance
($typeId,
ISettingsExport
$settings
)
43
{
44
static::IsDefinedTypeId($typeId);
45
46
if
(self::$instance[$typeId] ===
null
)
47
{
48
$manager =
new
static
();
49
$manager->settings =
$settings
;
50
$manager->logger =
new
LoggerDiag
();
51
52
self::$instance[$typeId] = $manager;
53
}
54
return
self::$instance[$typeId];
55
}
56
57
static
public
function
isSaleMode
()
58
{
59
return
true
;
60
}
61
62
static
public
function
isB24Mode
()
63
{
64
return \CModule::IncludeModule(
'CRM'
);
65
}
66
67
static
public
function
isSaleB24Mode
()
68
{
69
return \Bitrix\Main\Config\Option::get(
"sale"
,
"~IS_SALE_CRM_SITE_MASTER_FINISH"
,
"N"
) ==
"Y"
;
70
}
71
72
static
public
function
isB24SaleMode
()
73
{
74
return \Bitrix\Main\Config\Option::get(
"sale"
,
"~IS_SALE_BSM_SITE_MASTER_FINISH"
,
"N"
)==
"Y"
;
75
}
76
77
static
public
function
getMode
()
78
{
79
//B24 -> +BUS.wizard
80
if
(\
Bitrix
\
Sale
\
Exchange
\
ManagerExport::isB24SaleMode
())
81
{
82
return
static::B24_SALE_MODE;
83
}
84
//BUS -> +B24.wizard
85
elseif(\
Bitrix
\
Sale
\
Exchange
\
ManagerExport::isSaleB24Mode
())
86
{
87
return
static::SALE_B24_MODE;
88
}
89
elseif(\
Bitrix
\
Sale
\
Exchange
\
ManagerExport::isB24Mode
())
90
{
91
return
static::B24_MODE;
92
}
93
else
94
{
95
return
static::SALE_MODE;
96
}
97
}
98
99
static
public
function
isCRMCompatibility
()
100
{
101
//B24 -> +BUS.wizard
102
if
(static::getMode() == static::B24_SALE_MODE)
103
{
104
\CModule::IncludeModule(
'CRM'
);
105
return
true
;
106
}
107
//BUS -> +B24.wizard
108
elseif(static::getMode() == static::SALE_B24_MODE)
109
{
110
return
false
;
111
}
112
elseif(static::getMode() == static::B24_MODE)
113
{
114
\CModule::IncludeModule(
'CRM'
);
115
return
true
;
116
}
117
118
return
false
;
119
}
120
}
Bitrix\Sale\Exchange\ImportBase
Definition
importbase.php:9
Bitrix\Sale\Exchange\ImportBase\loadLogger
loadLogger(Exchange\Internals\Logger $logger)
Definition
importbase.php:265
Bitrix\Sale\Exchange\ImportBase\getOwnerTypeId
getOwnerTypeId()
Bitrix\Sale\Exchange\ImportBase\loadSettings
loadSettings(ISettings $settings)
Definition
importbase.php:193
Bitrix\Sale\Exchange\Internals\LoggerDiag
Definition
loggerdiag.php:7
Bitrix\Sale\Exchange\Logger\Exchange
Definition
exchange.php:11
Bitrix\Sale\Exchange\ManagerBase
Definition
managerbase.php:14
Bitrix\Sale\Exchange\ManagerBase\EXCHANGE_DIRECTION_EXPORT
const EXCHANGE_DIRECTION_EXPORT
Definition
managerbase.php:16
Bitrix\Sale\Exchange\ManagerBase\$settings
$settings
Definition
managerbase.php:20
Bitrix\Sale\Exchange\ManagerExport
Definition
managerexport.php:10
Bitrix\Sale\Exchange\ManagerExport\isB24SaleMode
static isB24SaleMode()
Definition
managerexport.php:72
Bitrix\Sale\Exchange\ManagerExport\isCRMCompatibility
static isCRMCompatibility()
Definition
managerexport.php:99
Bitrix\Sale\Exchange\ManagerExport\isSaleMode
static isSaleMode()
Definition
managerexport.php:57
Bitrix\Sale\Exchange\ManagerExport\isB24Mode
static isB24Mode()
Definition
managerexport.php:62
Bitrix\Sale\Exchange\ManagerExport\configure
static configure(ImportBase $entity)
Definition
managerexport.php:27
Bitrix\Sale\Exchange\ManagerExport\B24_MODE
const B24_MODE
Definition
managerexport.php:12
Bitrix\Sale\Exchange\ManagerExport\isSaleB24Mode
static isSaleB24Mode()
Definition
managerexport.php:67
Bitrix\Sale\Exchange\ManagerExport\SALE_B24_MODE
const SALE_B24_MODE
Definition
managerexport.php:13
Bitrix\Sale\Exchange\ManagerExport\getDirectionType
static getDirectionType()
Definition
managerexport.php:19
Bitrix\Sale\Exchange\ManagerExport\SALE_MODE
const SALE_MODE
Definition
managerexport.php:11
Bitrix\Sale\Exchange\ManagerExport\getMode
static getMode()
Definition
managerexport.php:77
Bitrix\Sale\Exchange\ManagerExport\registerInstance
static registerInstance($typeId, ISettingsExport $settings)
Definition
managerexport.php:42
Bitrix\Sale\Exchange\ManagerExport\B24_SALE_MODE
const B24_SALE_MODE
Definition
managerexport.php:14
Bitrix\Sale\Exchange\ISettingsExport
Definition
isettings.php:15
Bitrix\Sale\Exchange
Definition
basetrait.php:2
Bitrix
Sale
modules
sale
lib
exchange
managerexport.php
Создано системой
1.10.0