PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 6.0.6
Taskbuilder – Project Management & Task Management Tool With Kanban Board v6.0.6
6.0.6 6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 All 58 releases
← All changes | includes/admin/tasks/wppm_get_delete_task.php +38 -37 4.0.96.0.6 View file →
@@ -1,37 +1,38 @@
1 -<?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - exit; // Exit if accessed directly
4 -}
5 -
6 -global $current_user,$wppmfunction;
7 -$id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : '';
8 -$proj_id = isset($_POST['proj_id']) ? sanitize_text_field($_POST['proj_id']) : '';
9 -$task_data = $wppmfunction->get_task($id);
10 -$project_data = $wppmfunction->get_project($proj_id);
11 -$wppm_current_user_capability = get_user_meta( $current_user->ID, 'wppm_capability', true );
12 -if(!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('delete_task',$id)) || $wppm_current_user_capability == 'wppm_admin'|| $project_data['created_by']==$current_user->ID )){
13 - exit;
14 -}
15 -ob_start();
16 -?>
17 -<form id="frm_delete_task">
18 - <div class="form-group">
19 - <p><?php echo esc_html_e('Are you sure to delete this task?','taskbuilder');?></p>
20 - </div>
21 - <input type="hidden" name="action" value="wppm_set_delete_task" />
22 - <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_delete_task')?>">
23 - <input type="hidden" name="task_id" value="<?php echo htmlentities(esc_attr($id))?>" />
24 -</form>
25 -<?php
26 -$body = ob_get_clean();
27 -ob_start();
28 -?>
29 -<button type="button" class="btn <?php echo (($proj_id!="0"))?'wppm_popup_close':'wppm_task_popup_close'?>" onclick="<?php echo (($proj_id!=0))?'wppm_modal_close();':'wppm_task_modal_close();'?>"><?php echo esc_html_e('Cancel','taskbuilder');?></button>
30 -<button type="button" class="btn <?php echo ($proj_id!="0")?'wppm_popup_action':'wppm_task_popup_action'?>" onclick="wppm_set_delete_task(<?php echo esc_attr($proj_id) ?>);"><?php echo esc_html_e('Confirm','taskbuilder');?></button>
31 -<?php
32 -$footer = ob_get_clean();
33 -$response = array(
34 - 'body' => $body,
35 - 'footer' => $footer
36 -);
37 -echo json_encode($response);
1 +<?php
2 +if ( ! defined( 'ABSPATH' ) ) {
3 + exit; // Exit if accessed directly
4 +}
5 +
6 +global $current_user,$wppmfunction;
7 +$id = isset($_POST['id']) ? sanitize_text_field(wp_unslash($_POST['id'])) : '';
8 +$proj_id = isset($_POST['proj_id']) ? sanitize_text_field(wp_unslash($_POST['proj_id'])) : '';
9 +$project_id = isset($_POST['project_id']) ? sanitize_text_field(wp_unslash($_POST['project_id'])) : '';
10 +$task_data = $wppmfunction->get_task($id);
11 +$project_data = $wppmfunction->get_project($proj_id);
12 +$wppm_current_user_capability = get_user_meta( $current_user->ID, 'wppm_capability', true );
13 +if(!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('delete_task',$id)) || $wppm_current_user_capability == 'wppm_admin'|| $project_data['created_by']==$current_user->ID )){
14 + exit;
15 +}
16 +ob_start();
17 +?>
18 +<form id="frm_delete_task">
19 + <div class="form-group">
20 + <p><?php echo esc_html_e('Are you sure to delete this task?','taskbuilder');?></p>
21 + </div>
22 + <input type="hidden" name="action" value="wppm_set_delete_task" />
23 + <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr(wp_create_nonce('wppm_set_delete_task'))?>">
24 + <input type="hidden" name="task_id" value="<?php echo (esc_attr($id))?>" />
25 +</form>
26 +<?php
27 +$body = ob_get_clean();
28 +ob_start();
29 +?>
30 +<button type="button" class="btn <?php echo (($proj_id!="0"))?'wppm_popup_close':'wppm_task_popup_close'?>" onclick="<?php echo (($proj_id!=0))?'wppm_modal_close();':'wppm_task_modal_close();'?>"><?php echo esc_html_e('Cancel','taskbuilder');?></button>
31 +<button type="button" class="btn <?php echo ($proj_id!="0")?'wppm_popup_action':'wppm_task_popup_action'?>" onclick="wppm_set_delete_task(<?php echo esc_attr($proj_id) ?>, <?php echo esc_attr($project_id) ?>);"><?php echo esc_html_e('Confirm','taskbuilder');?></button>
32 +<?php
33 +$footer = ob_get_clean();
34 +$response = array(
35 + 'body' => $body,
36 + 'footer' => $footer
37 +);
38 +echo wp_json_encode($response);