rename task to project_task and task_user to project_task_user; create project_task_category, fix bug in create project method

This commit is contained in:
iIronside
2023-01-23 11:40:45 +03:00
parent 8b2bb7468c
commit 9eba04cae2
15 changed files with 521 additions and 18 deletions

View File

@ -166,4 +166,25 @@ class ProjectUserController extends Controller
return $this->redirect(['index']);
}
public function actionUsersNotOnProject(): array
{
Yii::$app->response->format = Response::FORMAT_JSON;
if (isset($_POST['depdrop_parents'])) {
$parents = $_POST['depdrop_parents'];
if ($parents != null) {
$project_id = $parents[0];
$categories = ProjectUser::getUsersNotOnProject($project_id);
$formattedCatArr = array();
foreach ($categories as $key => $value){
$formattedCatArr[] = array('id' => $key, 'name' => $value);
}
return ['output'=>$formattedCatArr, 'selected'=>''];
}
}
return ['output'=>'', 'selected'=>''];
}
}