- Introduced migration Version_0_13_0 to update task schema: - Changed start_date and end_date to DATE type, truncating time. - Added new columns: task_kind, definition_of_done, planned_work. - Removed parent_id and its index, replacing with a dependency graph. - Created new tables: plan_task_dependencies and plan_task_raci, including a join table for stakeholders. - Updated Version_0_4_0 migration to remove references to parent_id. - Refactored TaskModel to return tasks as flat rows with dependencies and RACI assignments. - Modified task table view to display tasks without hierarchical structure, adding badges for milestones and phases. - Enhanced task form to include dependencies and RACI roles, with appropriate macros for rendering. - Updated task list view to reflect new task structure and display status based on task kind. - Added new validation constraints for task dependencies and dates, ensuring no cycles or self-references. - Removed obsolete ValidTaskParent validation as parent-child relationships are no longer supported. - Updated translations to reflect changes in task management and new fields. - Revised documentation to describe new task handling and features.
41 lines
997 B
PHP
41 lines
997 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MauticPlugin\PlanBundle\Entity;
|
|
|
|
/**
|
|
* The kind of a task. The order of the cases is the order of the dropdown.
|
|
*/
|
|
enum TaskKind: string
|
|
{
|
|
case Task = 'task';
|
|
case Milestone = 'milestone';
|
|
case Phase = 'phase';
|
|
|
|
public function getLabelKey(): string
|
|
{
|
|
return 'mautic.plan.task.kind.'.$this->value;
|
|
}
|
|
|
|
/**
|
|
* True when this kind has no status of its own: a phase is a collection of tasks, its state comes
|
|
* from them.
|
|
*/
|
|
public function hasStatus(): bool
|
|
{
|
|
return self::Phase !== $this;
|
|
}
|
|
|
|
/**
|
|
* Applies the kind's rules to the task's dates. A milestone's end date is enslaved to its start
|
|
* date: whatever is set, the end becomes the start.
|
|
*/
|
|
public function enslaveDates(Task $task): void
|
|
{
|
|
if (self::Milestone === $this && null !== $task->getStartDate()) {
|
|
$task->setEndDate(clone $task->getStartDate());
|
|
}
|
|
}
|
|
}
|