PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 2.0.3
Taskbuilder – Project Management & Task Management Tool With Kanban Board v2.0.3
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 2.0.3, at includes/admin/tasks/open_task/wppm_edit_task_creator.php

63 lines 2.6 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 ob_start();
12 ?>
13 <form id="frm_get_task_creator" method="post">
14 <div class="row" style="padding-left:2px;">
15 <div class="col-sm-12">
16 <label class="wppm_ct_field_label" for="user_name"><?php echo esc_html_e('Task Creator Name','taskbuilder') ?> </label>
17 <input type="text" id="user_name" class="form-control wppm_regi_user_autocomplete ui-autocomplete-input" name="customer_name" autocomplete="off" value="<?php echo htmlentities(stripcslashes(esc_attr($task_creator->display_name)))?>">
18 </div>
19 </div>
20 <input type="hidden" name="action" value="wppm_set_change_raised_by" />
21 <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($task_creator->ID) ?>">
22 <input type="hidden" name="task_id" value="<?php echo htmlentities(esc_attr($task_id)) ?>" />
23 </form>
24 <script>
25 jQuery(document).ready(function(){
26 jQuery( ".wppm_regi_user_autocomplete" ).autocomplete({
27 minLength: 1,
28 appendTo: jQuery('.wppm_regi_user_autocomplete').parent(),
29 source: function( request, response ) {
30 var term = request.term;
31 request = {
32 action : 'wppm_filter_autocomplete',
33 term : term,
34 field : 'users_name'
35 }
36 jQuery.getJSON( wppm_admin.ajax_url, request, function( data, status, xhr ) {
37 response(data);
38 });
39 },
40 minLength: 2,
41 select: function (event, ui) {
42 jQuery('#user_name').val(ui.item.value);
43 jQuery('#user_id').val(ui.item.user_id);
44 }
45 });
46
47 });
48 </script>
49 <?php
50 $body = ob_get_clean();
51 ob_start();
52 ?>
53 <button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button>
54 <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>
55 <?php
56 $footer = ob_get_clean();
57
58 $output = array(
59 'body' => $body,
60 'footer' => $footer
61 );
62
63 echo json_encode($output);