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/projects/open_project/wppm_edit_project_status.php +50 -48 1.0.26.0.6 View file →
@@ -1,48 +1,50 @@
1 -<?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - exit; // Exit if accessed directly
4 -}
5 -global $wpdb,$wppmfunction,$current_user;
6 -$project_id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : '' ;
7 -if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('change_project_status',$project_id))) {exit;}
8 -$project_data = $wppmfunction->get_project($project_id);
9 -$statuses = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wppm_project_statuses");
10 -$status_id = $project_data['status'];
11 -ob_start();
12 -?>
13 -<form id="frm_get_project_change_status" method="post">
14 - <div class="form-group">
15 - <label for="wppm_project_status" class="wppm_project_status"><?php echo esc_html_e('Project Status','taskbuilder');?></label>
16 - <select class="form-control" name="wppm_project_status">
17 - <?php
18 - if(!empty($statuses)){
19 - foreach ( $statuses as $status ) :
20 - $selected = $status_id == $status->id ? 'selected="selected"' : '';
21 - echo '<option '.esc_attr($selected).' value="'.esc_attr($status->id).'">'.esc_html($status->name).'</option>';
22 - endforeach;
23 - }
24 - ?>
25 - </select>
26 - </div>
27 - <?php do_action('wppm_after_edit_change_project_status',$project_id);?>
28 - <input type="hidden" name="action" value="wppm_set_change_project_status" />
29 - <input type="hidden" id="wppm_project_id" name="project_id" value="<?php echo htmlentities(esc_attr($project_id)); ?>" />
30 -
31 -
32 -</form>
33 -<?php
34 -$body = ob_get_clean();
35 -
36 -ob_start();
37 -?>
38 -<button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button>
39 -<button type="button" class="btn wppm_popup_action" onclick="wppm_set_change_project_status(<?php echo htmlentities(esc_attr($project_id))?>);"><?php echo esc_html_e('Save','taskbuilder');?></button>
40 -<?php
41 -$footer = ob_get_clean();
42 -
43 -$output = array(
44 - 'body' => $body,
45 - 'footer' => $footer
46 -);
47 -
48 -echo json_encode($output);
1 +<?php
2 +if ( ! defined( 'ABSPATH' ) ) {
3 + exit; // Exit if accessed directly
4 +}
5 +global $wpdb,$wppmfunction,$current_user;
6 +$project_id = isset($_POST['id']) ? intval(sanitize_text_field(wp_unslash($_POST['id']))) : '' ;
7 +$project_data = $wppmfunction->get_project($project_id);
8 +$wppm_current_user_capability = get_user_meta( $current_user->ID, 'wppm_capability', true );
9 +if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('change_project_status',$project_id) || ($project_data['created_by']==$current_user->ID && $wppm_current_user_capability=='wppm_manager') || $wppm_current_user_capability=='wppm_admin')) {exit;}
10 +$statuses = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wppm_project_statuses");
11 +$status_id = $project_data['status'];
12 +ob_start();
13 +?>
14 +<form id="frm_get_project_change_status" method="post">
15 + <div class="form-group">
16 + <label for="wppm_project_status" class="wppm_project_status"><?php echo esc_html_e('Project Status','taskbuilder');?></label>
17 + <select class="form-control" name="wppm_project_status">
18 + <?php
19 + if(!empty($statuses)){
20 + foreach ( $statuses as $status ) :
21 + $selected = $status_id == $status->id ? 'selected="selected"' : '';
22 + echo '<option '.esc_attr($selected).' value="'.esc_attr($status->id).'">'.esc_html($status->name).'</option>';
23 + endforeach;
24 + }
25 + ?>
26 + </select>
27 + </div>
28 + <?php do_action('wppm_after_edit_change_project_status',$project_id);?>
29 + <input type="hidden" name="action" value="wppm_set_change_project_status" />
30 + <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_project_status' ) ); ?>">
31 + <input type="hidden" id="wppm_project_id" name="project_id" value="<?php echo (esc_attr($project_id)); ?>" />
32 +
33 +
34 +</form>
35 +<?php
36 +$body = ob_get_clean();
37 +
38 +ob_start();
39 +?>
40 +<button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button>
41 +<button type="button" class="btn wppm_popup_action" onclick="wppm_set_change_project_status(<?php echo esc_js($project_id)?>);"><?php echo esc_html_e('Save','taskbuilder');?></button>
42 +<?php
43 +$footer = ob_get_clean();
44 +
45 +$output = array(
46 + 'body' => $body,
47 + 'footer' => $footer
48 +);
49 +
50 +echo wp_json_encode($output);