PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 3.0.7
Taskbuilder – Project Management & Task Management Tool With Kanban Board v3.0.7
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_thread.php

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

72 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
6 global $wpdb,$wppmfunction,$current_user;
7 $comment_id = isset($_POST['comment_id']) ? intval(sanitize_text_field($_POST['comment_id'])) : '' ;
8 $task_id = isset($_POST['task_id']) ? intval(sanitize_text_field($_POST['task_id'])) : '' ;
9 $proj_id = isset($_POST['proj_id']) ? intval(sanitize_text_field($_POST['proj_id'])) : '' ;
10 $task_data = $wppmfunction->get_task($task_id);
11 $task_comment = $wppmfunction->get_task_comment($comment_id);
12 $settings = get_option("wppm-ap-modal");
13 if (!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('change_task_details',$task_id)) || ($current_user->ID == $task_comment['created_by']))) {exit;}
14 ob_start();
15 ?>
16 <form id="frm_edit_task_thread" method="post">
17 <div>
18 <textarea id="wppm_edit_task_thread_editor">
19 <?php echo stripslashes(htmlspecialchars_decode(esc_textarea($task_comment['body']),ENT_QUOTES))?>
20 </textarea>
21 </div>
22 <input type="hidden" name="action" value="wppm_set_edit_task_thread" />
23 <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_task_thread' ) ); ?>">
24 <input type="hidden" id="wppm_task_id" name="task_id" value="<?php echo htmlentities(esc_attr($task_id)) ?>" />
25 <input type="hidden" id="wppm_comment_id" name="comment_id" value="<?php echo htmlentities(esc_attr($comment_id)) ?>" />
26 </form>
27 <script>
28 jQuery( document ).ready( function( jQuery ) {
29 tinymce.remove();
30 tinymce.init({
31 selector:'#wppm_edit_task_thread_editor',
32 body_id: 'wppm_edit_task_thread_editor',
33 directionality : '<?php //echo 'rtl'; ?>',
34 menubar: false,
35 statusbar: false,
36 height : '200',
37 width : '100%',
38 plugins: [
39 'lists link image directionality'
40 ],
41 image_advtab: true,
42 toolbar: 'bold italic underline blockquote | alignleft aligncenter alignright | bullist numlist | rtl | link image',
43 branding: false,
44 autoresize_bottom_margin: 20,
45 browser_spellcheck : true,
46 relative_urls : false,
47 remove_script_host : false,
48 convert_urls : true,
49 content_style:
50 `body {
51 color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
52 }`,
53 setup: function (editor) {
54 }
55 });
56 });
57 <?php
58 $body = ob_get_clean();
59
60 ob_start();
61 ?>
62 <button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button>
63 <button type="button" class="btn wppm_popup_action" onclick="wppm_set_edit_task_thread(<?php echo htmlentities(esc_attr($task_id))?>,<?php echo esc_attr($proj_id) ?>);"><?php echo esc_html_e('Save','taskbuilder');?></button>
64 <?php
65 $footer = ob_get_clean();
66
67 $output = array(
68 'body' => $body,
69 'footer' => $footer
70 );
71
72 echo json_encode($output);