PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / trunk
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration vtrunk
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 1.41 1.45 All 41 releases
← All changes | app/Models/Task.php +34 -1 1.95trunk View file →
@@ -222,8 +222,30 @@
222 222 {
223 223 return $this->belongsTo(Board::class, 'board_id', 'id');
224 224 }
225 225
226 + /**
227 + * Exclude tasks that belong to template boards.
228 + */
229 + public function scopeExcludeTemplateBoards($query)
230 + {
231 + return $query->whereHas('board', function ($boardQuery) {
232 + $boardQuery->excludeTemplates();
233 + });
234 + }
235 +
236 + /**
237 + * Limit tasks to active, non-template boards available in this install.
238 + */
239 + public function scopeOnActiveAvailableBoards($query)
240 + {
241 + return $query->whereHas('board', function ($boardQuery) {
242 + $boardQuery->whereNull('archived_at')
243 + ->excludeTemplates()
244 + ->availableInCurrentInstall();
245 + });
246 + }
247 +
226 248 public function assignees()
227 249 {
228 250 return $this->belongsToMany(
229 251 User::class,
@@ -250,8 +272,13 @@
250 272 }
251 273
252 274 public function attachments() //may not need in future
253 275 {
276 + if (!defined('FLUENT_BOARDS_PRO_VERSION')) {
277 + return $this->hasMany(Attachment::class, 'id', 'id')
278 + ->where('id', 0);
279 + }
280 +
254 281 return $this->hasMany(TaskAttachment::class,
255 282 'object_id', 'id')
256 283 ->where('object_type', Constant::OBJECT_TYPE_TASK);
257 284 }
@@ -369,8 +396,14 @@
369 396
370 397 public function createTask($data)
371 398 {
372 399 $data = apply_filters('fluent_boards/before_task_create', $data);
400 +
401 + // Keep newly-created tasks unprioritized unless a priority is explicitly selected.
402 + if (!array_key_exists('priority', $data)) {
403 + $data['priority'] = '';
404 + }
405 +
373 406 $createdTask = Task::create($data);
374 407
375 408 if ( ! empty($data['assignees'])) {
376 409 $assignees = array_filter(array_map('intval', $data['assignees']));
@@ -844,9 +877,9 @@
844 877 'priority' => [
845 878 'field' => __('Priority', 'fluent-boards'),
846 879 'type' => 'text',
847 880 'rules' => 'optional',
848 - 'description' => __('Priority of the task (low | medium | high). Example: "medium" ', 'fluent-boards'),
881 + 'description' => __('Priority of the task (urgent | high | medium | low). Leave empty for no priority. Example: "medium" ', 'fluent-boards'),
849 882 ],
850 883 'due_at' => [
851 884 'field' => __('Due Date', 'fluent-boards'),
852 885 'type' => 'date',