Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
inputs.php
1<?php
2
4
5require_once __DIR__.'/../../internals/input.php';
6
11
12Loc::loadMessages(__FILE__);
13
14class LocationMulti extends Input\Base
15{
16 public static function getViewHtml(array $input, $value = null)
17 {
18 $result = "";
19
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
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
124Input\Manager::register('COMPANY_LOCATION_MULTI', array(
125 'CLASS' => __NAMESPACE__.'\\LocationMulti',
126 'NAME' => Loc::getMessage('INPUT_company_LOCATION_MULTI')
127));
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getSettings(array $input, $reload)
Definition inputs.php:118
static getValueSingle(array $input, $userValue)
Definition inputs.php:113
static getEditHtml($name, array $input, $values=null)
Definition inputs.php:45
static getError(array $input, $values)
Definition inputs.php:107
static getViewHtml(array $input, $value=null)
Definition inputs.php:16
static getConnectedLocations($entityPrimary, $parameters=array(), $behaviour=array('GET_LINKED_THROUGH_GROUPS'=> false))
static getConnectedGroups($entityPrimary, $parameters=array())