feat(tasks): complete task management system with Kanban, Calendar, notifications
- Add Task model with subtasks, priorities, status transitions, dates, hours - Add Comment polymorphic model for tasks/issues/projects - Livewire components: TaskManager (list+filters), TaskForm (modal), TaskDetail, TaskKanban (drag&drop), TaskCalendar (FullCalendar) - TaskPolicy with permissions (view/create/edit/delete/assign/manage all) - Notifications: assigned, status change, overdue, comment added - Daily overdue notification job scheduled - Dashboard widget unifies IssueTask + Task - i18n: en/es/fr/ru (393 keys each) - Routes, navigation, offline sync support - 101 tests passing, Pint compliant on new files
This commit is contained in:
+11
-5
@@ -16,8 +16,8 @@ class Project extends Model
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
"start_date" => "date",
|
||||
"end_date_estimated" => "date",
|
||||
'start_date' => 'date',
|
||||
'end_date_estimated' => 'date',
|
||||
];
|
||||
|
||||
public function changeOrders()
|
||||
@@ -44,8 +44,8 @@ class Project extends Model
|
||||
public function companies()
|
||||
{
|
||||
return $this->belongsToMany(Company::class, 'company_project')
|
||||
->withPivot('role_in_project')
|
||||
->withTimestamps();
|
||||
->withPivot('role_in_project')
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function creator()
|
||||
@@ -69,14 +69,20 @@ class Project extends Model
|
||||
return $this->morphMany(Media::class, 'mediable')->where('category', 'image');
|
||||
}
|
||||
|
||||
public function tasks()
|
||||
{
|
||||
return $this->hasMany(Task::class);
|
||||
}
|
||||
|
||||
// Scope to filter accessible projects for non-admin users
|
||||
public function scopeAccessibleBy($query, User $user)
|
||||
{
|
||||
if ($user->can('manage all')) {
|
||||
return $query;
|
||||
}
|
||||
|
||||
return $query->whereHas('users', function ($q) use ($user) {
|
||||
$q->where('user_id', $user->id);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user