1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
element.php
См. документацию.
1
<?
2
namespace
Bitrix\Lists\Controller
;
3
4
use
Bitrix\Iblock\Copy\Implement\Element
as ElementImplementer;
5
use
Bitrix\Lists\Entity\Utils
;
6
use
Bitrix\Lists\Security\ElementRight
;
7
use
Bitrix\Lists\Security\Right
;
8
use
Bitrix\Lists\Security\RightParam
;
9
use
Bitrix\Lists\Service\Param
;
10
use
Bitrix\Main\Copy\Container
;
11
use
Bitrix\Main\Copy\ContainerCollection
;
12
use
Bitrix\Main\Copy\EntityCopier
;
13
14
class
Element
extends
Entity
15
{
16
public
function
copyAction
()
17
{
18
$param = $this->
getParamFromRequest
();
19
$params
= $param->getParams();
20
21
$this->
checkPermission
($param, ElementRight::EDIT);
22
if
($this->
getErrors
())
23
{
24
return
null
;
25
}
26
27
$containerCollection =
new
ContainerCollection
();
28
$containerCollection[] =
new
Container
(
$params
[
"ELEMENT_ID"
]);
29
30
$elementImplementer =
new
ElementImplementer();
31
$elementCopier =
new
EntityCopier
($elementImplementer);
32
$result
= $elementCopier->copy($containerCollection);
33
34
if
(
$result
->getErrors())
35
{
36
$this->addErrors(
$result
->getErrors());
37
return
null
;
38
39
}
40
else
41
{
42
$resultData =
$result
->getData();
43
return
$resultData[
$params
[
"ELEMENT_ID"
]];
44
}
45
}
46
47
protected
function
checkPermission
(
Param
$param, $permission)
48
{
49
global
$USER
;
50
$rightParam =
new
RightParam
($param);
51
$rightParam->setUser(
$USER
);
52
$rightParam->setEntityId(
Utils::getElementId
($param->
getParams
()));
53
54
$right
=
new
Right
($rightParam,
new
ElementRight
($rightParam));
55
$right
->checkPermission($permission);
56
if
(
$right
->hasErrors())
57
{
58
$this->addErrors(
$right
->getErrors());
59
}
60
}
61
}
Bitrix\Iblock\Copy\Implement\Element
Определения
element.php:11
Bitrix\Lists\Controller\Element
Определения
element.php:15
Bitrix\Lists\Controller\Element\checkPermission
checkPermission(Param $param, $permission)
Определения
element.php:47
Bitrix\Lists\Controller\Element\copyAction
copyAction()
Определения
element.php:16
Bitrix\Lists\Controller\Entity
Определения
entity.php:8
Bitrix\Lists\Controller\Entity\getParamFromRequest
getParamFromRequest()
Определения
entity.php:9
Bitrix\Lists\Entity\Utils
Определения
utils.php:5
Bitrix\Lists\Entity\Utils\getElementId
static getElementId(array $params)
Определения
utils.php:41
Bitrix\Lists\Security\ElementRight
Определения
elementright.php:11
Bitrix\Lists\Security\Right
Определения
right.php:11
Bitrix\Lists\Security\RightParam
Определения
rightparam.php:11
Bitrix\Lists\Service\Param
Определения
param.php:10
Bitrix\Lists\Service\Param\getParams
getParams()
Определения
param.php:70
Bitrix\Main\Copy\ContainerCollection
Определения
containercollection.php:12
Bitrix\Main\Copy\Container
Определения
container.php:12
Bitrix\Main\Copy\EntityCopier
Определения
entitycopier.php:8
$right
$right
Определения
options.php:8
$result
$result
Определения
get_property_values.php:14
$USER
global $USER
Определения
csv_new_run.php:40
Bitrix\Lists\Controller
Определения
element.php:2
Bitrix\Main\getErrors
getErrors()
Определения
errorableimplementation.php:34
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
lists
lib
controller
element.php
Создано системой
1.14.0