| 1 |
<?php |
| 2 |
add_filter( 'wpas_plugin_settings', 'wpas_core_settings_fields', 5, 1 ); |
| 3 |
/** |
| 4 |
* Add plugin core settings for fields and custom fields. |
| 5 |
* |
| 6 |
* @param array $def Array of existing settings |
| 7 |
* |
| 8 |
* @return array Updated settings |
| 9 |
*/ |
| 10 |
function wpas_core_settings_fields( $def ) { |
| 11 |
|
| 12 |
// translators: %s link to the article. |
| 13 |
$desc = __( 'We have two options that allow you to create custom fields. Please read <b><u><a %s>this article</a></b></u> on our website to learn about them.', 'awesome-support' ); |
| 14 |
|
| 15 |
$settings = array( |
| 16 |
'Fields' => array( |
| 17 |
'name' => __( 'Fields', 'awesome-support' ), |
| 18 |
'options' => array( |
| 19 |
array( |
| 20 |
'name' => __( 'Departments', 'awesome-support' ), |
| 21 |
'type' => 'heading', |
| 22 |
), |
| 23 |
array( |
| 24 |
'name' => __( 'Departments', 'awesome-support' ), |
| 25 |
'id' => 'departments', |
| 26 |
'type' => 'checkbox', |
| 27 |
'desc' => __( 'Enable departments management.', 'awesome-support' ), |
| 28 |
'default' => false |
| 29 |
), |
| 30 |
array( |
| 31 |
'name' => __( 'Priority Management', 'awesome-support' ), |
| 32 |
'type' => 'heading', |
| 33 |
'desc' => __( 'Use these options to control how the priority field is used and shown. To change the labels used for this field please see our POWER-PACK add-on.', 'awesome-support' ), |
| 34 |
'options' => wpas_get_priority_options() |
| 35 |
), |
| 36 |
array( |
| 37 |
'name' => __( 'Ticket Type Management', 'awesome-support' ), |
| 38 |
'type' => 'heading', |
| 39 |
'desc' => __( 'Use these options to control how the Ticket Type options are used and shown. To change the labels used for this field please see our POWER-PACK add-on.', 'awesome-support' ), |
| 40 |
'options' => wpas_get_ticket_type_options() |
| 41 |
), |
| 42 |
|
| 43 |
array( |
| 44 |
'name' => __( 'Multiple Agents', 'awesome-support' ), |
| 45 |
'type' => 'heading', |
| 46 |
'desc' => __( 'Use these options to control whether multiple agents can actively handle a single ticket. To change the labels please see our POWER-PACK add-on.', 'awesome-support' ) |
| 47 |
), |
| 48 |
array( |
| 49 |
'name' => __( 'Enable Multiple Agents Per Ticket', 'awesome-support' ), |
| 50 |
'id' => 'multiple_agents_per_ticket', |
| 51 |
'type' => 'checkbox', |
| 52 |
'desc' => __( 'Show the two extra agent fields on the ticket?', 'awesome-support' ), |
| 53 |
'default' => false |
| 54 |
), |
| 55 |
|
| 56 |
array( |
| 57 |
'name' => __( 'Show Secondary Agent In Ticket List', 'awesome-support' ), |
| 58 |
'id' => 'show_secondary_agent_in_ticket_list', |
| 59 |
'type' => 'checkbox', |
| 60 |
'desc' => __( 'Show the secondary agent in the ticket list?', 'awesome-support' ), |
| 61 |
'default' => false |
| 62 |
), |
| 63 |
|
| 64 |
array( |
| 65 |
'name' => __( 'Show Tertiary Agent In Ticket List', 'awesome-support' ), |
| 66 |
'id' => 'show_tertiary_agent_in_ticket_list', |
| 67 |
'type' => 'checkbox', |
| 68 |
'desc' => __( 'Show the Tertiary agent in the ticket list?', 'awesome-support' ), |
| 69 |
'default' => false |
| 70 |
), |
| 71 |
|
| 72 |
array( |
| 73 |
'name' => __( 'Third Parties', 'awesome-support' ), |
| 74 |
'type' => 'heading', |
| 75 |
'desc' => __( 'Use these options to control whether third parties show in the ticket list. To change the labels for 3rd party fields please see our POWER-PACK add-on.', 'awesome-support' ) |
| 76 |
), |
| 77 |
|
| 78 |
array( |
| 79 |
'name' => __( 'Enable Third Party Fields', 'awesome-support' ), |
| 80 |
'id' => 'show_third_party_fields', |
| 81 |
'type' => 'checkbox', |
| 82 |
'desc' => __( 'Show the third party fields on the ticket?', 'awesome-support' ), |
| 83 |
'default' => false |
| 84 |
), |
| 85 |
|
| 86 |
array( |
| 87 |
'name' => __( 'Show Third Party #1 in Ticket List', 'awesome-support' ), |
| 88 |
'id' => 'show_third_party_01_in_ticket_list', |
| 89 |
'type' => 'checkbox', |
| 90 |
'desc' => __( 'Show Third Party #1 data in the ticket list?', 'awesome-support' ), |
| 91 |
'default' => false |
| 92 |
), |
| 93 |
|
| 94 |
array( |
| 95 |
'name' => __( 'Show Third Party #2 in Ticket List', 'awesome-support' ), |
| 96 |
'id' => 'show_third_party_02_in_ticket_list', |
| 97 |
'type' => 'checkbox', |
| 98 |
'desc' => __( 'Show Third Party #2 data in the ticket list?', 'awesome-support' ), |
| 99 |
'default' => false |
| 100 |
), |
| 101 |
|
| 102 |
array( |
| 103 |
'name' => __( 'Show Date Fields in the Activity Column', 'awesome-support' ), |
| 104 |
'type' => 'heading', |
| 105 |
'desc' => __( 'The settings below control which dates show up in the activity column in the ticket list. The more fields you turn on the taller the row. Tall rows mean you can view fewer tickets on one screen. Sometimes, though, seeing all these dates can help with troubleshooting issues especially those related to reporting.', 'awesome-support' ), |
| 106 |
), |
| 107 |
array( |
| 108 |
'name' => __( 'Show Open Date ', 'awesome-support' ), |
| 109 |
'id' => 'show_open_date_in_activity_column', |
| 110 |
'type' => 'checkbox', |
| 111 |
'desc' => __( 'Show the open date in the activity column?', 'awesome-support' ), |
| 112 |
'default' => false |
| 113 |
), |
| 114 |
array( |
| 115 |
'name' => __( 'Show Open Date in GMT', 'awesome-support' ), |
| 116 |
'id' => 'show_open_date_gmt_in_activity_column', |
| 117 |
'type' => 'checkbox', |
| 118 |
'desc' => __( 'Show the open date in GMT in the activity column?', 'awesome-support' ), |
| 119 |
'default' => false |
| 120 |
), |
| 121 |
array( |
| 122 |
'name' => __( 'Show Close Date in GMT', 'awesome-support' ), |
| 123 |
'id' => 'show_close_date_gmt_in_activity_column', |
| 124 |
'type' => 'checkbox', |
| 125 |
'desc' => __( 'Show the close date in GMT in the activity column?', 'awesome-support' ), |
| 126 |
'default' => false |
| 127 |
), |
| 128 |
array( |
| 129 |
'name' => __( 'Show Length Of Time Ticket Was Opened', 'awesome-support' ), |
| 130 |
'id' => 'show_length_of_time_ticket_was_opened', |
| 131 |
'type' => 'checkbox', |
| 132 |
'desc' => __( 'Show how long the ticket was opened? Note that this applies to closed tickets only.', 'awesome-support' ), |
| 133 |
'default' => false |
| 134 |
), |
| 135 |
array( |
| 136 |
'name' => __( 'Show Extended Date In Replies', 'awesome-support' ), |
| 137 |
'id' => 'show_extended_date_in_replies', |
| 138 |
'type' => 'checkbox', |
| 139 |
'desc' => __( 'Hovering over replies can show a short date or a full date-time stamp. Turn this on to show the full date-time stamp as well as a human-readable number indicating the age of the reply.', 'awesome-support' ), |
| 140 |
'default' => false |
| 141 |
), |
| 142 |
|
| 143 |
|
| 144 |
array( |
| 145 |
'name' => __( 'Other Field Settings', 'awesome-support' ), |
| 146 |
'type' => 'heading', |
| 147 |
), |
| 148 |
array( |
| 149 |
'name' => __( 'Show Channel Field', 'awesome-support' ), |
| 150 |
'id' => 'channel_show_in_ticket_list', |
| 151 |
'type' => 'checkbox', |
| 152 |
'desc' => __( 'Show Channel field in the ticket list? (Channel allows you to select where a ticket originated - web, email, facebook etc.)', 'awesome-support' ), |
| 153 |
'default' => false |
| 154 |
), |
| 155 |
|
| 156 |
array( |
| 157 |
'name' => __( 'Custom Fields', 'awesome-support' ), |
| 158 |
'type' => 'heading', |
| 159 |
), |
| 160 |
|
| 161 |
array( |
| 162 |
'type' => 'Note', |
| 163 |
'desc' => sprintf( $desc, 'href="https://getawesomesupport.com/documentation/awesome-support/custom-fields/" target="_blank" ' ) |
| 164 |
), |
| 165 |
) |
| 166 |
), |
| 167 |
); |
| 168 |
|
| 169 |
return array_merge( $def, apply_filters('wpas_settings_fields', $settings ) ); |
| 170 |
|
| 171 |
} |
| 172 |
|
| 173 |
/** |
| 174 |
* Prepare the available options for priority |
| 175 |
* |
| 176 |
* @since 3.3.5 |
| 177 |
* @return array |
| 178 |
*/ |
| 179 |
function wpas_get_priority_options() { |
| 180 |
|
| 181 |
$priority = array( |
| 182 |
array( |
| 183 |
'name' => __( 'Use Priority Field', 'awesome-support' ), |
| 184 |
'id' => 'support_priority', |
| 185 |
'type' => 'checkbox', |
| 186 |
'desc' => __( 'Would you like to use the priority field in your tickets?', 'awesome-support' ), |
| 187 |
'default' => false |
| 188 |
), |
| 189 |
|
| 190 |
array( |
| 191 |
'name' => __( 'Mandatory?', 'awesome-support' ), |
| 192 |
'id' => 'support_priority_mandatory', |
| 193 |
'type' => 'checkbox', |
| 194 |
'desc' => __( 'Would you like to make the priority field mandatory in your tickets?', 'awesome-support' ), |
| 195 |
'default' => false |
| 196 |
), |
| 197 |
|
| 198 |
array( |
| 199 |
'name' => __( 'Show On Front End?', 'awesome-support' ), |
| 200 |
'id' => 'support_priority_show_fe', |
| 201 |
'type' => 'checkbox', |
| 202 |
'desc' => __( 'Would you like to show the field to the end user (unchecked restricts it to agent/admin use only)?', 'awesome-support' ), |
| 203 |
'default' => true |
| 204 |
), |
| 205 |
|
| 206 |
array( |
| 207 |
'name' => __( 'Show In Column List?', 'awesome-support' ), |
| 208 |
'id' => 'support_priority_show_in_ticket_list', |
| 209 |
'type' => 'checkbox', |
| 210 |
'desc' => __( 'Would you like to show the field in the ticket listing?', 'awesome-support' ), |
| 211 |
'default' => false |
| 212 |
), |
| 213 |
|
| 214 |
array( |
| 215 |
'name' => __( 'Color-code Ticket Header?', 'awesome-support' ), |
| 216 |
'id' => 'support_priority_color_code_ticket_header', |
| 217 |
'type' => 'checkbox', |
| 218 |
'desc' => __( 'Checking this box will color the top border of the opening post to match the priority color', 'awesome-support' ), |
| 219 |
'default' => false |
| 220 |
), |
| 221 |
|
| 222 |
); |
| 223 |
|
| 224 |
return $priority; |
| 225 |
} |
| 226 |
|
| 227 |
/** |
| 228 |
* Prepare the available options for ticket-type |
| 229 |
* |
| 230 |
* @since 5.8.1 |
| 231 |
* @return array |
| 232 |
*/ |
| 233 |
function wpas_get_ticket_type_options() { |
| 234 |
|
| 235 |
$ticket_type = array( |
| 236 |
array( |
| 237 |
'name' => __( 'Enable Ticket Types', 'awesome-support' ), |
| 238 |
'id' => 'support_ticket_type', |
| 239 |
'type' => 'checkbox', |
| 240 |
'desc' => __( 'Would you like to show the Ticket Type options in your tickets?', 'awesome-support' ), |
| 241 |
'default' => false |
| 242 |
), |
| 243 |
|
| 244 |
array( |
| 245 |
'name' => __( 'Mandatory?', 'awesome-support' ), |
| 246 |
'id' => 'support_ticket_type_mandatory', |
| 247 |
'type' => 'checkbox', |
| 248 |
'desc' => __( 'Would you like to make the Ticket Type options mandatory in your tickets?', 'awesome-support' ), |
| 249 |
'default' => false |
| 250 |
), |
| 251 |
|
| 252 |
array( |
| 253 |
'name' => __( 'Show On Front End?', 'awesome-support' ), |
| 254 |
'id' => 'support_ticket_type_show_fe', |
| 255 |
'type' => 'checkbox', |
| 256 |
'desc' => __( 'Would you like to show the field to the end user (unchecked restricts it to agent/admin use only)?', 'awesome-support' ), |
| 257 |
'default' => true |
| 258 |
), |
| 259 |
|
| 260 |
array( |
| 261 |
'name' => __( 'Show In Column List?', 'awesome-support' ), |
| 262 |
'id' => 'support_ticket_type_show_in_ticket_list', |
| 263 |
'type' => 'checkbox', |
| 264 |
'desc' => __( 'Would you like to show the field in the ticket listing?', 'awesome-support' ), |
| 265 |
'default' => false |
| 266 |
), |
| 267 |
|
| 268 |
array( |
| 269 |
'name' => __( 'Color-code Bottom Border?', 'awesome-support' ), |
| 270 |
'id' => 'support_ticket_type_color_code_ticket', |
| 271 |
'type' => 'checkbox', |
| 272 |
'desc' => __( 'Checking this box will color the bottom border of the opening post to match the Ticket Type color', 'awesome-support' ), |
| 273 |
'default' => false |
| 274 |
), |
| 275 |
|
| 276 |
); |
| 277 |
|
| 278 |
return apply_filters( 'wpas_ticket_type_options', $ticket_type ); |
| 279 |
} |