rename task to project task, task_user to project_task_user, fix behavior
This commit is contained in:
@ -3,11 +3,11 @@
|
||||
namespace backend\modules\task\controllers;
|
||||
|
||||
use backend\modules\project\models\ProjectUser;
|
||||
use backend\modules\task\models\TaskUser;
|
||||
use backend\modules\task\models\ProjectTaskUser;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use yii\web\Response;
|
||||
use Yii;
|
||||
use backend\modules\task\models\Task;
|
||||
use backend\modules\task\models\ProjectTask;
|
||||
use backend\modules\task\models\TaskSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
@ -80,7 +80,7 @@ class TaskController extends Controller
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new Task();
|
||||
$model = new ProjectTask();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
@ -129,12 +129,12 @@ class TaskController extends Controller
|
||||
* Finds the Task model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return Task the loaded model
|
||||
* @return ProjectTask the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = Task::findOne($id)) !== null) {
|
||||
if (($model = ProjectTask::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ use yii\base\Model;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\web\Response;
|
||||
use Yii;
|
||||
use backend\modules\task\models\TaskUser;
|
||||
use backend\modules\task\models\ProjectTaskUser;
|
||||
use backend\modules\task\models\TaskUserSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
@ -78,7 +78,7 @@ class TaskUserController extends Controller
|
||||
$project_user_id_arr = ArrayHelper::getValue($post, 'project_user_id');
|
||||
|
||||
foreach ($project_user_id_arr as $project_user_id) {
|
||||
$emtModel = new TaskUser();
|
||||
$emtModel = new ProjectTaskUser();
|
||||
$emtModel->task_id = $post['task_id'];
|
||||
$emtModel->project_user_id = $project_user_id;
|
||||
|
||||
@ -99,7 +99,7 @@ class TaskUserController extends Controller
|
||||
}
|
||||
|
||||
|
||||
$model = new TaskUser();
|
||||
$model = new ProjectTaskUser();
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
'task_id' => $task_id,
|
||||
@ -156,12 +156,12 @@ class TaskUserController extends Controller
|
||||
* Finds the TaskUser model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return TaskUser the loaded model
|
||||
* @return ProjectTaskUser the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = TaskUser::findOne($id)) !== null) {
|
||||
if (($model = ProjectTaskUser::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user