guild/backend/modules/project/views/project-user/_form.php

60 lines
1.7 KiB
PHP
Raw Normal View History

2021-11-23 14:58:28 +03:00
<?php
use backend\modules\project\models\Project;
use kartik\depdrop\DepDrop;
2021-11-23 14:58:28 +03:00
use yii\helpers\Html;
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(); ?>
<?= $form->field($model, 'project_id')->dropDownList(
2023-01-23 17:50:38 +03:00
Project::find()->select(['name', 'id'])->indexBy('id')->column(),
2021-11-23 14:58:28 +03:00
[
'id' => 'project-id',
'prompt' => 'Выберите'
2021-11-23 14:58:28 +03:00
]
);
?>
2021-11-23 14:58:28 +03:00
<?= $form->field($model, 'card_id')->widget(DepDrop::className(),
2021-11-23 14:58:28 +03:00
[
'options' => ['id' => 'card_id'],
2021-11-23 14:58:28 +03:00
'pluginOptions' => [
'depends' => ['project-id'],
'url' => Url::to(['/project/project-user/users-not-on-project'])
,'initialize' => false,
],
'type' => DepDrop::TYPE_SELECT2,
'select2Options' => [
'pluginOptions' => [
2023-01-23 17:50:38 +03:00
'placeholder' => 'Вводите фио',
'allowClear' => true,
'closeOnSelect' => false,
'multiple' => true,
],
2023-01-23 17:50:38 +03:00
'showToggleAll' => true,
2021-11-23 14:58:28 +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>