task uodate fix
This commit is contained in:
parent
c0aae8ed73
commit
28f9f3a87e
@ -108,11 +108,11 @@ class ProjectTask extends ActiveRecord
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[['project_id', 'status', 'title', 'description',], 'required', 'on' => self::SCENARIO_DEFAULT],
|
[['project_id', 'status', 'title', 'description'], 'required'],
|
||||||
[['project_id', 'status', 'column_id', 'user_id', 'executor_id', 'priority', 'execution_priority'], 'integer'],
|
[['project_id', 'status', 'column_id', 'user_id', 'executor_id', 'priority', 'execution_priority'], 'integer'],
|
||||||
[['created_at', 'updated_at', 'dead_line'], 'safe'],
|
[['created_at', 'updated_at', 'dead_line'], 'safe'],
|
||||||
['execution_priority', 'in', 'range' => [self::PRIORITY_LOW, self::PRIORITY_MEDIUM, self::PRIORITY_HIGH]],
|
['execution_priority', 'in', 'range' => [self::PRIORITY_LOW, self::PRIORITY_MEDIUM, self::PRIORITY_HIGH]],
|
||||||
['title', 'unique', 'targetAttribute' => ['title', 'project_id'], 'message' => 'Такая задача уже создана'],
|
//['title', 'unique', 'targetAttribute' => ['title', 'project_id'], 'message' => 'Такая задача уже создана'],
|
||||||
[['title'], 'string', 'max' => 255],
|
[['title'], 'string', 'max' => 255],
|
||||||
['status', 'in', 'range' => [self::STATUS_DISABLE, self::STATUS_ACTIVE, self::STATUS_ARCHIVE, self::STATUS_AT_WORK]],
|
['status', 'in', 'range' => [self::STATUS_DISABLE, self::STATUS_ACTIVE, self::STATUS_ARCHIVE, self::STATUS_AT_WORK]],
|
||||||
[['description'], 'string', 'max' => 1500],
|
[['description'], 'string', 'max' => 1500],
|
||||||
@ -194,6 +194,16 @@ class ProjectTask extends ActiveRecord
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function scenarios(): array
|
||||||
|
{
|
||||||
|
$scenarios = parent::scenarios();
|
||||||
|
$scenarios[self::SCENARIO_UPDATE_TASK] = ['id'];
|
||||||
|
return $scenarios;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool|int|string|null
|
* @return bool|int|string|null
|
||||||
*/
|
*/
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace frontend\modules\api\controllers;
|
namespace frontend\modules\api\controllers;
|
||||||
|
|
||||||
|
use common\classes\Debug;
|
||||||
use common\models\ProjectTask;
|
use common\models\ProjectTask;
|
||||||
use common\models\ProjectTaskUser;
|
use common\models\ProjectTaskUser;
|
||||||
use common\models\User;
|
use common\models\User;
|
||||||
|
@ -115,7 +115,6 @@ class TaskService
|
|||||||
public function updateTask($task_params): ?ProjectTask
|
public function updateTask($task_params): ?ProjectTask
|
||||||
{
|
{
|
||||||
$modelTask = ProjectTask::findOne($task_params['task_id']);
|
$modelTask = ProjectTask::findOne($task_params['task_id']);
|
||||||
$modelTask->scenario = ProjectTask::SCENARIO_UPDATE_TASK;
|
|
||||||
|
|
||||||
if (isset($task_params['executor_id']) && $task_params['executor_id'] == 0){
|
if (isset($task_params['executor_id']) && $task_params['executor_id'] == 0){
|
||||||
$task_params['executor_id'] = null;
|
$task_params['executor_id'] = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user