| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
global $current_user,$wppmfunction; |
| 6 |
$task_id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : '' ; |
| 7 |
|
| 8 |
if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('clone_task',$task_id))) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
$task_name = $wppmfunction->get_task_fields($task_id,'task_name'); |
| 12 |
ob_start(); |
| 13 |
|
| 14 |
?> |
| 15 |
<form id="frm_edit_clone_task_name"> |
| 16 |
<div class="form-group"> |
| 17 |
<input type="text" id="task_name"class="form-control" name="task_name" value="<?php echo esc_attr($task_name); ?>"/> |
| 18 |
</div> |
| 19 |
<input type="hidden" name="action" value="wppm_set_clone_task" /> |
| 20 |
<input type="hidden" name="task_id" value="<?php echo esc_attr($task_id) ?>" /> |
| 21 |
<input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_clone_task')?>"> |
| 22 |
</form> |
| 23 |
|
| 24 |
<?php |
| 25 |
|
| 26 |
$body = ob_get_clean(); |
| 27 |
|
| 28 |
ob_start(); |
| 29 |
|
| 30 |
?> |
| 31 |
<button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php esc_html_e('Cancel','taskbuilder');?></button> |
| 32 |
<button type="button" class="btn wppm_popup_action" onclick="wppm_set_clone_task();"><?php esc_html_e('Save Changes','taskbuilder');?></button> |
| 33 |
<?php |
| 34 |
|
| 35 |
$footer = ob_get_clean(); |
| 36 |
|
| 37 |
$response = array( |
| 38 |
'body' => $body, |
| 39 |
'footer' => $footer |
| 40 |
); |
| 41 |
|
| 42 |
echo json_encode($response); |
| 43 |
?> |