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:
32
backend/modules/task/views/project-task-category/_form.php
Normal file
32
backend/modules/task/views/project-task-category/_form.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\project\models\Project;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\task\models\ProjectTaskCategory */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="project-task-category-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'project_id')->dropDownList(
|
||||
Project::find()->select(['name', 'id'])->indexBy('id')->column(),
|
||||
[
|
||||
'id' => 'project_id',
|
||||
'prompt' => 'Выберите'
|
||||
]
|
||||
); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
31
backend/modules/task/views/project-task-category/_search.php
Normal file
31
backend/modules/task/views/project-task-category/_search.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\task\models\ProjectTaskCategorySearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="project-task-category-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'title') ?>
|
||||
|
||||
<?= $form->field($model, 'project_id') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
18
backend/modules/task/views/project-task-category/create.php
Normal file
18
backend/modules/task/views/project-task-category/create.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\task\models\ProjectTaskCategory */
|
||||
|
||||
$this->title = 'Создание категории задач';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Project Task Categories', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="project-task-category-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
51
backend/modules/task/views/project-task-category/index.php
Normal file
51
backend/modules/task/views/project-task-category/index.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\project\models\Project;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\task\models\ProjectTaskCategorySearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Категории задач проекта';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="project-task-category-index">
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать категорию задач', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'title',
|
||||
[
|
||||
'attribute' => 'project_id',
|
||||
'value' => 'project.name',
|
||||
'filter' => Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'project_id',
|
||||
'data' => Project::find()->select(['project.name', 'project.id'])
|
||||
->indexBy('project.id')->column(),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'Выберите значение'
|
||||
],
|
||||
])
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
21
backend/modules/task/views/project-task-category/update.php
Normal file
21
backend/modules/task/views/project-task-category/update.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\task\models\ProjectTaskCategory */
|
||||
|
||||
$this->title = 'Update Project Task Category: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Project Task Categories', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="project-task-category-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
40
backend/modules/task/views/project-task-category/view.php
Normal file
40
backend/modules/task/views/project-task-category/view.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\task\models\ProjectTaskCategory */
|
||||
|
||||
$this->title = $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Project Task Categories', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="project-task-category-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'title',
|
||||
[
|
||||
'attribute' => 'project_id',
|
||||
'value' => ArrayHelper::getValue($model, 'project.name'),
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user