Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
inputs.php
1
<?php
2
3
namespace
Bitrix\Sale\Company\Inputs
;
4
5
require_once __DIR__.
'/../../internals/input.php'
;
6
7
use
Bitrix\Sale\Internals\CompanyLocationTable
;
8
use
Bitrix\Sale\Internals\Input
;
9
use
Bitrix\Main\Localization\Loc
;
10
use
Bitrix\Sale\Services\Company
;
11
12
Loc::loadMessages
(__FILE__);
13
14
class
LocationMulti
extends
Input\Base
15
{
16
public
static
function
getViewHtml
(array $input, $value =
null
)
17
{
18
$result =
""
;
19
20
$res =
CompanyLocationTable::getConnectedLocations
(
21
$input[
"COMPANY_ID"
],
22
array(
23
'select'
=> array(
'LNAME'
=>
'NAME.NAME'
),
24
'filter'
=> array(
'NAME.LANGUAGE_ID'
=> LANGUAGE_ID)
25
)
26
);
27
28
while
($loc = $res->fetch())
29
$result .= htmlspecialcharsbx($loc[
"LNAME"
]).
"<br>\n"
;
30
31
$res =
CompanyLocationTable::getConnectedGroups
(
32
$input[
"COMPANY_ID"
],
33
array(
34
'select'
=> array(
'LNAME'
=>
'NAME.NAME'
),
35
'filter'
=> array(
'NAME.LANGUAGE_ID'
=> LANGUAGE_ID)
36
)
37
);
38
39
while
($loc = $res->fetch())
40
$result .= htmlspecialcharsbx($loc[
"LNAME"
]).
"<br>\n"
;
41
42
return
$result;
43
}
44
45
public
static
function
getEditHtml
($name, array $input, $values =
null
)
46
{
47
global $APPLICATION;
48
49
ob_start();
50
51
$APPLICATION->IncludeComponent(
52
"bitrix:sale.location.selector.system"
,
53
""
,
54
array(
55
"ENTITY_PRIMARY"
=> $input[
"COMPANY_ID"
],
56
"LINK_ENTITY_NAME"
=> Company\Manager::getLocationConnectorEntityName(),
57
"INPUT_NAME"
=> $name
58
),
59
false
60
);
61
62
$result = ob_get_contents();
63
$result =
'
64
<script>
65
66
var bxInputcompanyLocMultiStep3 = function()
67
{
68
BX.loadScript("/bitrix/components/bitrix/sale.location.selector.system/templates/.default/script.js", function(){
69
BX.onCustomEvent("companyGetRuleHtmlScriptsReady");
70
});
71
};
72
73
var bxInputcompanyLocMultiStep2Count = 0;
74
75
var bxInputcompanyLocMultiStep2CB = function(){
76
77
bxInputcompanyLocMultiStep2Count++;
78
79
if(bxInputcompanyLocMultiStep2Count >= 3)
80
bxInputcompanyLocMultiStep3();
81
};
82
83
var bxInputcompanyLocMultiStep2 = function()
84
{
85
BX.loadScript("/bitrix/js/sale/core_ui_etc.js", bxInputcompanyLocMultiStep2CB);
86
BX.loadScript("/bitrix/js/sale/core_ui_autocomplete.js", bxInputcompanyLocMultiStep2CB);
87
BX.loadScript("/bitrix/js/sale/core_ui_itemtree.js", bxInputcompanyLocMultiStep2CB);
88
};
89
90
BX.loadScript("/bitrix/js/sale/core_ui_widget.js", bxInputcompanyLocMultiStep2);
91
92
//at first we must load some scripts in the right order
93
window["companyGetRuleHtmlScriptsLoadingStarted"] = true;
94
95
</script>
96
97
<link rel="stylesheet" type="text/css" href="/bitrix/panel/main/adminstyles_fixed.css">
98
<link rel="stylesheet" type="text/css" href="/bitrix/panel/main/admin.css">
99
<link rel="stylesheet" type="text/css" href="/bitrix/panel/main/admin-public.css">
100
<link rel="stylesheet" type="text/css" href="/bitrix/components/bitrix/sale.location.selector.system/templates/.default/style.css">
101
'
.
102
$result;
103
ob_end_clean();
104
return
$result;
105
}
106
107
public
static
function
getError
(array $input, $values)
108
{
109
return
array();
110
}
111
112
113
public
static
function
getValueSingle
(array $input, $userValue)
114
{
115
return
$userValue;
116
}
117
118
public
static
function
getSettings
(array $input, $reload)
119
{
120
return
array();
121
}
122
}
123
124
Input\Manager::register(
'COMPANY_LOCATION_MULTI'
, array(
125
'CLASS'
=> __NAMESPACE__.
'\\LocationMulti'
,
126
'NAME'
=>
Loc::getMessage
(
'INPUT_company_LOCATION_MULTI'
)
127
));
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Company\Inputs\LocationMulti
Definition
inputs.php:15
Bitrix\Sale\Company\Inputs\LocationMulti\getSettings
static getSettings(array $input, $reload)
Definition
inputs.php:118
Bitrix\Sale\Company\Inputs\LocationMulti\getValueSingle
static getValueSingle(array $input, $userValue)
Definition
inputs.php:113
Bitrix\Sale\Company\Inputs\LocationMulti\getEditHtml
static getEditHtml($name, array $input, $values=null)
Definition
inputs.php:45
Bitrix\Sale\Company\Inputs\LocationMulti\getError
static getError(array $input, $values)
Definition
inputs.php:107
Bitrix\Sale\Company\Inputs\LocationMulti\getViewHtml
static getViewHtml(array $input, $value=null)
Definition
inputs.php:16
Bitrix\Sale\Internals\CompanyLocationTable
Definition
companylocation.php:23
Bitrix\Sale\Location\Connector\getConnectedLocations
static getConnectedLocations($entityPrimary, $parameters=array(), $behaviour=array('GET_LINKED_THROUGH_GROUPS'=> false))
Definition
connector.php:670
Bitrix\Sale\Location\Connector\getConnectedGroups
static getConnectedGroups($entityPrimary, $parameters=array())
Definition
connector.php:695
Bitrix\Sale\Company\Inputs
Definition
inputs.php:3
Bitrix\Sale\Internals\Input
Definition
input.php:3
Bitrix\Sale\Services\Company
Definition
manager.php:2
modules
sale
lib
services
company
inputs.php
Создано системой
1.10.0