| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
global $current_user, $wpscfunction; |
| 7 |
if (!($current_user->ID && $current_user->has_cap('manage_options'))) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
|
| 11 |
$notification_types = $wpscfunction->get_email_notification_types(); |
| 12 |
|
| 13 |
$email_templates = get_terms([ |
| 14 |
'taxonomy' => 'wpsc_en', |
| 15 |
'hide_empty' => false, |
| 16 |
'orderby' => 'ID', |
| 17 |
'order' => 'ASC', |
| 18 |
]); |
| 19 |
|
| 20 |
?> |
| 21 |
<h4> |
| 22 |
<?php _e('Ticket Notifications','supportcandy');?> |
| 23 |
<button style="margin-left:10px;" class="btn btn-success btn-sm" onclick="wpsc_get_add_ticket_notification();"><?php _e('+Add New','supportcandy');?></button> |
| 24 |
</h4> |
| 25 |
|
| 26 |
<div class="wpsc_padding_space"></div> |
| 27 |
|
| 28 |
<table class="table table-striped table-hover"> |
| 29 |
<tr> |
| 30 |
<th><?php _e('Title','supportcandy')?></th> |
| 31 |
<th><?php _e('Notification Type','supportcandy')?></th> |
| 32 |
<th><?php _e('Actions','supportcandy')?></th> |
| 33 |
</tr> |
| 34 |
<?php foreach ( $email_templates as $email_template ) : |
| 35 |
$title = $email_template->name; |
| 36 |
$type = get_term_meta( $email_template->term_id, 'type', true); |
| 37 |
$type = isset($notification_types[$type]) ? $notification_types[$type] : ''; |
| 38 |
?> |
| 39 |
<tr> |
| 40 |
<td><?php echo esc_attr($title)?></td> |
| 41 |
<td><?php echo esc_attr($type)?></td> |
| 42 |
<td> |
| 43 |
<div class="wpsc_flex"> |
| 44 |
<div onclick="wpsc_get_edit_ticket_notification(<?php echo esc_attr($email_template->term_id);?>);" style="cursor:pointer;"><i class="fas fa-edit"></i></div> |
| 45 |
<div onclick="wpsc_clone_ticket_notification(<?php echo esc_attr($email_template->term_id);?>,'<?php echo wp_create_nonce('clone_ticket_notification')?>');" style="cursor:pointer; padding-left: 10px;"><i class="far fa-clone"></i></div> |
| 46 |
<div onclick="wpsc_delete_ticket_notification(<?php echo esc_attr($email_template->term_id);?>,'<?php echo wp_create_nonce('delete_ticket_notification')?>');" style="cursor:pointer; padding-left: 10px;"><i class="fas fa-trash"></i></div> |
| 47 |
</div> |
| 48 |
</td> |
| 49 |
</tr> |
| 50 |
<?php endforeach;?> |
| 51 |
</table> |