Skip to content

Commit 4887d29

Browse files
authored
Update insight menu (#836)
This PR updates the “Insight” (now “Statistics”) menu ordering in cms_functions and removes the legacy “Fancy Graphs” feature (template + backend include) from the codebase.
1 parent 9122e50 commit 4887d29

4 files changed

Lines changed: 37 additions & 258 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Phinx\Migration\AbstractMigration;
6+
7+
final class UpdateInsightMenu extends AbstractMigration
8+
{
9+
public function up(): void
10+
{
11+
// Rename "Insight" menu and move to top
12+
$this->execute("
13+
UPDATE `cms_functions` SET `title_en` = 'Statistics', seq = 0 WHERE `id` = '128';
14+
");
15+
// Put "Sales report" below "Dashboard v2"
16+
$this->execute("
17+
UPDATE `cms_functions` SET `seq` = 19 WHERE `id` = '96';
18+
");
19+
// Remove "Fancy graphs"
20+
$this->execute("
21+
DELETE FROM `cms_functions` WHERE `id` = '102';
22+
");
23+
}
24+
25+
public function down(): void
26+
{
27+
$this->execute("
28+
UPDATE `cms_functions` SET `title_en` = 'Insight', seq = 6 WHERE `id` = '128';
29+
");
30+
$this->execute("
31+
UPDATE `cms_functions` SET `seq` = 16 WHERE `id` = '96';
32+
");
33+
$this->execute("
34+
INSERT INTO `cms_functions` (`id`, `parent_id`, `title_en`, `include`, `seq`, `alert`, `adminonly`, `visible`, `allusers`, `allcamps`, `action_permissions`) VALUES (102,128,'Fancy Graphs (<span>beta</span>)','fancygraphs',17,0,0,1,0,0,'view_beneficiary_graph');
35+
");
36+
}
37+
}

include/fancygraphs.php

Lines changed: 0 additions & 61 deletions
This file was deleted.

library/constants.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,6 @@
187187
'list_sales',
188188
],
189189
],
190-
[
191-
'id' => 102,
192-
'module' => 'Report',
193-
'menu' => 'Fancy graphs (<span>beta</span>)',
194-
'action' => 'fancygraphs',
195-
'adminonly' => '0',
196-
'visible' => '1',
197-
'allusers' => '0',
198-
'allcamps' => '0',
199-
'action_permission' => [
200-
'view_beneficiary_graph',
201-
],
202-
],
203190
[
204191
'id' => 167,
205192
'module' => 'Report',

templates/fancygraphs.tpl

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)