1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
store.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Delivery\ExtraServices;
4
5use Bitrix\Main\ArgumentNullException;
6use Bitrix\Main\Error;
7use Bitrix\Sale\Internals\Input;
8use Bitrix\Main\Localization\Loc;
9use Bitrix\Sale\Result;
10
11Loc::loadMessages(__FILE__);
12
13class Store extends Base
14{
15 protected static function getStoresList($nameOnly = true, $siteId = "")
16 {
17 if(!\Bitrix\Main\Loader::includeModule('catalog'))
18 return array();
19
20 $filter = array("ACTIVE" => "Y", "ISSUING_CENTER" => "Y");
21
22 if($siteId <> '')
23 $filter["+SITE_ID"] = $siteId;
24
25 $result = array();
26 $dbList = \CCatalogStore::GetList(
27 array("SORT" => "ASC", "TITLE" => "ASC"),
28 $filter,
29 false,
30 false,
31 array("ID", "SITE_ID", "TITLE", "ADDRESS", "DESCRIPTION", "IMAGE_ID", "PHONE", "SCHEDULE", "LOCATION_ID", "GPS_N", "GPS_S")
32 );
33
34 while ($store = $dbList->Fetch())
35 {
36 if($nameOnly)
37 $result[$store["ID"]] = $store["TITLE"].($store["SITE_ID"] <> '' ? " [".$store["SITE_ID"]."]" : "");
38 else
39 $result[$store["ID"]] = $store;
40 }
41
42 return $result;
43 }
44
45 public static function getClassTitle()
46 {
47 return Loc::getMessage("DELIVERY_EXTRA_SERVICE_STORE_TITLE");
48 }
49
50 public function getCost()
51 {
52 return false;
53 }
54
55 public static function getAdminParamsName()
56 {
57 return Loc::getMessage("DELIVERY_EXTRA_SERVICE_STORE_TITLE");
58 }
59
60 public static function getAdminParamsControl($name, array $params, $currency = "")
61 {
63 $name."[PARAMS][STORES]",
64 [
65 "TYPE" => "ENUM",
66 "MULTIPLE" => "Y",
67 "OPTIONS" => self::getStoresList(),
68 ],
69 $params["PARAMS"]["STORES"] ?? null
70 );
71 }
72
73 public function getAdminDefaultControl($name = "", $value = false)
74 {
75 if($name == '')
76 throw new ArgumentNullException(new Error('name'));
77
79 $name,
80 array(
81 "TYPE" => "ENUM",
82 "OPTIONS" => self::getStoresList()
83 ),
84 $value
85 );
86 }
87
88 public function getEditControl($prefix = "", $value = false)
89 {
90 global $APPLICATION;
91
92 if(!$value)
93 $value = $this->value;
94
95 $result = '<div class="view_map">';
96 $siteId = SITE_ID <> '' ? SITE_ID : "";
97
98 ob_start();
99 $APPLICATION->IncludeComponent(
100 "bitrix:sale.store.choose",
101 ".default",
102 Array(
103 "INPUT_NAME" => $prefix,
104 "DELIVERY_ID" => $this->deliveryId,
105 "SELECTED_STORE" => $value,
106 "STORES_LIST" => self::getStoresList(false, $siteId)
107 ));
108
109 $result .= ob_get_contents();
110 ob_end_clean();
111
112 $result .= '</div>';
113 return $result;
114 }
115
116 public function getViewControl()
117 {
119 array(
120 "TYPE" => "ENUM",
121 "OPTIONS" => self::getStoresList(true, SITE_ID <> '' ? SITE_ID : "")
122 ),
123 $this->value
124 );
125 }
126
127 public static function isInner()
128 {
129 return true;
130 }
131
132 public static function getStoresIdsFromParams(array $params)
133 {
134 return $params["STORES"];
135 }
136}
global $APPLICATION
Определения include.php:80
Определения error.php:15
getEditControl($prefix="", $value=false)
Определения store.php:88
getAdminDefaultControl($name="", $value=false)
Определения store.php:73
static getStoresIdsFromParams(array $params)
Определения store.php:132
static getClassTitle()
Определения store.php:45
static getAdminParamsControl($name, array $params, $currency="")
Определения store.php:60
static getAdminParamsName()
Определения store.php:55
static getStoresList($nameOnly=true, $siteId="")
Определения store.php:15
static getEditHtml($name, array $input, $value=null)
Определения input.php:88
static getViewHtml(array $input, $value=null)
Определения input.php:70
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$filter
Определения iblock_catalog_list.php:54
$siteId
Определения ajax.php:8
$name
Определения menu_edit.php:35
$currency
Определения template.php:266
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
const SITE_ID
Определения sonet_set_content_view.php:12