@@ -25,7 +25,7 @@ public function indexAction()
25
25
{
26
26
$ this ->createTabs ()->activate ('reports ' );
27
27
28
- if ($ this ->hasPermission ('reporting/reports ' )) {
28
+ if ($ this ->hasPermission ('reporting/reports/modify ' )) {
29
29
$ this ->addControl (new ButtonLink (
30
30
$ this ->translate ('New Report ' ),
31
31
Url::fromPath ('reporting/reports/new ' ),
@@ -38,22 +38,29 @@ public function indexAction()
38
38
$ reports = Report::on ($ this ->getDb ())
39
39
->withColumns (['report.timeframe.name ' ]);
40
40
41
+ $ this ->applyRestriction ($ reports , 'report.name ' );
42
+
41
43
foreach ($ reports as $ report ) {
42
44
$ url = Url::fromPath ('reporting/report ' , ['id ' => $ report ->id ])->getAbsoluteUrl ('& ' );
43
45
44
- $ tableRows [] = Html:: tag ( ' tr ' , [ ' href ' => $ url ], [
46
+ $ content = [
45
47
Html::tag ('td ' , null , $ report ->name ),
46
48
Html::tag ('td ' , null , $ report ->author ),
47
49
Html::tag ('td ' , null , $ report ->timeframe ->name ),
48
50
Html::tag ('td ' , null , date ('Y-m-d H:i ' , $ report ->ctime / 1000 )),
49
- Html::tag ('td ' , null , date ('Y-m-d H:i ' , $ report ->mtime / 1000 )),
50
- Html::tag ('td ' , ['class ' => 'icon-col ' ], [
51
+ Html::tag ('td ' , null , date ('Y-m-d H:i ' , $ report ->mtime / 1000 ))
52
+ ];
53
+
54
+ if ($ this ->hasPermission ('reporting/reports/modify ' )) {
55
+ $ content [] = Html::tag ('td ' , ['class ' => 'icon-col ' ], [
51
56
new Link (
52
57
new Icon ('edit ' ),
53
58
Url::fromPath ('reporting/report/edit ' , ['id ' => $ report ->id ])
54
59
)
55
- ])
56
- ]);
60
+ ]);
61
+ }
62
+
63
+ $ tableRows [] = Html::tag ('tr ' , ['href ' => $ url ], $ content );
57
64
}
58
65
59
66
if (! empty ($ tableRows )) {
@@ -89,7 +96,7 @@ public function indexAction()
89
96
90
97
public function newAction ()
91
98
{
92
- $ this ->assertPermission ('reporting/reports ' );
99
+ $ this ->assertPermission ('reporting/reports/modify ' );
93
100
$ this ->addTitleTab ($ this ->translate ('New Report ' ));
94
101
95
102
$ form = (new ReportForm ())
0 commit comments