Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
exportsettings.php
1<?php
2
4
5
10
12 implements ISettingsExport
13{
14
19 static protected function loadCurrentSettings()
20 {
21 if(self::$currentSettings === null)
22 {
23 self::$currentSettings['export']['SITE_ID'] = Option::get("sale", "1C_SALE_SITE_LIST", "");
24 self::$currentSettings['export']['CURRENCY'] = Option::get("sale", "1C_REPLACE_CURRENCY", "");
25
26 self::$currentSettings['payed'][EntityType::ORDER_NAME] = Option::get("sale", "1C_EXPORT_PAYED_ORDERS", "");
27 self::$currentSettings['payed'][EntityType::SHIPMENT_NAME] = '';
28 self::$currentSettings['payed'][EntityType::PAYMENT_CASH_NAME] = '';
29 self::$currentSettings['payed'][EntityType::PAYMENT_CASH_LESS_NAME] = '';
30 self::$currentSettings['payed'][EntityType::PAYMENT_CARD_TRANSACTION_NAME] = '';
31
32 self::$currentSettings['payed'][EntityType::INVOICE_NAME] = Option::get("sale", "1C_EXPORT_PAYED_ORDERS", "");
33 self::$currentSettings['payed'][EntityType::INVOICE_SHIPMENT_NAME] = '';
34 self::$currentSettings['payed'][EntityType::INVOICE_PAYMENT_CASH_NAME] = '';
35 self::$currentSettings['payed'][EntityType::INVOICE_PAYMENT_CASH_LESS_NAME] = '';
36 self::$currentSettings['payed'][EntityType::INVOICE_PAYMENT_CARD_TRANSACTION_NAME] = '';
37
38
39 self::$currentSettings['allow_delivery'][EntityType::ORDER_NAME] = Option::get("sale", "1C_EXPORT_ALLOW_DELIVERY_ORDERS", "");
40 self::$currentSettings['allow_delivery'][EntityType::SHIPMENT_NAME] = '';
41 self::$currentSettings['allow_delivery'][EntityType::PAYMENT_CASH_NAME] = '';
42 self::$currentSettings['allow_delivery'][EntityType::PAYMENT_CASH_LESS_NAME] = '';
43 self::$currentSettings['allow_delivery'][EntityType::PAYMENT_CARD_TRANSACTION_NAME] = '';
44
45 self::$currentSettings['allow_delivery'][EntityType::INVOICE_NAME] = Option::get("sale", "1C_EXPORT_ALLOW_DELIVERY_ORDERS", "");
46 self::$currentSettings['allow_delivery'][EntityType::INVOICE_SHIPMENT_NAME] = '';
47 self::$currentSettings['allow_delivery'][EntityType::INVOICE_PAYMENT_CASH_NAME] = '';
48 self::$currentSettings['allow_delivery'][EntityType::INVOICE_PAYMENT_CASH_LESS_NAME] = '';
49 self::$currentSettings['allow_delivery'][EntityType::INVOICE_PAYMENT_CARD_TRANSACTION_NAME] = '';
50
51
52 self::$currentSettings['accountNumberPrefix'][EntityType::ORDER_NAME] = Option::get("sale", "1C_SALE_ACCOUNT_NUMBER_SHOP_PREFIX", "");
53 self::$currentSettings['accountNumberPrefix'][EntityType::SHIPMENT_NAME] = '';
54 self::$currentSettings['accountNumberPrefix'][EntityType::PAYMENT_CASH_NAME] = '';
55 self::$currentSettings['accountNumberPrefix'][EntityType::PAYMENT_CASH_LESS_NAME] = '';
56 self::$currentSettings['accountNumberPrefix'][EntityType::PAYMENT_CARD_TRANSACTION_NAME] = '';
57
58 self::$currentSettings['accountNumberPrefix'][EntityType::INVOICE_NAME] = Option::get("sale", "1C_SALE_ACCOUNT_NUMBER_SHOP_PREFIX", "");
59 self::$currentSettings['accountNumberPrefix'][EntityType::INVOICE_SHIPMENT_NAME] = '';
60 self::$currentSettings['accountNumberPrefix'][EntityType::INVOICE_PAYMENT_CASH_NAME] = '';
61 self::$currentSettings['accountNumberPrefix'][EntityType::INVOICE_PAYMENT_CASH_LESS_NAME] = '';
62 self::$currentSettings['accountNumberPrefix'][EntityType::INVOICE_PAYMENT_CARD_TRANSACTION_NAME] = '';
63
64
65 self::$currentSettings['finalStatus'][EntityType::ORDER_NAME] = Option::get("sale", "1C_EXPORT_FINAL_ORDERS", "");
66 self::$currentSettings['finalStatus'][EntityType::SHIPMENT_NAME] = '';
67 self::$currentSettings['finalStatus'][EntityType::PAYMENT_CASH_NAME] = '';
68 self::$currentSettings['finalStatus'][EntityType::PAYMENT_CASH_LESS_NAME] = '';
69 self::$currentSettings['finalStatus'][EntityType::PAYMENT_CARD_TRANSACTION_NAME] = '';
70
71 self::$currentSettings['finalStatus'][EntityType::INVOICE_NAME] = Option::get("sale", "1C_EXPORT_FINAL_ORDERS", "");
72 self::$currentSettings['finalStatus'][EntityType::INVOICE_SHIPMENT_NAME] = '';
73 self::$currentSettings['finalStatus'][EntityType::INVOICE_PAYMENT_CASH_NAME] = '';
74 self::$currentSettings['finalStatus'][EntityType::INVOICE_PAYMENT_CASH_LESS_NAME] = '';
75 self::$currentSettings['finalStatus'][EntityType::INVOICE_PAYMENT_CARD_TRANSACTION_NAME] = '';
76
77
78 self::$currentSettings['groupPermission'][EntityType::ORDER_NAME] = Option::get("sale", "1C_SALE_GROUP_PERMISSIONS");
79 self::$currentSettings['groupPermission'][EntityType::SHIPMENT_NAME] = '';
80 self::$currentSettings['groupPermission'][EntityType::PAYMENT_CASH_NAME] = '';
81 self::$currentSettings['groupPermission'][EntityType::PAYMENT_CASH_LESS_NAME] = '';
82 self::$currentSettings['groupPermission'][EntityType::PAYMENT_CARD_TRANSACTION_NAME] = '';
83
84 self::$currentSettings['groupPermission'][EntityType::INVOICE_NAME] = Option::get("sale", "1C_SALE_GROUP_PERMISSIONS");
85 self::$currentSettings['groupPermission'][EntityType::INVOICE_SHIPMENT_NAME] = '';
86 self::$currentSettings['groupPermission'][EntityType::INVOICE_PAYMENT_CASH_NAME] = '';
87 self::$currentSettings['groupPermission'][EntityType::INVOICE_PAYMENT_CASH_LESS_NAME] = '';
88 self::$currentSettings['groupPermission'][EntityType::INVOICE_PAYMENT_CARD_TRANSACTION_NAME] = '';
89
90
91 if(!is_array(self::$currentSettings))
92 {
93 self::$currentSettings = array();
94 }
95 }
97 }
98
102 public function getSiteId()
103 {
104 return $this->settings['export']['SITE_ID'] !== "" ? $this->settings['export']['SITE_ID']: '';
105 }
106
110 public function getReplaceCurrency()
111 {
112 return $this->settings['export']['CURRENCY'];
113 }
114
119 public function groupPermissionFor($entityTypeId)
120 {
121 return $this->getValueFor($entityTypeId, 'groupPermission');
122 }
123
128 public function finalStatusFor($entityTypeId)
129 {
130 return $this->getValueFor($entityTypeId, 'finalStatus');
131 }
132
137 public function payedFor($entityTypeId)
138 {
139 return $this->getValueFor($entityTypeId, 'payed');
140 }
141
146 public function allowDeliveryFor($entityTypeId)
147 {
148 return $this->getValueFor($entityTypeId, 'allow_delivery');
149 }
150
154 public static function getCurrent()
155 {
156 return new static(static::loadCurrentSettings());
157 }
158}
getValueFor($entityTypeId, $name, $default='')