Add the ability to select a priority when creating a task (low, medium, high)

This commit is contained in:
iIronside
2023-10-13 16:31:22 +03:00
parent 1c3eeb4cf3
commit 5ce77f2ef0
8 changed files with 62 additions and 18 deletions

View File

@ -10,7 +10,7 @@ use backend\modules\task\models\ProjectTask;
/**
* TaskSearch represents the model behind the search form of `backend\modules\task\models\Task`.
*/
class TaskSearch extends ProjectTask
class ProjectTaskSearch extends ProjectTask
{
/**
* {@inheritdoc}
@ -18,7 +18,7 @@ class TaskSearch extends ProjectTask
public function rules()
{
return [
[['id', 'project_id', 'status'], 'integer'], // 'card_id_creator', 'card_id'
[['id', 'project_id', 'status', 'priority'], 'integer'], // 'card_id_creator', 'card_id'
[['title', 'created_at', 'updated_at', 'description'], 'safe'],
];
}
@ -60,14 +60,15 @@ class TaskSearch extends ProjectTask
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'task.project_id' => $this->project_id,
'task.status' => $this->status,
'task.created_at' => $this->created_at,
'task.updated_at' => $this->updated_at,
'project_task.project_id' => $this->project_id,
'project_task.status' => $this->status,
'project_task.priority' => $this->priority,
'project_task.created_at' => $this->created_at,
'project_task.updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'title', $this->title])
->andFilterWhere(['like', 'task.description', $this->description]);
->andFilterWhere(['like', 'project_task.description', $this->description]);
return $dataProvider;
}