drop unnecessary tables and module
This commit is contained in:
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Document;
|
||||
use kartik\file\FileInput;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\AccompanyingDocument */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="accompanying-document-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, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'accompanying_document')->widget(FileInput::classname(), [
|
||||
'options' => ['accept' => 'text/*'],
|
||||
'pluginOptions' => [
|
||||
'allowedFileExtensions'=>['docx'],'showUpload' => true
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\AccompanyingDocumentSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="accompanying-document-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'document_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>
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\AccompanyingDocument */
|
||||
|
||||
$this->title = 'Добавить сопроводительный документ';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Accompanying Documents', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="accompanying-document-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\Document;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\document\models\AccompanyingDocumentSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Сопроводительные бумги';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="accompanying-document-index">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Добавить сопроводительный документ', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'document_id',
|
||||
'filter' => Document::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'document.title'
|
||||
],
|
||||
'title',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\AccompanyingDocument */
|
||||
|
||||
$this->title = 'Update Accompanying Document: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Accompanying Documents', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="accompanying-document-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\AccompanyingDocument */
|
||||
|
||||
$this->title = $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Accompanying Documents', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="accompanying-document-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['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',
|
||||
'document_id',
|
||||
'title',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,46 +0,0 @@
|
||||
<?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>
|
@ -1,38 +0,0 @@
|
||||
<?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>
|
@ -1,33 +0,0 @@
|
||||
<?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>
|
@ -1,18 +0,0 @@
|
||||
<?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>
|
@ -1,43 +0,0 @@
|
||||
<?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>
|
@ -1,20 +0,0 @@
|
||||
<?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>
|
@ -1,47 +0,0 @@
|
||||
<?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')
|
||||
],
|
||||
[
|
||||
'attribute' => 'document_id',
|
||||
'value' => ArrayHelper::getValue($model, 'document.title')
|
||||
],
|
||||
'value',
|
||||
],
|
||||
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,23 +0,0 @@
|
||||
<?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>
|
@ -1,31 +0,0 @@
|
||||
<?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') ?>
|
||||
|
||||
<?= $form->field($model, 'field_template') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -1,18 +0,0 @@
|
||||
<?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>
|
@ -1,38 +0,0 @@
|
||||
<?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">
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Создать новое поле', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'title',
|
||||
[
|
||||
'attribute' => 'field_template',
|
||||
'value' => function($model) {
|
||||
return '${' . $model->field_template . '}';
|
||||
},
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
@ -1,19 +0,0 @@
|
||||
<?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>
|
@ -1,40 +0,0 @@
|
||||
<?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',
|
||||
[
|
||||
'attribute' => 'field_template',
|
||||
'value' => '${' . $model->field_template . '}',
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,47 +0,0 @@
|
||||
<?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>
|
@ -1,37 +0,0 @@
|
||||
<?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>
|
@ -1,18 +0,0 @@
|
||||
<?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>
|
@ -1,88 +0,0 @@
|
||||
<?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>
|
@ -1,19 +0,0 @@
|
||||
<?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>
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\ArrayHelper;
|
||||
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">
|
||||
|
||||
<!-- --><?php // \common\models\Document::getDocumentWitchAndFieldValues(31); die?>
|
||||
|
||||
<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',
|
||||
[
|
||||
'attribute' => 'template_id',
|
||||
'value' => ArrayHelper::getValue($model,'template.title'),
|
||||
],
|
||||
[
|
||||
'attribute' => 'manager_id',
|
||||
'value' => ArrayHelper::getValue($model,'manager.userCard.fio')
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(
|
||||
'Скачать файл',
|
||||
['document/create-document', 'id' => $model->id],
|
||||
['class' => 'btn btn-primary']
|
||||
) ?>
|
||||
</p>
|
||||
|
||||
<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>
|
@ -1,45 +0,0 @@
|
||||
<?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>
|
@ -1,44 +0,0 @@
|
||||
<?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>
|
@ -1,31 +0,0 @@
|
||||
<?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>
|
@ -1,18 +0,0 @@
|
||||
<?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>
|
@ -1,41 +0,0 @@
|
||||
<?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>
|
@ -1,19 +0,0 @@
|
||||
<?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>
|
@ -1,44 +0,0 @@
|
||||
<?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>
|
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
use common\helpers\TemplateDocumentTypeHelper;
|
||||
use kartik\file\FileInput;
|
||||
use mihaildev\elfinder\InputFile;
|
||||
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([
|
||||
'options' => ['enctype'=>'multipart/form-data']]); ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'document_type')->dropDownList(
|
||||
TemplateDocumentTypeHelper::getDocumentTypeList(),
|
||||
[
|
||||
'prompt' => 'Выберите'
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?= $form->field($model, 'template')->widget(FileInput::classname(), [
|
||||
'options' => ['accept' => 'text/*'],
|
||||
'pluginOptions' => [
|
||||
'allowedFileExtensions'=>['docx'],'showUpload' => true
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
use kartik\file\FileInput;
|
||||
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([
|
||||
'options' => ['enctype'=>'multipart/form-data']]); ?>
|
||||
|
||||
<?= $form->field($model, 'template')->widget(FileInput::classname(), [
|
||||
'options' => ['accept' => 'text/*'],
|
||||
'pluginOptions' => [
|
||||
'allowedFileExtensions'=>['docx'],'showUpload' => true
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -1,24 +0,0 @@
|
||||
<?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([
|
||||
'options' => ['enctype'=>'multipart/form-data']]); ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -1,33 +0,0 @@
|
||||
<?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>
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* @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>
|
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
use common\helpers\TemplateDocumentTypeHelper;
|
||||
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',
|
||||
[
|
||||
'attribute' => 'document_type',
|
||||
// 'format' => 'raw',
|
||||
'filter' => TemplateDocumentTypeHelper::getDocumentTypeList(),
|
||||
'value' => function($model){
|
||||
return TemplateDocumentTypeHelper::getDocumentType($model->document_type);
|
||||
}
|
||||
],
|
||||
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view} {delete}',
|
||||
],
|
||||
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Template */
|
||||
|
||||
$this->title = 'Изменить шаблон: ' . cut_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';
|
||||
|
||||
function cut_title($str)
|
||||
{
|
||||
if(strlen($str) > 35){
|
||||
return mb_substr($str, 0, 25, 'UTF-8') . '...';
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
?>
|
||||
<div class="template-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,143 +0,0 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\DocumentField;
|
||||
use common\helpers\TemplateDocumentTypeHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\web\YiiAsset;
|
||||
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 = cut_title($model->title);
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Templates', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
YiiAsset::register($this);
|
||||
|
||||
function cut_title($str)
|
||||
{
|
||||
if(strlen($str) > 35){
|
||||
return mb_substr($str, 0, 35, 'UTF-8') . '...';
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="template-view">
|
||||
|
||||
<p>
|
||||
<?= Html::a('Список', ['index', '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',
|
||||
[
|
||||
'label'=>'title',
|
||||
'format'=>'raw',
|
||||
'value' => function($model){
|
||||
return $model->title . Html::a(' <i class="glyphicon glyphicon-pencil"></i>',
|
||||
Url::to(['template/update-title', 'id' => $model->id]), [
|
||||
'title' => 'update-title',
|
||||
// 'class' => 'pull-right detail-button',
|
||||
]);
|
||||
}
|
||||
],
|
||||
'created_at',
|
||||
'updated_at',
|
||||
[
|
||||
'label'=>'template_file_name',
|
||||
'format'=>'raw',
|
||||
'value' => function($model){
|
||||
return $model->template_file_name . Html::a(' <i class="glyphicon glyphicon-pencil"></i>',
|
||||
Url::to(['template/update-file', 'id' => $model->id]), [
|
||||
'title' => 'update-file',
|
||||
// 'class' => 'pull-right detail-button',
|
||||
]);
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'document_type',
|
||||
'format' => 'raw',
|
||||
'value' => TemplateDocumentTypeHelper::getDocumentType($model->document_type),
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php
|
||||
$button1 = Html::a('<i class="glyphicon glyphicon-trash"></i>', Url::to(['delete', 'id' => $model->id]), [
|
||||
'title' => 'Eliminar',
|
||||
'class' => 'pull-right detail-button',
|
||||
'data' => [
|
||||
'confirm' => '¿Realmente deseas eliminar este elemento?',
|
||||
'method' => 'post',
|
||||
]
|
||||
]);
|
||||
$button2 = Html::a('<i class="glyphicon glyphicon-pencil"></i>', Url::to(['actualizar', 'id' => $model->id]), [
|
||||
'title' => 'Actualizar',
|
||||
'class' => 'pull-right detail-button',
|
||||
]);
|
||||
?>
|
||||
|
||||
<div>
|
||||
<h2>
|
||||
<?= 'Поля шаблона:'?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $templateFieldDataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'field_id',
|
||||
'value' => 'field.title',
|
||||
],
|
||||
[
|
||||
'attribute' => 'field.field_template',
|
||||
'value' => 'field.field_template',
|
||||
],
|
||||
|
||||
[
|
||||
'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