PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.2.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.2.0
2.2.0 2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 All 43 releases
← All changes | app/Services/Helper.php +30 -6 2.0.0 → 2.2.0 View file →
@@ -128,9 +128,9 @@
128 128 'remind_at' => 'sanitize_text_field',
129 129 'scope' => 'sanitize_text_field',
130 130 'source' => 'sanitize_text_field',
131 131 'source_id' => 'sanitize_text_field',
132 - 'description' => 'wp_kses_post',
132 + 'description' => 'fluent_boards_sanitize_description',
133 133 'due_date' => 'sanitize_text_field',
134 134 'start_at' => 'sanitize_text_field',
135 135 'log_minutes' => 'sanitize_text_field',
136 136 'last_completed' => 'sanitize_text_field',
@@ -154,9 +154,9 @@
154 154 'board_id' => 'intval',
155 155 'title' => 'sanitize_text_field',
156 156 'parent_id' => 'intval',
157 157 'type' => 'sanitize_text_field',
158 - 'description' => 'wp_kses_post',
158 + 'description' => 'fluent_boards_sanitize_description',
159 159 'currency' => 'sanitize_text_field',
160 160 'image_url' => 'sanitize_url',
161 161 'is_auth_require' => 'intval',
162 162 'crm_contact_id' => 'intval',
@@ -198,8 +198,9 @@
198 198 {
199 199 $fieldMaps = [
200 200 'bg_color' => 'sanitize_text_field',
201 201 'color' => 'sanitize_text_field',
202 + 'color_preset' => 'sanitize_key',
202 203 'label' => 'sanitize_text_field',
203 204 'boardId' => 'intval',
204 205 'task_id' => 'intval',
205 206 'meta_value' => 'intval',
@@ -215,9 +216,9 @@
215 216 'stage' => 'sanitize_text_field',
216 217 'newPosition' => 'intval',
217 218 'priority' => 'sanitize_text_field',
218 219 'type' => 'sanitize_text_field',
219 - 'description' => 'wp_kses_post',
220 + 'description' => 'fluent_boards_sanitize_description',
220 221 'group_id' => 'intval',
221 222 'board_id' => 'intval',
222 223 'created_by' => 'intval',
223 224 'due_date' => 'sanitize_text_field',
@@ -240,10 +241,23 @@
240 241
241 242 return $data;
242 243 }
243 244
245 + /** Store full custom-field messages in LONGTEXT while keeping legacy VARCHAR columns bounded. */
244 246 public static function createActivity($data)
245 247 {
248 + if (!empty($data['settings']['custom_field_id'])) {
249 + $payload = [];
250 + foreach (['column', 'old_value', 'new_value', 'description'] as $key) {
251 + $payload[$key] = $data[$key] ?? null;
252 + }
253 + $data['settings']['custom_field_activity_payload'] = true;
254 + $data['description'] = wp_json_encode($payload);
255 + $data['column'] = Constant::ACTIVITY_CUSTOM_FIELD;
256 + $data['old_value'] = null;
257 + $data['new_value'] = null;
258 + }
259 +
246 260 return Activity::create($data);
247 261 }
248 262
249 263 public static function sanitizeTaskMeta($data)
@@ -334,8 +348,9 @@
334 348 }
335 349 return fluent_boards_page_url() . 'boards/' . $boardId;
336 350 }
337 351
352 + /** Format a CRM contact, avoiding a database lookup for unassociated tasks. */
338 353 public static function crm_contact($id)
339 354 {
340 355 if (!defined('FLUENTCRM')) {
341 356 return '';
@@ -340,8 +355,12 @@
340 355 if (!defined('FLUENTCRM')) {
341 356 return '';
342 357 }
343 358
359 + if (!$id) {
360 + return null;
361 + }
362 +
344 363 $contact = \FluentCrm\App\Models\Subscriber::with(['tags', 'lists'])->find($id);
345 364
346 365 if (!$contact) {
347 366 return null;
@@ -434,9 +453,10 @@
434 453
435 454 return $users;
436 455 }
437 456
438 - public static function sanitizeUsersArray($users, $boardId = null)
457 + // Callers formatting multiple lists may supply a resolved board-manager result.
458 + public static function sanitizeUsersArray($users, $boardId = null, $isBoardManager = null)
439 459 {
440 460 if (current_user_can('list_users')) {
441 461 return $users;
442 462 }
@@ -442,9 +462,9 @@
442 462 }
443 463
444 464 $sanitizedUsers = [];
445 465
446 - if(!PermissionManager::isBoardManager($boardId)) //Todo: may create permission security issue, will be modified later
466 + if (!($isBoardManager ?? PermissionManager::isBoardManager($boardId)))
447 467 {
448 468 $currentUser = wp_get_current_user();
449 469 if($currentUser && isset($currentUser->user_email)){
450 470 $currentUserEmail = $currentUser->user_email;
@@ -596,8 +616,9 @@
596 616 'repeat_in' => 'intval',
597 617 'repeat_type' => 'sanitize_text_field',
598 618 'repeat_when_complete' => 'intval',
599 619 'selected_month' => 'sanitize_text_field',
620 + 'selected_stage' => 'intval',
600 621 'board_id' => 'intval',
601 622 'time' => 'sanitize_text_field',
602 623 'time_zone' => 'sanitize_text_field',
603 624 'next_repeat_date' => 'sanitize_text_field',
@@ -641,9 +662,9 @@
641 662 'remind_at' => 'sanitize_text_field',
642 663 'scope' => 'sanitize_text_field',
643 664 'source' => 'sanitize_text_field',
644 665 'source_id' => 'sanitize_text_field',
645 - 'description' => 'wp_kses_post',
666 + 'description' => 'fluent_boards_sanitize_description',
646 667 'due_date' => 'sanitize_text_field',
647 668 'start_at' => 'sanitize_text_field',
648 669 'log_minutes' => 'sanitize_text_field',
649 670 'last_completed' => 'sanitize_text_field',
@@ -703,11 +724,13 @@
703 724 'deleted' => __('deleted', 'fluent-boards'),
704 725 'archived' => __('archived', 'fluent-boards'),
705 726 'restored' => __('restored', 'fluent-boards'),
706 727 'set' => __('set', 'fluent-boards'),
728 + 'moved' => __('moved', 'fluent-boards'),
707 729 ];
708 730
709 731 $columnTranslations = [
732 + Constant::ACTIVITY_CUSTOM_FIELD => __('custom field', 'fluent-boards'),
710 733 'task' => __('task', 'fluent-boards'),
711 734 'description' => __('description', 'fluent-boards'),
712 735 'board' => __('board', 'fluent-boards'),
713 736 'assignee' => __('assignee', 'fluent-boards'),
@@ -724,8 +747,9 @@
724 747 'the associate email' => __('the associate email', 'fluent-boards'),
725 748 'attachment' => __('attachment', 'fluent-boards'),
726 749 'repeat task' => __('repeat task', 'fluent-boards'),
727 750 'Repeat Task' => __('Repeat Task', 'fluent-boards'),
751 + 'tasks' => __('tasks', 'fluent-boards'),
728 752 ];
729 753
730 754 foreach ($activities as $activity) {
731 755 $activity->action_key = $activity->action;