Skip to content

Commit 6c71f2b

Browse files
committed
Fix issue with wrong config naming and add depend options
1 parent 2856382 commit 6c71f2b

4 files changed

Lines changed: 128 additions & 113 deletions

File tree

Helper/Data.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,92 +21,92 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
2121
/**
2222
* @var string
2323
*/
24-
const ACTIVITY_ENABLE = 'admin/general_admin_activity/enable';
24+
const ACTIVITY_ENABLE = 'admin/activity/enable';
2525

2626
/**
2727
* @var string
2828
*/
29-
const LOGIN_ACTIVITY_ENABLE = 'admin/general_admin_activity/login_activity';
29+
const LOGIN_ACTIVITY_ENABLE = 'admin/activity/login_activity';
3030

3131
/**
3232
* @var string
3333
*/
34-
const PAGE_VISIT_ENABLE = 'admin/general_admin_activity/page_visit';
34+
const PAGE_VISIT_ENABLE = 'admin/activity/page_visit';
3535

3636
/**
3737
* @var string
3838
*/
39-
const CLEAR_LOG_DAYS = 'admin/general_admin_activity/clearlog';
39+
const CLEAR_LOG_DAYS = 'admin/activity/clearlog';
4040

4141
/**
4242
* @var string
4343
*/
44-
const MODULE_ORDER = 'admin/general_admin_activity/order';
44+
const MODULE_ORDER = 'admin/activity/log/order';
4545

4646
/**
4747
* @var string
4848
*/
49-
const MODULE_PRODUCT = 'admin/general_admin_activity/product';
49+
const MODULE_PRODUCT = 'admin/activity/log/product';
5050

5151
/**
5252
* @var string
5353
*/
54-
const MODULE_CATEGORY = 'admin/general_admin_activity/category';
54+
const MODULE_CATEGORY = 'admin/activity/log/category';
5555

5656
/**
5757
* @var string
5858
*/
59-
const MODULE_CUSTOMER = 'admin/general_admin_activity/customer';
59+
const MODULE_CUSTOMER = 'admin/activity/log/customer';
6060

6161
/**
6262
* @var string
6363
*/
64-
const MODULE_PROMOTION = 'admin/general_admin_activity/promotion';
64+
const MODULE_PROMOTION = 'admin/activity/log/promotion';
6565

6666
/**
6767
* @var string
6868
*/
69-
const MODULE_EMAIL = 'admin/general_admin_activity/email';
69+
const MODULE_EMAIL = 'admin/activity/log/email';
7070

7171
/**
7272
* @var string
7373
*/
74-
const MODULE_PAGE = 'admin/general_admin_activity/page';
74+
const MODULE_PAGE = 'admin/activity/log/page';
7575

7676
/**
7777
* @var string
7878
*/
79-
const MODULE_BLOCK = 'admin/general_admin_activity/block';
79+
const MODULE_BLOCK = 'admin/activity/log/block';
8080

8181
/**
8282
* @var string
8383
*/
84-
const MODULE_WIDGET = 'admin/general_admin_activity/widget';
84+
const MODULE_WIDGET = 'admin/activity/log/widget';
8585

8686
/**
8787
* @var string
8888
*/
89-
const MODULE_THEME = 'admin/general_admin_activity/theme';
89+
const MODULE_THEME = 'admin/activity/log/theme';
9090

9191
/**
9292
* @var string
9393
*/
94-
const MODULE_SYSTEM_CONFIG = 'admin/general_admin_activity/system_config';
94+
const MODULE_SYSTEM_CONFIG = 'admin/activity/log/system_config';
9595

9696
/**
9797
* @var string
9898
*/
99-
const MODULE_ATTRIBUTE = 'admin/general_admin_activity/attibute';
99+
const MODULE_ATTRIBUTE = 'admin/activity/log/attibute';
100100

101101
/**
102102
* @var string
103103
*/
104-
const MODULE_ADMIN_USER = 'admin/general_admin_activity/admin_user';
104+
const MODULE_ADMIN_USER = 'admin/activity/log/admin_user';
105105

106106
/**
107107
* @var string
108108
*/
109-
const MODULE_SEO = 'admin/general_admin_activity/seo';
109+
const MODULE_SEO = 'admin/activity/log/seo';
110110

111111
/**
112112
* @var \Catgento\AdminActivity\Model\Config

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "catgento/module-admin-activity",
33
"description": "The Admin Activity extension makes it easy to track all admin activity and revert the modification.",
44
"type": "magento2-module",
5-
"version": "1.1.3",
5+
"version": "1.1.4",
66
"license": [
77
"OSL-3.0"
88
],

etc/adminhtml/system.xml

Lines changed: 108 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,108 @@
1-
<?xml version="1.0"?>
2-
<!--
3-
/**
4-
* Catgento
5-
*
6-
* Do not edit or add to this file if you wish to upgrade to newer versions in the future.
7-
* If you wish to customize this module for your needs.
8-
*
9-
* @category Catgento
10-
* @package Catgento_AdminActivity
11-
*/
12-
-->
13-
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
14-
<system>
15-
<section id="admin">
16-
<group id="general_admin_activity" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
17-
<label>Admin User Actions Log</label>
18-
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
19-
<label>Enable</label>
20-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
21-
</field>
22-
<field id="login_activity" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
23-
<label>Enable Login Activity</label>
24-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
25-
</field>
26-
<field id="page_visit" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
27-
<label>Enable Page Visit History</label>
28-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
29-
</field>
30-
<field id="clearlog" translate="label comment" type="text" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
31-
<label>Clear Admin Activity Logs After</label>
32-
<comment>Clear all admin activity logs after this days</comment>
33-
</field>
34-
<field id="order" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
35-
<label>Disable Logging Order Actions</label>
36-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
37-
</field>
38-
<field id="product" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
39-
<label>Disable Logging Product Actions</label>
40-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
41-
</field>
42-
<field id="category" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
43-
<label>Disable Logging Category Actions</label>
44-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
45-
</field>
46-
<field id="customer" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
47-
<label>Disable Logging Customer Actions</label>
48-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
49-
</field>
50-
<field id="promotion" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
51-
<label>Disable Logging Promotion Actions</label>
52-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
53-
</field>
54-
<field id="email" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
55-
<label>Disable Logging Email Templates Actions</label>
56-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
57-
</field>
58-
<field id="page" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0">
59-
<label>Disable Logging Page Actions</label>
60-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
61-
</field>
62-
<field id="block" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="0" showInStore="0">
63-
<label>Disable Logging Block Actions</label>
64-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
65-
</field>
66-
<field id="widget" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="0" showInStore="0">
67-
<label>Disable Logging Widget Actions</label>
68-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
69-
</field>
70-
<field id="theme" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0">
71-
<label>Disable Logging Theme Actions</label>
72-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
73-
</field>
74-
<field id="system_config" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="0" showInStore="0">
75-
<label>Disable Logging System Configuration Actions</label>
76-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
77-
</field>
78-
<field id="attibute" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="0" showInStore="0">
79-
<label>Disable Logging Product Attributes Actions</label>
80-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
81-
</field>
82-
<field id="admin_user" translate="label" type="select" sortOrder="130" showInDefault="1" showInWebsite="0" showInStore="0">
83-
<label>Disable Logging Admin user Actions</label>
84-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
85-
</field>
86-
<field id="seo" translate="label" type="select" sortOrder="140" showInDefault="1" showInWebsite="0" showInStore="0">
87-
<label>Disable Logging SEO Actions</label>
88-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
89-
</field>
90-
</group>
91-
</section>
92-
</system>
93-
</config>
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Catgento
5+
*
6+
* Do not edit or add to this file if you wish to upgrade to newer versions in the future.
7+
* If you wish to customize this module for your needs.
8+
*
9+
* @category Catgento
10+
* @package Catgento_AdminActivity
11+
*/
12+
-->
13+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
14+
<system>
15+
<section id="admin">
16+
<group id="activity" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
17+
<label>Admin User Actions Log</label>
18+
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
19+
<label>Enable</label>
20+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
21+
</field>
22+
<field id="login_activity" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
23+
<label>Enable Login Activity</label>
24+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
25+
<depends>
26+
<field id="enable">1</field>
27+
</depends>
28+
</field>
29+
<field id="page_visit" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
30+
<label>Enable Page Visit History</label>
31+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
32+
<depends>
33+
<field id="enable">1</field>
34+
</depends>
35+
</field>
36+
<field id="clearlog" translate="label comment" type="text" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
37+
<label>Clear Admin Activity Logs After</label>
38+
<comment>Clear all admin activity logs after this days</comment>
39+
<depends>
40+
<field id="enable">1</field>
41+
</depends>
42+
</field>
43+
<group id="log" translate="label" type="text" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
44+
<label>Actions</label>
45+
<depends>
46+
<field id="enable">1</field>
47+
</depends>
48+
<field id="order" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
49+
<label>Order Actions</label>
50+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
51+
</field>
52+
<field id="product" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
53+
<label>Product Actions</label>
54+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
55+
</field>
56+
<field id="category" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
57+
<label>Category Actions</label>
58+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
59+
</field>
60+
<field id="customer" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
61+
<label>Customer Actions</label>
62+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
63+
</field>
64+
<field id="promotion" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
65+
<label>Promotion Actions</label>
66+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
67+
</field>
68+
<field id="email" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
69+
<label>Email Templates Actions</label>
70+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
71+
</field>
72+
<field id="page" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0">
73+
<label>Page Actions</label>
74+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
75+
</field>
76+
<field id="block" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="0" showInStore="0">
77+
<label>Block Actions</label>
78+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
79+
</field>
80+
<field id="widget" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="0" showInStore="0">
81+
<label>Widget Actions</label>
82+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
83+
</field>
84+
<field id="theme" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0">
85+
<label>Theme Actions</label>
86+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
87+
</field>
88+
<field id="system_config" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="0" showInStore="0">
89+
<label>System Configuration Actions</label>
90+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
91+
</field>
92+
<field id="attibute" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="0" showInStore="0">
93+
<label>Product Attributes Actions</label>
94+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
95+
</field>
96+
<field id="admin_user" translate="label" type="select" sortOrder="130" showInDefault="1" showInWebsite="0" showInStore="0">
97+
<label>Admin user Actions</label>
98+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
99+
</field>
100+
<field id="seo" translate="label" type="select" sortOrder="140" showInDefault="1" showInWebsite="0" showInStore="0">
101+
<label>SEO Actions</label>
102+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
103+
</field>
104+
</group>
105+
</group>
106+
</section>
107+
</system>
108+
</config>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
*/
1212
-->
1313
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
14-
<module name="Catgento_AdminActivity" setup_version="1.1.3"/>
14+
<module name="Catgento_AdminActivity" setup_version="1.1.4"/>
1515
</config>

0 commit comments

Comments
 (0)