PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 2.3.1
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v2.3.1
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / admin / settings / get_edit_status.php

get_edit_status.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 2.3.1, at includes/admin/settings/get_edit_status.php

53 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 $status_id = isset($_POST) && isset($_POST['status_id']) ? intval($_POST['status_id']) : 0;
10 if (!$status_id) {exit;}
11
12 $status = get_term_by('id', $status_id, 'wpsc_statuses');
13 $color = get_term_meta( $status->term_id, 'wpsc_status_color', true);
14 $backgound_color = get_term_meta( $status->term_id, 'wpsc_status_background_color', true);
15
16 ob_start();
17 ?>
18 <div class="form-group">
19 <label for="wpsc_status_name"><?php _e('Status Name','supportcandy');?></label>
20 <p class="help-block"><?php _e('Insert status name. Please make sure status name you are entering should not already exist.','supportcandy');?></p>
21 <input id="wpsc_status_name" class="form-control" name="wpsc_status_name" value="<?php echo esc_attr($status->name)?>" />
22 </div>
23 <div class="form-group">
24 <label for="wpsc_status_color"><?php _e('Color','supportcandy');?></label>
25 <p class="help-block"><?php _e('Text color of status.','supportcandy');?></p>
26 <input id="wpsc_status_color" class="wpsc_color_picker" name="wpsc_status_color" value="<?php echo esc_attr($color)?>" />
27 </div>
28 <div class="form-group">
29 <label for="wpsc_status_bg_color"><?php _e('Background Color','supportcandy');?></label>
30 <p class="help-block"><?php _e('Background color of status.','supportcandy');?></p>
31 <input id="wpsc_status_bg_color" class="wpsc_color_picker" name="wpsc_status_bg_color" value="<?php echo esc_attr($backgound_color)?>" />
32 </div>
33 <script>
34 jQuery(document).ready(function(){
35 jQuery('.wpsc_color_picker').wpColorPicker();
36 });
37 </script>
38 <?php
39 $body = ob_get_clean();
40 ob_start();
41 ?>
42 <button type="button" class="btn wpsc_popup_close" onclick="wpsc_modal_close();"><?php _e('Close','supportcandy');?></button>
43 <button type="button" class="btn wpsc_popup_action" onclick="wpsc_set_edit_status(<?php echo esc_attr($status_id)?>);"><?php _e('Submit','supportcandy');?></button>
44 <?php
45 $footer = ob_get_clean();
46
47 $output = array(
48 'body' => $body,
49 'footer' => $footer
50 );
51
52 wp_send_json($output);
53