1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
profile.php
См. документацию.
1<?php
2
3
4namespace Bitrix\Sale\Controller;
5
6
7use Bitrix\Main\Engine\Response\DataType\Page;
8use Bitrix\Main\Error;
9use Bitrix\Main\Localization\Loc;
10use Bitrix\Main\Result;
11use Bitrix\Main\UI\PageNavigation;
12
13Loc::loadMessages(__FILE__);
14
16{
17 //region Actions
18 public function getFieldsAction()
19 {
20 $view = $this->getViewManager()
21 ->getView($this);
22
23 return ['PROFILE'=>$view->prepareFieldInfos(
24 $view->getFields()
25 )];
26 }
27
28 public function listAction(PageNavigation $pageNavigation, array $select = [], array $filter = [], array $order = [])
29 {
30 $result = [];
31
32 $select = empty($select)? ['*']:$select;
33 $order = empty($order)? ['ID'=>'ASC']:$order;
34
35 $r = \CSaleOrderUserProps::GetList($order, $filter, false, self::getNavData($pageNavigation->getOffset()), $select);
36 while ($l = $r->fetch())
37 $result[] = $l;
38
39 return new Page('PROFILES', $result, function() use ($filter)
40 {
41 return (int) \CSaleOrderUserProps::GetList([], $filter, []);
42 });
43 }
44
45 public function getAction($id)
46 {
47 $r = $this->exists($id);
48 if($r->isSuccess())
49 {
50 return ['PROFILE'=>$this->get($id)];
51 }
52 else
53 {
54 $this->addErrors($r->getErrors());
55 return null;
56 }
57 }
58 //endregion
59
60 protected function exists($id)
61 {
62 $r = new Result();
63 if(isset($this->get($id)['ID']) == false)
64 $r->addError(new Error('Profile is not exists'));
65
66 return $r;
67 }
68
69 protected function get($id)
70 {
71 return \CSaleOrderUserProps::GetByID($id);
72 }
73
74 protected function checkReadPermissionEntity()
75 {
76 $r = new Result();
77
78 if (self::getApplication()->GetGroupRight("sale") == "D")
79 {
80 $r->addError(new Error('Buyer access denied'));
81 }
82
83 return $r;
84 }
85}
Определения error.php:15
checkReadPermissionEntity()
Определения profile.php:74
exists($id)
Определения profile.php:60
getFieldsAction()
Определения profile.php:18
listAction(PageNavigation $pageNavigation, array $select=[], array $filter=[], array $order=[])
Определения profile.php:28
getAction($id)
Определения profile.php:45
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения order_user_props.php:7
</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
$select
Определения iblock_catalog_list.php:194
$filter
Определения iblock_catalog_list.php:54
$l
Определения options.php:783
Определения aliases.php:54
$order
Определения payment.php:8