PluginProbe
Awesome Support – WordPress HelpDesk & Support Plugin / trunk
Awesome Support – WordPress HelpDesk & Support Plugin vtrunk
6.4.0 trunk 3.0.0 3.0.1 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 All 95 releases
awesome-support / includes / admin / settings / settings-permissions.php

settings-permissions.php in Awesome Support – WordPress HelpDesk & Support Plugin trunk, at includes/admin/settings/settings-permissions.php

182 lines 8.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 add_filter( 'wpas_plugin_settings', 'wpas_core_settings_permissions', 5, 1 );
3 /**
4 * Add plugin core permissions settings.
5 *
6 * @param array $def Array of existing settings
7 *
8 * @return array Updated settings
9 */
10 function wpas_core_settings_permissions( $def ) {
11
12 // translators: %s is the URL to the article.
13 $desc = __( 'Basic user and agent permissions are handled by WordPress ROLES and CAPABILITIES. <br />When this plugin was installed, we automatically included roles for agents and users named SUPPORT AGENT and SUPPORT USER. <br />You can use these when you set up new users and they are automatically assigned to users that register on our login page. <br />BUT, if you have existing users with existing roles that need to open tickets please read <b><u><a %s>this article</a></b></u> on our website. <br />The rest of this page helps you to control the appearance of some items on your ticket screens.', 'awesome-support' );
14
15 $settings = array(
16 'permissions' => array(
17 'name' => __( 'Permissions', 'awesome-support' ),
18 'options' => array(
19 array(
20 'name' => __( 'Permissions', 'awesome-support' ),
21 'type' => 'heading',
22 ),
23
24 array(
25 'type' => 'Note',
26 'desc' => sprintf( $desc, 'href="https://getawesomesupport.com/documentation/awesome-support/admin-handling-existing-users-after-installation/" target="_blank" ' )
27 ),
28
29 array(
30 'name' => __( 'Ticket List Tabs', 'awesome-support' ),
31 'type' => 'heading',
32 'desc' => __( 'Control whether certain tabs are visible at the top of the admin ticket list', 'awesome-support' ),
33 ),
34 array(
35 'name' => __( 'Show Documentation Tab', 'awesome-support' ),
36 'id' => 'ticket_list_show_doc_tab',
37 'type' => 'checkbox',
38 'default' => true
39 ),
40 array(
41 'name' => __( 'Show Bulk Actions Tab', 'awesome-support' ),
42 'id' => 'ticket_list_show_bulk_actions_tab',
43 'type' => 'checkbox',
44 'default' => true
45 ),
46 array(
47 'name' => __( 'Show Preferences Tab', 'awesome-support' ),
48 'id' => 'ticket_list_show_preferences_tab',
49 'type' => 'checkbox',
50 'default' => true
51 ),
52
53 array(
54 'name' => __( 'Ticket Templates', 'awesome-support' ),
55 'type' => 'heading',
56 'desc' => __( 'Ticket templates are tickets that can be copied by add-ons to make new tickets. The options in this section offers control of this feature.', 'awesome-support' ),
57 ),
58 array(
59 'name' => __( 'Enable Ticket Templates', 'awesome-support' ),
60 'id' => 'enable_ticket_templates',
61 'type' => 'checkbox',
62 'default' => false
63 ),
64 array(
65 'name' => __( 'Show Flag In Ticket List', 'awesome-support' ),
66 'id' => 'show_ticket_template_in_ticket_list',
67 'type' => 'checkbox',
68 'default' => false
69 ),
70
71 array(
72 'name' => __( 'Ticket Details Tabs And Metaboxes', 'awesome-support' ),
73 'type' => 'heading',
74 'desc' => __( 'Control who can view certain ticket tabs on the ticket detail screen in wp-admin', 'awesome-support' ),
75 ),
76 array(
77 'name' => __( 'Roles That Are NOT Allowed Access To The Custom Fields Tab', 'awesome-support' ),
78 'id' => 'hide_cf_tab_roles',
79 'type' => 'text',
80 'desc' => __( 'Enter a comma separated list of roles that should not see the CUSTOM FIELDS tab. Roles should be the internal WordPress role id such as wpas_agent and are case sensitive. There should be no spaces between the commas and role names when entering multiple roles.', 'awesome-support' ),
81 'default' => ''
82 ),
83 array(
84 'name' => __( 'Roles That Are NOT Allowed Access To The Additional Interested Parties Tab', 'awesome-support' ),
85 'id' => 'hide_ai_tab_roles',
86 'type' => 'text',
87 'desc' => __( 'Enter a comma separated list of roles that should not see the ADDITIONAL INTERESTED PARTIES tab. Roles should be the internal WordPress role id such as wpas_agent and are case sensitive. There should be no spaces between the commas and role names when entering multiple roles.', 'awesome-support' ),
88 'default' => ''
89 ),
90 array(
91 'name' => __( 'Roles That Are NOT Allowed Access To The Tags Metabox', 'awesome-support' ),
92 'id' => 'hide_tags_mb_roles',
93 'type' => 'text',
94 'desc' => __( 'Enter a comma separated list of roles that should not see the tags metabox. Roles should be the internal WordPress role id such as wpas_agent and are case sensitive. There should be no spaces between the commas and role names when entering multiple roles.', 'awesome-support' ),
95 'default' => ''
96 ),
97
98 array(
99 'name' => __( 'Editing History', 'awesome-support' ),
100 'type' => 'heading',
101 'desc' => __( 'This section allows you to control whether ticket and ticket replies can be edited by agents. Allowing this can distort the ticket history but might be necessary to comply with certain privacy regulations - for example removing user ids, passwords or other sensitive data.', 'awesome-support' ),
102 'options' => wpas_get_editing_history_options()
103 ),
104 )
105 ),
106 );
107
108 return array_merge( $def, apply_filters('wpas_settings_permission', $settings ) );
109
110 }
111
112 /**
113 * Prepare an array that shows editing history options
114 *
115 * @since 5.2.0
116 * @return array
117 */
118 function wpas_get_editing_history_options() {
119
120 $security = array(
121 array(
122 'name' => __( 'Roles That Are NOT Allowed to Edit Ticket Content', 'awesome-support' ),
123 'id' => 'roles_edit_ticket_content',
124 'type' => 'text',
125 'desc' => __( 'Enter a comma separated list of roles that should NOT be able to edit ticket content. Roles should be the internal WordPress role id such as wpas_agent and are case sensitive. There should be no spaces between the commas and role names when entering multiple roles.', 'awesome-support' ),
126 'default' => '',
127 ),
128
129 array(
130 'name' => __( 'Allow Agents To Edit Their Own Replies', 'awesome-support' ),
131 'id' => 'agent_edit_own_reply',
132 'type' => 'checkbox',
133 'desc' => __( 'Would you like agents to be able to edit their own replies?', 'awesome-support' ),
134 'default' => false
135 ),
136
137 array(
138 'name' => __( 'Roles That Can Edit All Replies', 'awesome-support' ),
139 'id' => 'roles_edit_all_replies',
140 'type' => 'text',
141 'desc' => __( 'Enter a comma separated list of roles that should be able to edit any agent and user reply. Roles should be the internal WordPress role id such as wpas_agent and are case sensitive. There should be no spaces between the commas and role names when entering multiple roles.', 'awesome-support' ),
142 'default' => '',
143 ),
144
145 array(
146 'name' => __( 'Allow Agents To Delete Their Own Replies', 'awesome-support' ),
147 'id' => 'agent_delete_own_reply',
148 'type' => 'checkbox',
149 'desc' => __( 'Would you like agents to be able to delete their own replies? (FYI: We really do not recommend allowing deletes but you do have the option if you want it!)', 'awesome-support' ),
150 'default' => false
151 ),
152
153 array(
154 'name' => __( 'Roles That Can Delete All Replies', 'awesome-support' ),
155 'id' => 'roles_delete_all_replies',
156 'type' => 'text',
157 'desc' => __( 'Enter a comma separated list of roles that should be able to delete any agent and user reply. Roles should be the internal WordPress role id such as wpas_agent and are case sensitive. There should be no spaces between the commas and role names when entering multiple roles.', 'awesome-support' ),
158 'default' => '',
159 ),
160
161 array(
162 'name' => __( 'Permanently Delete Replies', 'awesome-support' ),
163 'id' => 'permanently_trash_replies',
164 'type' => 'checkbox',
165 'desc' => __( 'Check this to allow replies to be permanently deleted. If you do not check this option, deleted items will end up in the WordPress trash bin which will allow you to see the deletion in-line. They can be permanently deleted later with most third-party clean-up plugins.', 'awesome-support' ),
166 'default' => false
167 ),
168
169 array(
170 'name' => __( 'Log content edits', 'awesome-support' ),
171 'id' => 'log_content_edit_level',
172 'type' => 'radio',
173 'desc' => __( 'What level should edits to ticket content and replies be logged?', 'awesome-support' ),
174 'options' => array( 'low' => __( 'Low - only logs whether the ticket or reply was edited. This prevents additional sensitive data from being stored in the log when the intention is to edit out sensitive information.', 'awesome-support' ),
175 'high' => __( 'High - log the original contents before the reply was edited so that a full history could be maintained', 'awesome-support' ) ),
176 'default' => 'low'
177 ),
178
179 );
180
181 return $security;
182 }