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

62 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use backend\modules\project\models\Project;
use kartik\depdrop\DepDrop;
use yii\helpers\Html;
use yii\helpers\Url;
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(
Project::find()->select(['name', 'id'])->indexBy('id')->column(),
[
'id' => 'project-id',
'prompt' => 'Выберите'
]
);
?>
<?= $form->field($model, 'card_id')->widget(DepDrop::className(),
[
'options' => ['id' => 'card_id'],
'pluginOptions' => [
'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,
],
]
);
echo "<p>
* в списке отображаются только пользователи у которых присудствует запись в таблице user (в user_card есть id_user)
</p>";
?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>