1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
numberfield.php
См. документацию.
1<?php
8namespace Bitrix\Sender\Connector\Filter;
9
10use Bitrix\Main\UI\Filter\NumberType as FilterNumberType;
11
17{
24 public function applyFilter(array &$filter = array())
25 {
26 $filterKey = $this->getFilterKey();
27 $data = $this->calcNumbers();
28
29 switch ($data['op'])
30 {
31 case FilterNumberType::SINGLE:
32 if (is_numeric($data['from']))
33 {
34 $filter["=$filterKey"] = $data['from'];
35 }
36 return;
37
38 case FilterNumberType::MORE:
39 case FilterNumberType::LESS:
40 $opMore = '>';
41 $opLess = '<';
42 break;
43
44 default:
45 $opMore = '>=';
46 $opLess = '<=';
47 break;
48
49 }
50
51 if (is_numeric($data['from']))
52 {
53 $filter["{$opMore}$filterKey"] = $data['from'];
54 }
55 if (is_numeric($data['to']))
56 {
57 $filter["{$opLess}$filterKey"] = $data['to'];
58 }
59 }
60
61 private function calcNumbers()
62 {
63 $result = array(
64 'op' => FilterNumberType::SINGLE,
65 'from' => null,
66 'to' => null,
67 );
68 $value = $this->getValue();
69 if (!is_array($value) || count($value) === 0)
70 {
71 return $result;
72 }
73
74 $id = $this->getId();
75 if (isset($value["{$id}_numsel"]) && in_array($value["{$id}_numsel"], FilterNumberType::getList()))
76 {
77 $result['op'] = $value["{$id}_numsel"];
78 }
79
80 if (isset($value["{$id}_from"]))
81 {
82 $result['from'] = $value["{$id}_from"];
83 }
84
85 if (isset($value["{$id}_to"]))
86 {
87 $result['to'] = $value["{$id}_to"];
88 }
89
90 return $result;
91 }
92}
getValue($defaultValue=null)
Определения abstractfield.php:68
applyFilter(array &$filter=array())
Определения numberfield.php:24
</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
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936