2021-11-23 14:58:28 +03:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use backend\modules\project\models\Project;
|
2023-01-23 11:40:45 +03:00
|
|
|
|
use kartik\depdrop\DepDrop;
|
2021-11-23 14:58:28 +03:00
|
|
|
|
use yii\helpers\Html;
|
2023-01-23 11:40:45 +03:00
|
|
|
|
use yii\helpers\Url;
|
2021-11-23 14:58:28 +03:00
|
|
|
|
use yii\widgets\ActiveForm;
|
|
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
|
/* @var $model backend\modules\project\models\ProjectUser */
|
|
|
|
|
/* @var $form yii\widgets\ActiveForm */
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<div class="project-user-form">
|
|
|
|
|
|
|
|
|
|
<?php $form = ActiveForm::begin(); ?>
|
|
|
|
|
|
2023-01-23 11:40:45 +03:00
|
|
|
|
<?= $form->field($model, 'project_id')->dropDownList(
|
|
|
|
|
Project::find()->select(['name', 'id'])->indexBy('id')->column(),
|
2021-11-23 14:58:28 +03:00
|
|
|
|
[
|
2023-01-23 11:40:45 +03:00
|
|
|
|
'id' => 'project-id',
|
|
|
|
|
'prompt' => 'Выберите'
|
2021-11-23 14:58:28 +03:00
|
|
|
|
]
|
2023-01-23 11:40:45 +03:00
|
|
|
|
);
|
|
|
|
|
?>
|
2021-11-23 14:58:28 +03:00
|
|
|
|
|
2023-01-23 11:40:45 +03:00
|
|
|
|
<?= $form->field($model, 'card_id')->widget(DepDrop::className(),
|
2021-11-23 14:58:28 +03:00
|
|
|
|
[
|
2023-01-23 11:40:45 +03:00
|
|
|
|
'options' => ['id' => 'card_id'],
|
2021-11-23 14:58:28 +03:00
|
|
|
|
'pluginOptions' => [
|
2023-01-23 11:40:45 +03:00
|
|
|
|
'depends' => ['project-id'],
|
|
|
|
|
'placeholder' => 'Выберите',
|
|
|
|
|
'url' => Url::to(['/project/project-user/users-not-on-project'])
|
|
|
|
|
,'initialize' => false,
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
'type' => DepDrop::TYPE_SELECT2,
|
|
|
|
|
'select2Options' => [
|
|
|
|
|
'hideSearch' => false,
|
|
|
|
|
'pluginOptions' => [
|
|
|
|
|
'allowClear' => true,
|
|
|
|
|
'closeOnSelect' => false,
|
|
|
|
|
'multiple' => true,
|
|
|
|
|
'hideSearch' => false
|
|
|
|
|
],
|
|
|
|
|
'showToggleAll' => false,
|
2021-11-23 14:58:28 +03:00
|
|
|
|
],
|
|
|
|
|
]
|
2023-01-23 11:40:45 +03:00
|
|
|
|
);
|
|
|
|
|
echo "<p>
|
|
|
|
|
* в списке отображаются только пользователи у которых присудствует запись в таблице user (в user_card есть id_user)
|
|
|
|
|
</p>";
|
|
|
|
|
?>
|
2021-11-23 14:58:28 +03:00
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
|
|
|
|
|
|
|
|
</div>
|