1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
bysite.php
См. документацию.
1
<?php
2
namespace
Bitrix\Sale\Delivery\Restrictions;
3
4
use Bitrix\Sale\Delivery\Restrictions\Base;
5
use \Bitrix\Main\Localization\Loc;
6
use Bitrix\Sale\Internals\CollectableEntity;
7
use Bitrix\Sale\Internals\Entity;
8
use Bitrix\Sale\Order;
9
10
Loc::loadMessages(__FILE__);
11
17
class
BySite
extends
Base
18
{
19
public
static
function
getClassTitle
()
20
{
21
return
Loc::getMessage(
"SALE_DLVR_RSTR_BY_SITE_NAME"
);
22
}
23
24
public
static
function
getClassDescription
()
25
{
26
return
Loc::getMessage(
"SALE_DLVR_RSTR_BY_SITE_DESCRIPT"
);
27
}
28
public
static
function
check
(
$siteId
,
array
$restrictionParams, $deliveryId = 0)
29
{
30
if
(empty($restrictionParams))
31
return
true
;
32
33
$result
=
true
;
34
35
if
(
$siteId <>
''
&& isset($restrictionParams[
"SITE_ID"
]) && is_array($restrictionParams[
"SITE_ID"
]))
36
$result
= in_array(
$siteId
, $restrictionParams[
"SITE_ID"
]);
37
38
return
$result
;
39
}
40
41
protected
static
function
extractParams(
Entity
$entity
)
42
{
43
if
(
$entity
instanceof
CollectableEntity
)
44
{
46
$collection =
$entity
->getCollection();
47
49
$order
= $collection->getOrder();
50
}
51
elseif
(
$entity
instanceof Order)
52
{
54
$order
=
$entity
;
55
}
56
57
if
(!
$order
)
58
return
false
;
59
60
return
$order
->getSiteId();
61
}
62
63
public
static
function
getParamsStructure
(
$entityId
= 0)
64
{
65
$siteList
=
array
();
66
67
$rsSite =
\Bitrix\Main\SiteTable::getList
();
68
69
while
(
$site
= $rsSite->fetch())
70
$siteList
[
$site
[
"LID"
]] =
$site
[
"NAME"
].
" ("
.
$site
[
"LID"
].
")"
;
71
72
return
array
(
73
"SITE_ID"
=>
array
(
74
"TYPE"
=>
"ENUM"
,
75
'MULTIPLE'
=>
'Y'
,
76
"DEFAULT"
=>
SITE_ID
,
77
"LABEL"
=> Loc::getMessage(
"SALE_DLVR_RSTR_BY_SITE_SITE_ID"
),
78
"OPTIONS"
=>
$siteList
79
)
80
);
81
}
82
83
public
static
function
getSeverity
($mode)
84
{
85
if
($mode ==
Manager::MODE_MANAGER
)
86
return
Manager::SEVERITY_STRICT
;
87
88
return
parent::getSeverity($mode);
89
}
90
94
public
static
function
isAvailable
()
95
{
96
return
IsModuleInstalled
(
'bitrix24'
) ?
false
:
true
;
97
}
98
}
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
Bitrix\Sale\Delivery\Restrictions\BySite
Определения
bysite.php:18
Bitrix\Sale\Delivery\Restrictions\BySite\getClassTitle
static getClassTitle()
Определения
bysite.php:19
Bitrix\Sale\Delivery\Restrictions\BySite\isAvailable
static isAvailable()
Определения
bysite.php:94
Bitrix\Sale\Delivery\Restrictions\BySite\getClassDescription
static getClassDescription()
Определения
bysite.php:24
Bitrix\Sale\Delivery\Restrictions\BySite\getParamsStructure
static getParamsStructure($entityId=0)
Определения
bysite.php:63
Bitrix\Sale\Delivery\Restrictions\BySite\check
static check($siteId, array $restrictionParams, $deliveryId=0)
Определения
bysite.php:28
Bitrix\Sale\Delivery\Restrictions\BySite\getSeverity
static getSeverity($mode)
Определения
bysite.php:83
Bitrix\Sale\Internals\CollectableEntity
Определения
collectableentity.php:14
Bitrix\Sale\Services\Base\RestrictionManager\MODE_MANAGER
const MODE_MANAGER
Определения
restrictionmanager.php:27
Bitrix\Sale\Services\Base\RestrictionManager\SEVERITY_STRICT
const SEVERITY_STRICT
Определения
restrictionmanager.php:31
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
$siteId
$siteId
Определения
ajax.php:8
IsModuleInstalled
IsModuleInstalled($module_id)
Определения
tools.php:5301
Bitrix\Main\Entity
Определения
ufield.php:9
Bitrix\Sale\Services\Base
Определения
concreteproductrestriction.php:3
$order
$order
Определения
payment.php:8
$entityId
$entityId
Определения
payment.php:4
false
return false
Определения
prolog_main_admin.php:185
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$siteList
$siteList
Определения
options.php:47
SITE_ID
const SITE_ID
Определения
sonet_set_content_view.php:12
$site
$site
Определения
yandex_run.php:614
bitrix
modules
sale
lib
delivery
restrictions
bysite.php
Создано системой
1.14.0