update foreign key in task in task

This commit is contained in:
iIronside
2021-12-20 17:49:11 +03:00
parent ef0889aac6
commit e07dd0eff6
14 changed files with 132 additions and 78 deletions

View File

@ -1,5 +1,6 @@
<?php
use backend\modules\card\models\UserCard;
use backend\modules\project\models\Project;
use common\models\User;
use kartik\select2\Select2;
@ -25,9 +26,9 @@ use yii\widgets\ActiveForm;
]
) ?>
<?= $form->field($model, 'user_id')->widget(Select2::className(),
<?= $form->field($model, 'card_id')->widget(Select2::className(),
[
'data' => User::find()->select(['username', 'id'])->indexBy('id')->column(),
'data' => UserCard::find()->select(['fio', 'id'])->indexBy('id')->column(),
'options' => ['placeholder' => '...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true,

View File

@ -1,5 +1,6 @@
<?php
use backend\modules\card\models\UserCard;
use backend\modules\project\models\Project;
use common\models\User;
use kartik\select2\Select2;
@ -25,9 +26,9 @@ use yii\widgets\ActiveForm;
]
) ?>
<?= $form->field($model, 'user_id')->widget(Select2::className(),
<?= $form->field($model, 'card_id')->widget(Select2::className(),
[
'data' => User::find()->select(['username', 'id'])->indexBy('id')->column(),
'data' => UserCard::find()->select(['fio', 'id'])->indexBy('id')->column(),
'options' => ['placeholder' => '...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true,

View File

@ -2,6 +2,7 @@
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\web\YiiAsset;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
@ -10,7 +11,7 @@ use yii\widgets\DetailView;
$this->title = 'Сотрудник проекта: ' . $model->project->name;
$this->params['breadcrumbs'][] = ['label' => 'Project Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
YiiAsset::register($this);
?>
<div class="project-user-view">
@ -38,6 +39,10 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'user_id',
'value' => ArrayHelper::getValue($model, 'user.username' ),
],
[
'attribute' => 'card_id',
'value' => ArrayHelper::getValue($model, 'card.fio' ),
],
],
]) ?>