Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
managerexport.php
1<?php
2
4
5
6
8
9final 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 {
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
81 {
82 return static::B24_SALE_MODE;
83 }
84 //BUS -> +B24.wizard
86 {
87 return static::SALE_B24_MODE;
88 }
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}
loadLogger(Exchange\Internals\Logger $logger)
loadSettings(ISettings $settings)
static configure(ImportBase $entity)
static registerInstance($typeId, ISettingsExport $settings)