the document module is finished
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Document;
|
||||
use common\models\DocumentField;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentFieldValue */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-field-value-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'document_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => Document::find()->select(['title', 'id'])
|
||||
->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите документ','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'field_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => DocumentField::find()->select(['title', 'id'])
|
||||
->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите поле','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'value')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Document;
|
||||
use common\models\DocumentField;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $documentFieldValues backend\modules\document\models\DocumentFieldValue[] */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-field-value-form">
|
||||
|
||||
<h2>
|
||||
Заполнение полей документа: <?php echo(ArrayHelper::getValue($documentFieldValues[0], 'document.title')); ?>
|
||||
</h2>
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?php foreach ($documentFieldValues as $index => $documentFieldValue) { ?>
|
||||
|
||||
<?= $form->field($documentFieldValue, "[$index]value")
|
||||
->textInput(['maxlength' => true])
|
||||
->label(ArrayHelper::getValue($documentFieldValue,'field.title')
|
||||
) ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentFieldValueSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-field-value-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'field_id') ?>
|
||||
|
||||
<?= $form->field($model, 'document_id') ?>
|
||||
|
||||
<?= $form->field($model, 'value') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentFieldValue */
|
||||
|
||||
$this->title = 'Заполнить значение поля документа';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Document Field Values', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="document-field-value-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
|
||||
use backend\modules\document\models\Document;
|
||||
use common\models\DocumentField;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\document\models\DocumentFieldValueSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Значение полей документа';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="document-field-value-index">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Установить значение значение ', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'filter' => DocumentField::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'field.title'
|
||||
],
|
||||
[
|
||||
'attribute' => 'document_id',
|
||||
'filter' => Document::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'document.title'
|
||||
],
|
||||
'attribute' => 'value',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentFieldValue */
|
||||
|
||||
$this->title = 'Изменение значения поля документа';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Document Field Values', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="document-field-value-update">
|
||||
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
47
backend/modules/document/views/document-field-value/view.php
Normal file
47
backend/modules/document/views/document-field-value/view.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentFieldValue */
|
||||
|
||||
$this->title = $model->value;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Document Field Values', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="document-field-value-view">
|
||||
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'value' => ArrayHelper::getValue($model, 'field.title') // AnswerHelper::answerFlagLabel($model->answer_flag),
|
||||
],
|
||||
[
|
||||
'attribute' => 'document_id',
|
||||
'value' => ArrayHelper::getValue($model, 'document.title') // AnswerHelper::answerFlagLabel($model->answer_flag),
|
||||
],
|
||||
'value',
|
||||
],
|
||||
|
||||
]) ?>
|
||||
|
||||
</div>
|
23
backend/modules/document/views/document-field/_form.php
Normal file
23
backend/modules/document/views/document-field/_form.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentField */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-field-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
29
backend/modules/document/views/document-field/_search.php
Normal file
29
backend/modules/document/views/document-field/_search.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentFieldSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-field-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'title') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
18
backend/modules/document/views/document-field/create.php
Normal file
18
backend/modules/document/views/document-field/create.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentField */
|
||||
|
||||
$this->title = 'Создание поля документа';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Document Fields', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="document-field-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
30
backend/modules/document/views/document-field/index.php
Normal file
30
backend/modules/document/views/document-field/index.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\document\models\DocumentFieldSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Поля документов';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="document-field-index">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать поле документа', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'title',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
19
backend/modules/document/views/document-field/update.php
Normal file
19
backend/modules/document/views/document-field/update.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentField */
|
||||
|
||||
$this->title = 'Изменение поля документа. Поле: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Document Fields', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="document-field-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
36
backend/modules/document/views/document-field/view.php
Normal file
36
backend/modules/document/views/document-field/view.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentField */
|
||||
|
||||
$this->title = $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Document Fields', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="document-field-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'title',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
47
backend/modules/document/views/document/_form.php
Normal file
47
backend/modules/document/views/document/_form.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Template;
|
||||
use backend\modules\employee\models\Manager;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Document */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'manager_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => Manager::find()->select(['user_card.fio', 'manager.id'])
|
||||
->joinWith('userCard')
|
||||
->indexBy('manager.id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите менеджера','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'template_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => Template::find()->select(['title', 'id'])
|
||||
->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите шаблон','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
37
backend/modules/document/views/document/_search.php
Normal file
37
backend/modules/document/views/document/_search.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\DocumentSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="document-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'title') ?>
|
||||
|
||||
<?= $form->field($model, 'created_at') ?>
|
||||
|
||||
<?= $form->field($model, 'updated_at') ?>
|
||||
|
||||
<?= $form->field($model, 'template_id') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'manager_id') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
18
backend/modules/document/views/document/create.php
Normal file
18
backend/modules/document/views/document/create.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Document */
|
||||
|
||||
$this->title = 'Создать документ';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Documents', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="document-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
88
backend/modules/document/views/document/index.php
Normal file
88
backend/modules/document/views/document/index.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Document;
|
||||
use backend\modules\document\models\Template;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\document\models\DocumentSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Документы';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="document-index">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать документ', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'title',
|
||||
'filter' => Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'title',
|
||||
'data' => Document::find()
|
||||
->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'width' => '150px',
|
||||
],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'Выберите значение'
|
||||
],
|
||||
]),
|
||||
'value' => 'title',
|
||||
],
|
||||
[
|
||||
'attribute' => 'template_id',
|
||||
'filter' => Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'template_id',
|
||||
'data' => Template::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'width' => '150px',
|
||||
],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'Выберите значение'
|
||||
],
|
||||
]),
|
||||
'value' => 'template.title'
|
||||
],
|
||||
[
|
||||
'attribute' => 'manager_id',
|
||||
'filter' => Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'manager_id',
|
||||
'data' => Document::find()
|
||||
->joinWith(['manager', 'manager.userCard'])
|
||||
->select(['user_card.fio', 'manager.id'])->indexBy('id')->column(),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'width' => '150px',
|
||||
],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'Выберите значение'
|
||||
],
|
||||
]),
|
||||
'value' => 'manager.userCard.fio',
|
||||
],
|
||||
'created_at',
|
||||
'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
19
backend/modules/document/views/document/update.php
Normal file
19
backend/modules/document/views/document/update.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Document */
|
||||
|
||||
$this->title = 'Изменить Документ: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Documents', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="document-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
94
backend/modules/document/views/document/view.php
Normal file
94
backend/modules/document/views/document/view.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Document */
|
||||
/* @var $documentFieldValuesDataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Документ: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Documents', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="document-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'title',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'template_id',
|
||||
'manager_id',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<div>
|
||||
<h2>
|
||||
<?= 'Поля документа:'?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $documentFieldValuesDataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'value' => 'field.title'
|
||||
],
|
||||
'attribute' => 'value',
|
||||
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view} {update} {delete}',
|
||||
'controller' => 'document-field-value',
|
||||
'buttons' => [
|
||||
|
||||
'update' => function ($url,$model) {
|
||||
return Html::a(
|
||||
'<span class="glyphicon glyphicon-pencil"></span>',
|
||||
['document-field-value/update', 'id' => $model['id'], 'document_id' => $model['document_id']]);
|
||||
},
|
||||
'delete' => function ($url,$model) {
|
||||
return Html::a(
|
||||
'<span class="glyphicon glyphicon-trash"></span>',
|
||||
[
|
||||
'document-field-value/delete', 'id' => $model['id'], 'document_id' => $model['document_id']
|
||||
],
|
||||
[
|
||||
'data' => ['confirm' => 'Вы уверены, что хотите удалить этот вопрос?', 'method' => 'post']
|
||||
]
|
||||
);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(
|
||||
'Добавить поле',
|
||||
['document-field-value/create', 'document_id' => $model->id],
|
||||
['class' => 'btn btn-primary']
|
||||
) ?>
|
||||
</p>
|
||||
|
||||
</div>
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Template;
|
||||
use common\models\DocumentField;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateDocumentField */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="template-document-field-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'template_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => Template::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите шаблон','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => false
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'field_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => DocumentField::find()->select(['title', 'document_field.id'])
|
||||
->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите поле','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => false,
|
||||
'multiple' => true,
|
||||
'closeOnSelect' => false
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Template;
|
||||
use common\models\DocumentField;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateDocumentField */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="template-document-field-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'template_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => Template::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите шаблон','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => false
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'field_id')->widget(Select2::className(),
|
||||
[
|
||||
'data' => DocumentField::find()->select(['title', 'document_field.id'])
|
||||
->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите поле','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => false,
|
||||
'closeOnSelect' => false
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateDocumentFieldSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="template-document-field-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'template_id') ?>
|
||||
|
||||
<?= $form->field($model, 'field_id') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateDocumentField */
|
||||
|
||||
$this->title = 'Добавить в шаблон поле';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Template Document Fields', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="template-document-field-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\DocumentField;
|
||||
use backend\modules\document\models\Template;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\document\models\TemplateDocumentFieldSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Поля шаблона документа';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="template-document-field-index">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Добавить поле в шаблон', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'template_id',
|
||||
'filter' => Template::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'template.title',
|
||||
],
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'filter' => DocumentField::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'field.title',
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateDocumentField */
|
||||
|
||||
$this->title = 'Изменить поле документа';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Template Document Fields', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="template-document-field-update">
|
||||
|
||||
<?= $this->render('_form_update', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateDocumentField */
|
||||
|
||||
$this->title = 'Поле шаблона';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Template Document Fields', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="template-document-field-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
[
|
||||
'attribute' => 'template_id',
|
||||
'value' => ArrayHelper::getValue($model, 'template.title'),
|
||||
],
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'value' => ArrayHelper::getValue($model, 'field.title'),
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
23
backend/modules/document/views/template/_form.php
Normal file
23
backend/modules/document/views/template/_form.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Template */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="template-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
33
backend/modules/document/views/template/_search.php
Normal file
33
backend/modules/document/views/template/_search.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\TemplateSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="template-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'title') ?>
|
||||
|
||||
<?= $form->field($model, 'created_at') ?>
|
||||
|
||||
<?= $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
18
backend/modules/document/views/template/create.php
Normal file
18
backend/modules/document/views/template/create.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Template */
|
||||
|
||||
$this->title = 'Создать шаблон';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Templates', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="template-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
32
backend/modules/document/views/template/index.php
Normal file
32
backend/modules/document/views/template/index.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\document\models\TemplateSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Шаблоны';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="template-index">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать шаблон', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'title',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
19
backend/modules/document/views/template/update.php
Normal file
19
backend/modules/document/views/template/update.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Template */
|
||||
|
||||
$this->title = 'Изменить шаблон: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Templates', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="template-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
87
backend/modules/document/views/template/view.php
Normal file
87
backend/modules/document/views/template/view.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\DocumentField;
|
||||
use backend\modules\document\models\Template;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $templateFieldDataProvider yii\data\ActiveDataProvider */
|
||||
/* @var $model backend\modules\document\models\Template */
|
||||
|
||||
$this->title = $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Templates', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="template-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'title',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<div>
|
||||
<h2>
|
||||
<?= 'Поля шаблона:'?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $templateFieldDataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'filter' => DocumentField::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'field.title',
|
||||
],
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}{delete}',
|
||||
'controller' => 'template-document-field',
|
||||
'buttons' => [
|
||||
'delete' => function ($url,$model) {
|
||||
return Html::a(
|
||||
'<span class="glyphicon glyphicon-trash"></span>',
|
||||
[
|
||||
'template-document-field/delete', 'id' => $model['id'], 'template_id' => $model['template_id']
|
||||
],
|
||||
[
|
||||
'data' => ['confirm' => 'Вы уверены, что хотите удалить этот вопрос?', 'method' => 'post']
|
||||
]
|
||||
);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(
|
||||
'Добавить поле',
|
||||
['template-document-field/create', 'template_id' => $model->id],
|
||||
['class' => 'btn btn-primary']
|
||||
) ?>
|
||||
</p>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user