diff --git a/common/models/ProjectTask.php b/common/models/ProjectTask.php index 38867b1..fb4a13e 100644 --- a/common/models/ProjectTask.php +++ b/common/models/ProjectTask.php @@ -47,6 +47,9 @@ class ProjectTask extends ActiveRecord const PRIORITY_MEDIUM = 1; const PRIORITY_HIGH = 2; + const SCENARIO_UPDATE_TASK = 'update'; + + const DAY_IN_UNIX_TIME = 86340; // 23:59:59 /** @@ -105,7 +108,7 @@ class ProjectTask extends ActiveRecord public function rules() { return [ - [['project_id', 'status', 'title', 'description',], 'required'], + [['project_id', 'status', 'title', 'description',], 'required', 'on' => self::SCENARIO_DEFAULT], [['project_id', 'status', 'column_id', 'user_id', 'executor_id', 'priority', 'execution_priority'], 'integer'], [['created_at', 'updated_at', 'dead_line'], 'safe'], ['execution_priority', 'in', 'range' => [self::PRIORITY_LOW, self::PRIORITY_MEDIUM, self::PRIORITY_HIGH]], diff --git a/frontend/modules/api/services/TaskService.php b/frontend/modules/api/services/TaskService.php index 28af3e5..3d0b3e6 100644 --- a/frontend/modules/api/services/TaskService.php +++ b/frontend/modules/api/services/TaskService.php @@ -115,6 +115,7 @@ class TaskService public function updateTask($task_params): ?ProjectTask { $modelTask = ProjectTask::findOne($task_params['task_id']); + $modelTask->scenario = ProjectTask::SCENARIO_UPDATE_TASK; if (isset($task_params['executor_id']) && $task_params['executor_id'] == 0){ $task_params['executor_id'] = null;