1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
row.php
См. документацию.
1<?php
2namespace Bitrix\Report\VisualConstructor\Controller;
3
4use Bitrix\Report\VisualConstructor\Entity\DashboardRow;
5use Bitrix\Report\VisualConstructor\Helper\Util;
6use Bitrix\Report\VisualConstructor\Helper\Dashboard as DashboardHelper;
7use Bitrix\Report\VisualConstructor\Internal\Error\Error;
8
13class Row extends Base
14{
21 public function addAction($params)
22 {
23 $dashboardForUser = DashboardHelper::getDashboardByKeyForCurrentUser($params['boardKey']);
24 if ($dashboardForUser)
25 {
26 $row = new DashboardRow();
27 $row->setLayoutMap($params['layoutMap']);
28 $row->setGId(Util::generateUserUniqueId());
29 $row->setBoardId($params['boardId']);
30 $row->setWeight(0);
31 $dashboardForUser->addRows($row);
32 $dashboardForUser->save();
33 return array('id' => $row->getGId());
34 }
35 else
36 {
37 $this->adderror(new Error('No dashboard for current user'));
38 return false;
39 }
40 }
41
49 public function adjustWeightsAction($boardKey, $rows)
50 {
51 $dashboardForUser = DashboardHelper::getDashboardByKeyForCurrentUser($boardKey);
52 if ($dashboardForUser)
53 {
54 $dashboardForUser->loadAttribute('rows');
55 $savedRows = $dashboardForUser->getRows();
56 if ($savedRows)
57 {
58 foreach ($savedRows as $row)
59 {
60 if (isset($rows[$row->getGId()]))
61 {
62 $row->setWeight($rows[$row->getGId()]['weight']);
63 }
64 }
65 }
66
67
68 $dashboardForUser->save();
69 return true;
70 }
71 else
72 {
73 $this->adderror(new Error('No dashboard for current user'));
74 return false;
75 }
76 }
77
84 public function deleteAction($params)
85 {
86 $boardKey = $params['boardId'];
87 $rowId = $params['rowId'];
88 $dashboardForUser = DashboardHelper::getDashboardByKeyForCurrentUser($boardKey);
89 if ($dashboardForUser)
90 {
91 $row = DashboardRow::getCurrentUserRowByGId($rowId);
92 if ($row)
93 {
94 return $row->delete();
95 }
96 else
97 {
98 $this->adderror(new Error('No Row with this id'));
99 return false;
100 }
101 }
102 else
103 {
104 $this->adderror(new Error('No dashboard for current user'));
105 return false;
106 }
107 }
108}
Определения error.php:15
adjustWeightsAction($boardKey, $rows)
Определения row.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$rows
Определения options.php:264