1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
senderconnector.php
См. документацию.
1<?php
8
9namespace Bitrix\Main;
10
11use Bitrix\Main\Localization\Loc;
12
13Loc::loadMessages(__FILE__);
14
16{
21 public static function onConnectorListUser($data)
22 {
23 $data['CONNECTOR'] = 'Bitrix\Main\SenderConnectorUser';
24
25 return $data;
26 }
27}
28
29if (Loader::includeModule('sender'))
30{
31 class SenderConnectorUser extends \Bitrix\Sender\Connector
32 {
36 public function getName()
37 {
38 return Loc::getMessage('sender_connector_user_name');
39 }
40
44 public function getCode()
45 {
46 return "user";
47 }
48
50 public function getData()
51 {
52 $groupId = $this->getFieldValue('GROUP_ID', null);
53 $dateRegister = $this->getFieldValue('DATE_REGISTER', null);
54 $active = $this->getFieldValue('ACTIVE', null);
55
56 $filter = array();
57 if($groupId)
58 $filter['GROUP_ID'] = $groupId;
59
60 if($dateRegister <> '')
61 {
62 if(\Bitrix\Main\Type\Date::isCorrect($dateRegister))
63 {
64 $dateRegister = new \Bitrix\Main\Type\Date($dateRegister);
65 $filter['><USER.DATE_REGISTER'] = array($dateRegister->toString(), $dateRegister->add('1 DAY')->toString());
66 }
67 else
68 {
69 $result = new \CDBResult();
70 $result->InitFromArray(array());
71 return $result;
72 }
73 }
74
75 if($active=='Y')
76 $filter['USER.ACTIVE'] = $active;
77 elseif($active=='N')
78 $filter['USER.ACTIVE'] = $active;
79
80 $userDb = \Bitrix\Main\UserGroupTable::getList(array(
81 'select' => array('NAME' => 'USER.NAME', 'EMAIL' => 'USER.EMAIL', 'USER_ID'),
82 'filter' => $filter,
83 'group' => array('NAME', 'EMAIL', 'USER_ID'),
84 'order' => array('USER_ID' => 'ASC'),
85 ));
86
87 return new \CDBResult($userDb);
88 }
89
94 public function getForm()
95 {
96 $groupInput = '<select name="'.$this->getFieldName('GROUP_ID').'">';
97 $groupDb = \Bitrix\Main\GroupTable::getList(array(
98 'select' => array('ID', 'NAME',),
99 'filter' => array('!=ID' => 2),
100 'order' => array('C_SORT' => 'ASC', 'NAME' => 'ASC')
101 ));
102 while($group = $groupDb->fetch())
103 {
104 $inputSelected = ($group['ID'] == $this->getFieldValue('GROUP_ID') ? 'selected' : '');
105 $groupInput .= '<option value="'.$group['ID'].'" '.$inputSelected.'>';
106 $groupInput .= htmlspecialcharsbx($group['NAME']);
107 $groupInput .= '</option>';
108 }
109 $groupInput .= '</select>';
110
111
112 $booleanValues = array(
113 '' => Loc::getMessage('sender_connector_user_all'),
114 'Y' => Loc::getMessage('sender_connector_user_y'),
115 'N' => Loc::getMessage('sender_connector_user_n'),
116 );
117
118 $activeInput = '<select name="'.$this->getFieldName('ACTIVE').'">';
119 foreach($booleanValues as $k => $v)
120 {
121 $inputSelected = ($k == $this->getFieldValue('ACTIVE') ? 'selected' : '');
122 $activeInput .= '<option value="'.$k.'" '.$inputSelected.'>';
123 $activeInput .= htmlspecialcharsbx($v);
124 $activeInput .= '</option>';
125 }
126 $activeInput .= '</select>';
127
128
129 $dateRegInput = CalendarDate(
130 $this->getFieldName('DATE_REGISTER'),
131 $this->getFieldValue('DATE_REGISTER'),
132 $this->getFieldFormName()
133 );
134
135 return '
136 <table>
137 <tr>
138 <td>'.Loc::getMessage('sender_connector_user_group').'</td>
139 <td>'.$groupInput.'</td>
140 </tr>
141 <tr>
142 <td>'.Loc::getMessage('sender_connector_user_datereg').'</td>
143 <td>'.$dateRegInput.'</td>
144 </tr>
145 <tr>
146 <td>'.Loc::getMessage('sender_connector_user_active').'</td>
147 <td>'.$activeInput.'</td>
148 </tr>
149 </table>
150 ';
151 }
152 }
153}
return[Dependency::CONTAINER=> Container::class, Dependency::IBLOCK_INFO=> IblockInfo::class, Dependency::PRODUCT_CONVERTER=> ProductConverter::class, Dependency::REPOSITORY_FACADE=> Repository::class, Dependency::PRODUCT_FACTORY=> ProductFactory::class, Dependency::PRODUCT_REPOSITORY=> ProductRepository::class, ProductFactory::PRODUCT=> Product::class, Dependency::SECTION_FACTORY=> SectionFactory::class, Dependency::SECTION_REPOSITORY=> SectionRepository::class, SectionFactory::SECTION=> Section::class, SectionFactory::SECTION_COLLECTION=> SectionCollection::class, Dependency::SKU_FACTORY=> SkuFactory::class, Dependency::SKU_REPOSITORY=> SkuRepository::class, SkuFactory::SIMPLE_SKU=> SimpleSku::class, SkuFactory::SKU=> Sku::class, SkuFactory::SKU_COLLECTION=> SkuCollection::class, Dependency::PROPERTY_FACTORY=> PropertyFactory::class, Dependency::PROPERTY_REPOSITORY=> PropertyRepository::class, PropertyFactory::PROPERTY=> Property::class, PropertyFactory::PROPERTY_COLLECTION=> PropertyCollection::class, Dependency::PROPERTY_VALUE_FACTORY=> PropertyValueFactory::class, PropertyValueFactory::PROPERTY_VALUE=> PropertyValue::class, PropertyValueFactory::PROPERTY_VALUE_COLLECTION=> PropertyValueCollection::class, Dependency::PROPERTY_FEATURE_FACTORY=> PropertyFeatureFactory::class, Dependency::PROPERTY_FEATURE_REPOSITORY=> PropertyFeatureRepository::class, PropertyFeatureFactory::PROPERTY_FEATURE=> PropertyFeature::class, PropertyFeatureFactory::PROPERTY_FEATURE_COLLECTION=> PropertyFeatureCollection::class, Dependency::PRICE_FACTORY=> PriceFactory::class, Dependency::PRICE_REPOSITORY=> PriceRepository::class, PriceFactory::SIMPLE_PRICE=> SimplePrice::class, PriceFactory::QUANTITY_DEPENDENT_PRICE=> QuantityDependentPrice::class, PriceFactory::PRICE_COLLECTION=> PriceCollection::class, Dependency::IMAGE_FACTORY=> ImageFactory::class, Dependency::IMAGE_REPOSITORY=> ImageRepository::class, ImageFactory::DETAIL_IMAGE=> DetailImage::class, ImageFactory::PREVIEW_IMAGE=> PreviewImage::class, ImageFactory::MORE_PHOTO_IMAGE=> MorePhotoImage::class, ImageFactory::IMAGE_COLLECTION=> ImageCollection::class, Dependency::MEASURE_RATIO_FACTORY=> MeasureRatioFactory::class, Dependency::MEASURE_RATIO_REPOSITORY=> MeasureRatioRepository::class, MeasureRatioFactory::SIMPLE_MEASURE_RATIO=> SimpleMeasureRatio::class, MeasureRatioFactory::MEASURE_RATIO_COLLECTION=> MeasureRatioCollection::class, Dependency::BARCODE_FACTORY=> BarcodeFactory::class, Dependency::BARCODE_REPOSITORY=> BarcodeRepository::class, BarcodeFactory::BARCODE=> Barcode::class, BarcodeFactory::BARCODE_COLLECTION=> BarcodeCollection::class, Dependency::STORE_PRODUCT_FACTORY=> StoreProductFactory::class, Dependency::STORE_PRODUCT_REPOSITORY=> StoreProductRepository::class, StoreProductFactory::STORE_PRODUCT=> StoreProduct::class, StoreProductFactory::STORE_PRODUCT_COLLECTION=> StoreProductCollection::class, 'sku.tree'=> SkuTree::class, 'integration.seo.facebook.facade'=> FacebookFacade::class, 'integration.seo.facebook.product.processor'=> FacebookProductProcessor::class, 'integration.seo.facebook.product.repository'=> FacebookProductRepository::class,]
Определения .container.php:139
return select
Определения access_edit.php:440
static includeModule($moduleName)
Определения loader.php:67
static onConnectorListUser($data)
Определения senderconnector.php:21
$data['IS_AVAILABLE']
Определения .description.php:13
</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
const EMAIL
Определения idea_notify.php:6
CalendarDate($fieldName, $value, $formName="", $size="10", $param="class=\"typeinput\"")
Определения tools.php:319
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
Определения base.php:8
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$k
Определения template_pdf.php:567