| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
global $current_user; |
| 7 |
if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;} |
| 8 |
|
| 9 |
ob_start(); |
| 10 |
?> |
| 11 |
<form id="wpsc_frm_agent_role" action="javascript:function(return false;);" method="post"> |
| 12 |
|
| 13 |
<div class="form-group"> |
| 14 |
<label style="font-size:16px;"><?php _e('Label','supportcandy');?></label> |
| 15 |
<input id="wpsc_role_label" class="form-control" name="agentrole[label]" value="" /> |
| 16 |
</div> |
| 17 |
|
| 18 |
<label style="margin-bottom:20px; font-size:16px;"><?php _e('Ticket Permissions','supportcandy');?></label> |
| 19 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 20 |
<div class="col-sm-4"> |
| 21 |
<label><?php _e('View unassigned','supportcandy');?></label> |
| 22 |
<p class="help-block"><?php _e('Unassigned ticket list visibility.','supportcandy');?></p> |
| 23 |
<select class="form-control" name="agentrole[view_unassigned]"> |
| 24 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 25 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 26 |
</select> |
| 27 |
</div> |
| 28 |
<div class="col-sm-4"> |
| 29 |
<label><?php _e('View assigned me','supportcandy');?></label> |
| 30 |
<p class="help-block"><?php _e('Ticket assigned to user himself. This will also enable private notes.','supportcandy');?></p> |
| 31 |
<select class="form-control" name="agentrole[view_assigned_me]"> |
| 32 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 33 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 34 |
</select> |
| 35 |
</div> |
| 36 |
<div class="col-sm-4"> |
| 37 |
<label><?php _e('View assigned others','supportcandy');?></label> |
| 38 |
<p class="help-block"><?php _e('Ticket assigned to all other agents. This will also enable private notes.','supportcandy');?></p> |
| 39 |
<select class="form-control" name="agentrole[view_assigned_others]"> |
| 40 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 41 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 42 |
</select> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
|
| 46 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 47 |
<div class="col-sm-4"> |
| 48 |
<label><?php _e('Assign unassigned','supportcandy');?></label> |
| 49 |
<p class="help-block"><?php _e('Unassigned ticket assign agent capability.','supportcandy');?></p> |
| 50 |
<select class="form-control" name="agentrole[assign_unassigned]"> |
| 51 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 52 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 53 |
</select> |
| 54 |
</div> |
| 55 |
<div class="col-sm-4"> |
| 56 |
<label><?php _e('Assign assigned me','supportcandy');?></label> |
| 57 |
<p class="help-block"><?php _e('Ticket assigned to user himself further assign capability.','supportcandy');?></p> |
| 58 |
<select class="form-control" name="agentrole[assign_assigned_me]"> |
| 59 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 60 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 61 |
</select> |
| 62 |
</div> |
| 63 |
<div class="col-sm-4"> |
| 64 |
<label><?php _e('Assign assigned others','supportcandy');?></label> |
| 65 |
<p class="help-block"><?php _e('Ticket assigned to all other agents further assign capability.','supportcandy');?></p> |
| 66 |
<select class="form-control" name="agentrole[assign_assigned_others]"> |
| 67 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 68 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 69 |
</select> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
|
| 73 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 74 |
<div class="col-sm-4"> |
| 75 |
<label><?php _e('Reply unassigned','supportcandy');?></label> |
| 76 |
<p class="help-block"><?php _e('Unassigned ticket reply capability.','supportcandy');?></p> |
| 77 |
<select class="form-control" name="agentrole[reply_unassigned]"> |
| 78 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 79 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 80 |
</select> |
| 81 |
</div> |
| 82 |
<div class="col-sm-4"> |
| 83 |
<label><?php _e('Reply assigned me','supportcandy');?></label> |
| 84 |
<p class="help-block"><?php _e('Ticket assigned to user himself reply capability.','supportcandy');?></p> |
| 85 |
<select class="form-control" name="agentrole[reply_assigned_me]"> |
| 86 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 87 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 88 |
</select> |
| 89 |
</div> |
| 90 |
<div class="col-sm-4"> |
| 91 |
<label><?php _e('Reply assigned others','supportcandy');?></label> |
| 92 |
<p class="help-block"><?php _e('Ticket assigned to all other agents reply capability.','supportcandy');?></p> |
| 93 |
<select class="form-control" name="agentrole[reply_assigned_others]"> |
| 94 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 95 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 96 |
</select> |
| 97 |
</div> |
| 98 |
</div> |
| 99 |
|
| 100 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 101 |
<div class="col-sm-4"> |
| 102 |
<label><?php _e('Change status unassigned','supportcandy');?></label> |
| 103 |
<p class="help-block"><?php _e('Unassigned ticket status change capability.','supportcandy');?></p> |
| 104 |
<select class="form-control" name="agentrole[cng_tkt_sts_unassigned]"> |
| 105 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 106 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 107 |
</select> |
| 108 |
</div> |
| 109 |
<div class="col-sm-4"> |
| 110 |
<label><?php _e('Change status assigned me','supportcandy');?></label> |
| 111 |
<p class="help-block"><?php _e('Ticket assigned to user himself change ticket status capability.','supportcandy');?></p> |
| 112 |
<select class="form-control" name="agentrole[cng_tkt_sts_assigned_me]"> |
| 113 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 114 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 115 |
</select> |
| 116 |
</div> |
| 117 |
<div class="col-sm-4"> |
| 118 |
<label><?php _e('Change status assigned others','supportcandy');?></label> |
| 119 |
<p class="help-block"><?php _e('Ticket assigned to all other agents change ticket status capability.','supportcandy');?></p> |
| 120 |
<select class="form-control" name="agentrole[cng_tkt_sts_assigned_others]"> |
| 121 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 122 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 123 |
</select> |
| 124 |
</div> |
| 125 |
</div> |
| 126 |
|
| 127 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 128 |
<div class="col-sm-4"> |
| 129 |
<label><?php _e('Change ticket fields unassigned','supportcandy');?></label> |
| 130 |
<p class="help-block"><?php _e('Unassigned change ticket fields capability.','supportcandy');?></p> |
| 131 |
<select class="form-control" name="agentrole[cng_tkt_field_unassigned]"> |
| 132 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 133 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 134 |
</select> |
| 135 |
</div> |
| 136 |
<div class="col-sm-4"> |
| 137 |
<label><?php _e('Change ticket fields assigned me','supportcandy');?></label> |
| 138 |
<p class="help-block"><?php _e('Ticket assigned to user himself change ticket fields capability.','supportcandy');?></p> |
| 139 |
<select class="form-control" name="agentrole[cng_tkt_field_assigned_me]"> |
| 140 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 141 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 142 |
</select> |
| 143 |
</div> |
| 144 |
<div class="col-sm-4"> |
| 145 |
<label><?php _e('Change ticket fields assigned others','supportcandy');?></label> |
| 146 |
<p class="help-block"><?php _e('Ticket assigned to all other agents change ticket fields capability.','supportcandy');?></p> |
| 147 |
<select class="form-control" name="agentrole[cng_tkt_field_assigned_others]"> |
| 148 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 149 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 150 |
</select> |
| 151 |
</div> |
| 152 |
</div> |
| 153 |
|
| 154 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 155 |
<div class="col-sm-4"> |
| 156 |
<label><?php _e('Change agentonly fields unassigned','supportcandy');?></label> |
| 157 |
<p class="help-block"><?php _e('Unassigned change agentonly fields capability.','supportcandy');?></p> |
| 158 |
<select class="form-control" name="agentrole[cng_tkt_ao_unassigned]"> |
| 159 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 160 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 161 |
</select> |
| 162 |
</div> |
| 163 |
<div class="col-sm-4"> |
| 164 |
<label><?php _e('Change agentonly fields assigned me','supportcandy');?></label> |
| 165 |
<p class="help-block"><?php _e('Ticket assigned to user himself change agentonly fields capability.','supportcandy');?></p> |
| 166 |
<select class="form-control" name="agentrole[cng_tkt_ao_assigned_me]"> |
| 167 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 168 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 169 |
</select> |
| 170 |
</div> |
| 171 |
<div class="col-sm-4"> |
| 172 |
<label><?php _e('Change agentonly fields assigned others','supportcandy');?></label> |
| 173 |
<p class="help-block"><?php _e('Ticket assigned to all other agents change agentonly fields capability.','supportcandy');?></p> |
| 174 |
<select class="form-control" name="agentrole[cng_tkt_ao_assigned_others]"> |
| 175 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 176 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 177 |
</select> |
| 178 |
</div> |
| 179 |
</div> |
| 180 |
|
| 181 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 182 |
<div class="col-sm-4"> |
| 183 |
<label><?php _e('Change Raised By unassigned','supportcandy');?></label> |
| 184 |
<p class="help-block"><?php _e('Unassigned ticket change raised by capability.','supportcandy');?></p> |
| 185 |
<select class="form-control" name="agentrole[cng_tkt_rb_unassigned]"> |
| 186 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 187 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 188 |
</select> |
| 189 |
</div> |
| 190 |
<div class="col-sm-4"> |
| 191 |
<label><?php _e('Change Raised By assigned me','supportcandy');?></label> |
| 192 |
<p class="help-block"><?php _e('Ticket assigned to user himself change Raised By capability.','supportcandy');?></p> |
| 193 |
<select class="form-control" name="agentrole[cng_tkt_rb_assigned_me]"> |
| 194 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 195 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 196 |
</select> |
| 197 |
</div> |
| 198 |
<div class="col-sm-4"> |
| 199 |
<label><?php _e('Change Raised By assigned others','supportcandy');?></label> |
| 200 |
<p class="help-block"><?php _e('Ticket assigned to all other agents change Raised By capability.','supportcandy');?></p> |
| 201 |
<select class="form-control" name="agentrole[cng_tkt_rb_assigned_others]"> |
| 202 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 203 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 204 |
</select> |
| 205 |
</div> |
| 206 |
</div> |
| 207 |
|
| 208 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 209 |
<div class="col-sm-4"> |
| 210 |
<label><?php _e('Delete unassigned','supportcandy');?></label> |
| 211 |
<p class="help-block"><?php _e('Delete unassigned ticket capability.','supportcandy');?></p> |
| 212 |
<select class="form-control" name="agentrole[delete_unassigned]"> |
| 213 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 214 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 215 |
</select> |
| 216 |
</div> |
| 217 |
<div class="col-sm-4"> |
| 218 |
<label><?php _e('Delete assigned me','supportcandy');?></label> |
| 219 |
<p class="help-block"><?php _e('Ticket assigned to user himself delete capability.','supportcandy');?></p> |
| 220 |
<select class="form-control" name="agentrole[delete_assigned_me]"> |
| 221 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 222 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 223 |
</select> |
| 224 |
</div> |
| 225 |
<div class="col-sm-4"> |
| 226 |
<label><?php _e('Delete assigned others','supportcandy');?></label> |
| 227 |
<p class="help-block"><?php _e('Ticket assigned to all other agents delete capability.','supportcandy');?></p> |
| 228 |
<select class="form-control" name="agentrole[delete_assigned_others]"> |
| 229 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 230 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 231 |
</select> |
| 232 |
</div> |
| 233 |
</div> |
| 234 |
|
| 235 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 236 |
<div class="col-sm-4"> |
| 237 |
<label><?php _e('Edit/Delete unassigned threads','supportcandy');?></label> |
| 238 |
<p class="help-block"><?php _e('Edit/Delete unassigned ticket threads capability.','supportcandy');?></p> |
| 239 |
<select class="form-control" name="agentrole[edit_delete_unassigned]"> |
| 240 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 241 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 242 |
</select> |
| 243 |
</div> |
| 244 |
<div class="col-sm-4"> |
| 245 |
<label><?php _e('Edit/Delete assigned me threads','supportcandy');?></label> |
| 246 |
<p class="help-block"><?php _e('Ticket assigned to user himself edit/delete threads capability.','supportcandy');?></p> |
| 247 |
<select class="form-control" name="agentrole[edit_delete_assigned_me]"> |
| 248 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 249 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 250 |
</select> |
| 251 |
</div> |
| 252 |
<div class="col-sm-4"> |
| 253 |
<label><?php _e('Edit/Delete assigned others threads','supportcandy');?></label> |
| 254 |
<p class="help-block"><?php _e('Ticket assigned to all other agents edit/delete threads capability.','supportcandy');?></p> |
| 255 |
<select class="form-control" name="agentrole[edit_delete_assigned_others]"> |
| 256 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 257 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 258 |
</select> |
| 259 |
</div> |
| 260 |
</div> |
| 261 |
|
| 262 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 263 |
<div class="col-sm-4"> |
| 264 |
<label><?php _e('Private note unassigned','supportcandy');?></label> |
| 265 |
<p class="help-block"><?php _e('Private note unassigned ticket capability.','supportcandy');?></p> |
| 266 |
<select class="form-control" name="agentrole[view_unassigned_private_note]"> |
| 267 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 268 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 269 |
</select> |
| 270 |
</div> |
| 271 |
|
| 272 |
<div class="col-sm-4"> |
| 273 |
<label><?php _e('Private note assigned me','supportcandy');?></label> |
| 274 |
<p class="help-block"><?php _e('Ticket assigned to user himself private note capability.','supportcandy');?></p> |
| 275 |
<select class="form-control" name="agentrole[view_assigned_me_private_note]"> |
| 276 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 277 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 278 |
</select> |
| 279 |
</div> |
| 280 |
|
| 281 |
<div class="col-sm-4"> |
| 282 |
<label><?php _e('Private note assigned others','supportcandy');?></label> |
| 283 |
<p class="help-block"><?php _e('Ticket assigned to all other agents private note capability.','supportcandy');?></p> |
| 284 |
<select class="form-control" name="agentrole[view_assigned_others_private_note]"> |
| 285 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 286 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 287 |
</select> |
| 288 |
</div> |
| 289 |
</div> |
| 290 |
|
| 291 |
<div class="form-group row" style="margin-bottom:30px;"> |
| 292 |
<div class="col-sm-4"> |
| 293 |
<label><?php _e('View log unassigned','supportcandy');?></label> |
| 294 |
<p class="help-block"><?php _e('View log unassigned ticket capability.','supportcandy');?></p> |
| 295 |
<select class="form-control" name="agentrole[view_unassigned_log]"> |
| 296 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 297 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 298 |
</select> |
| 299 |
</div> |
| 300 |
|
| 301 |
<div class="col-sm-4"> |
| 302 |
<label><?php _e('View log assigned me','supportcandy');?></label> |
| 303 |
<p class="help-block"><?php _e('Ticket assigned to user himself view log capability.','supportcandy');?></p> |
| 304 |
<select class="form-control" name="agentrole[view_assigned_me_log]"> |
| 305 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 306 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 307 |
</select> |
| 308 |
</div> |
| 309 |
|
| 310 |
<div class="col-sm-4"> |
| 311 |
<label><?php _e('View log assigned others','supportcandy');?></label> |
| 312 |
<p class="help-block"><?php _e('Ticket assigned to all other agents view log capability.','supportcandy');?></p> |
| 313 |
<select class="form-control" name="agentrole[view_assigned_others_log]"> |
| 314 |
<option value="0"><?php _e('Disable','supportcandy');?></option> |
| 315 |
<option value="1"><?php _e('Enable','supportcandy');?></option> |
| 316 |
</select> |
| 317 |
</div> |
| 318 |
</div> |
| 319 |
|
| 320 |
<?php do_action('wpsc_add_agent_role_item'); ?> |
| 321 |
|
| 322 |
<input type="hidden" name="action" value="wpsc_settings" /> |
| 323 |
<input type="hidden" name="setting_action" value="set_add_agent_role" /> |
| 324 |
<input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('set_add_agent_role')?>"> |
| 325 |
</form> |
| 326 |
<?php |
| 327 |
$body = ob_get_clean(); |
| 328 |
ob_start(); |
| 329 |
?> |
| 330 |
<button type="button" class="btn wpsc_popup_close" onclick="wpsc_modal_close();"><?php _e('Close','supportcandy');?></button> |
| 331 |
<button type="button" class="btn wpsc_popup_action" onclick="wpsc_set_add_agent_role();"><?php _e('Submit','supportcandy');?></button> |
| 332 |
<?php |
| 333 |
$footer = ob_get_clean(); |
| 334 |
|
| 335 |
$output = array( |
| 336 |
'body' => $body, |
| 337 |
'footer' => $footer |
| 338 |
); |
| 339 |
|
| 340 |
wp_send_json($output); |
| 341 |
|