add import tasks to xlsx
This commit is contained in:
79
backend/modules/task/views/task/_form-import.php
Normal file
79
backend/modules/task/views/task/_form-import.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\project\models\Project;
|
||||
use common\models\forms\TasksImportForm;
|
||||
use kartik\date\DatePicker;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model TasksImportForm*/
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
|
||||
$this->title = 'Импорт задач';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Tasks', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<div class="task-index">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'companyId')->dropDownList(\common\models\Company::find()
|
||||
->select(['name', 'id'])->indexBy('id')->column(),
|
||||
[
|
||||
'prompt' => 'Выберите'
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?= $form->field($model, 'userId')->widget(
|
||||
Select2::class,
|
||||
[
|
||||
'data' => \common\models\UserCard::getListUserWithUserId(),
|
||||
'options' => ['placeholder' => '...', 'class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'projectId')->widget(
|
||||
Select2::class,
|
||||
[
|
||||
'data' => Project::find()->select(['name', 'id'])->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => '...', 'class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'fromDate')->widget(DatePicker::class,[
|
||||
'type' => DatePicker::TYPE_COMPONENT_APPEND,
|
||||
'pluginOptions' => [
|
||||
'autoclose' => true,
|
||||
'format' => 'yyyy-mm-dd'
|
||||
]
|
||||
]);
|
||||
?>
|
||||
|
||||
|
||||
<?= $form->field($model, 'toDate')->widget(DatePicker::class,[
|
||||
'type' => DatePicker::TYPE_COMPONENT_APPEND,
|
||||
'pluginOptions' => [
|
||||
'autoclose' => true,
|
||||
'format' => 'yyyy-mm-dd'
|
||||
]
|
||||
]);
|
||||
?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Импорт', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -22,6 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать задачу', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
<?= Html::a('Импорт задач', ['import'], ['class' => 'btn btn-primary']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
|
@ -83,7 +83,7 @@ YiiAsset::register($this);
|
||||
|
||||
[
|
||||
'attribute' => 'project_user_id',
|
||||
'value' => 'user.email'
|
||||
'value' => 'user.username'
|
||||
],
|
||||
|
||||
[
|
||||
|
Reference in New Issue
Block a user