1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
company.php
См. документацию.
1<?php
3
8
9Loc::loadMessages(__FILE__);
10
15class Company extends Restriction
16{
17 public static $easeSort = 200;
18 protected static $preparedData = array();
19
23 public static function getClassTitle()
24 {
25 return Loc::getMessage("SALE_CASHBOX_RSTR_BY_COMPANY_TITLE");
26 }
27
31 public static function getClassDescription()
32 {
33 return Loc::getMessage("SALE_CASHBOX_RSTR_BY_COMPANY_DESC");
34 }
35
42 public static function check($params, array $restrictionParams, $serviceId = 0)
43 {
44 if (is_array($restrictionParams) && isset($restrictionParams['COMPANY']))
45 {
46 $diff = array_diff($params, $restrictionParams['COMPANY']);
47 return empty($diff);
48 }
49
50 return true;
51 }
52
57 protected static function extractParams(Entity $entity)
58 {
59 $result = array();
60
61 if ($entity instanceof Sale\Payment ||
62 $entity instanceof Sale\Shipment ||
63 $entity instanceof Sale\Order
64 )
65 {
66 $result[] = $entity->getField('COMPANY_ID');
67 }
68
69 return $result;
70 }
71
75 protected static function getCompanyList()
76 {
77 static $result = null;
78
79 if($result !== null)
80 return $result;
81
82 $result = array();
83
85 'select' => array("ID", "NAME", "ACTIVE"),
86 'filter' => array("ACTIVE" => "Y"),
87 'order' => array("SORT"=>"ASC", "NAME"=>"ASC")
88 ));
89
90 while ($item = $dbResultList->fetch())
91 $result[$item["ID"]] = $item["NAME"];
92
93 return $result;
94 }
95
100 public static function getParamsStructure($entityId = 0)
101 {
102 $result = array(
103 "COMPANY" => array(
104 "TYPE" => "ENUM",
105 'MULTIPLE' => 'Y',
106 "LABEL" => Loc::getMessage("SALE_CASHBOX_RSTR_BY_COMPANY"),
107 "OPTIONS" => self::getCompanyList()
108 )
109 );
110
111 return $result;
112 }
113
118 public static function getSeverity($mode)
119 {
121 }
122
126 public static function isAvailable()
127 {
128 return IsModuleInstalled('crm') ? false : true;
129 }
130
131}
static extractParams(Entity $entity)
Определения company.php:57
static getCompanyList()
Определения company.php:75
static check($params, array $restrictionParams, $serviceId=0)
Определения company.php:42
static getClassDescription()
Определения company.php:31
static getParamsStructure($entityId=0)
Определения company.php:100
static getSeverity($mode)
Определения company.php:118
Определения payment.php:19
static getList($parameters)
Определения manager.php:14
</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
$entity
IsModuleInstalled($module_id)
Определения tools.php:5301
Определения ufield.php:9
$entityId
Определения payment.php:4
return false
Определения prolog_main_admin.php:185
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799