PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 3.0.4
Taskbuilder – Project Management & Task Management Tool With Kanban Board v3.0.4
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 1.0.6 All 57 releases
taskbuilder / includes / admin / tasks / open_task / wppm_edit_task_creator.php

wppm_edit_task_creator.php in Taskbuilder – Project Management & Task Management Tool With Kanban Board 3.0.4, at includes/admin/tasks/open_task/wppm_edit_task_creator.php

70 lines 2.9 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 global $wpdb,$wppmfunction,$current_user;
6 $task_id = isset($_POST['task_id']) ? intval(sanitize_text_field($_POST['task_id'])) : '' ;
7 $proj_id = isset($_POST['proj_id']) ? intval(sanitize_text_field($_POST['proj_id'])) : '' ;
8 if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_raised_by',$task_id))) {exit;}
9 $task_data = $wppmfunction->get_task($task_id);
10 $task_creator = get_userdata($task_data['created_by']);
11 $settings = get_option("wppm-ap-modal");
12 ob_start();
13 ?>
14 <form id="frm_get_task_creator" method="post">
15 <div class="row" style="padding-left:2px;">
16 <div class="col-sm-12">
17 <label class="wppm_ct_field_label" for="user_name"><?php echo esc_html_e('Task Creator Name','taskbuilder') ?> </label>
18 <input type="text" id="user_name" class="form-control wppm_regi_user_autocomplete ui-autocomplete-input" name="customer_name" autocomplete="off" value="<?php echo isset($task_creator->display_name)? htmlentities(stripcslashes(esc_attr($task_creator->display_name))):""?>">
19 </div>
20 </div>
21 <input type="hidden" name="action" value="wppm_set_change_raised_by" />
22 <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_change_raised_by')?>">
23 <input type="hidden" name="user_id" id="user_id" value="<?php echo isset($task_creator->ID) ? esc_attr($task_creator->ID) : ""; ?>">
24 <input type="hidden" name="task_id" value="<?php echo htmlentities(esc_attr($task_id)) ?>" />
25 </form>
26 <style>
27 li {
28 color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
29 }
30 </style>
31 <script>
32 jQuery(document).ready(function(){
33 jQuery( ".wppm_regi_user_autocomplete" ).autocomplete({
34 minLength: 1,
35 appendTo: jQuery('.wppm_regi_user_autocomplete').parent(),
36 source: function( request, response ) {
37 var term = request.term;
38 request = {
39 action : 'wppm_filter_autocomplete',
40 term : term,
41 field : 'users_name'
42 }
43 jQuery.getJSON( wppm_admin.ajax_url, request, function( data, status, xhr ) {
44 response(data);
45 });
46 },
47 minLength: 2,
48 select: function (event, ui) {
49 jQuery('#user_name').val(ui.item.value);
50 jQuery('#user_id').val(ui.item.user_id);
51 }
52 });
53
54 });
55 </script>
56 <?php
57 $body = ob_get_clean();
58 ob_start();
59 ?>
60 <button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button>
61 <button type="button" class="btn wppm_popup_action" onclick="wppm_set_change_raised_by(<?php echo esc_attr($task_id) ?>,<?php echo esc_attr($proj_id) ?>);"><?php echo esc_html_e('Save','taskbuilder');?></button>
62 <?php
63 $footer = ob_get_clean();
64
65 $output = array(
66 'body' => $body,
67 'footer' => $footer
68 );
69
70 echo json_encode($output);