add column document_type to template table
This commit is contained in:
@ -17,8 +17,8 @@ class TemplateSearch extends Template
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['title', 'created_at', 'updated_at', 'template_file_name'], 'safe'],
|
||||
[['id', 'document_type'], 'integer'],
|
||||
[['title', 'document_type', 'created_at', 'updated_at', 'template_file_name'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -64,7 +64,8 @@ class TemplateSearch extends Template
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'title', $this->title])
|
||||
->andFilterWhere(['like', 'template_file_name', $this->template_file_name]);
|
||||
->andFilterWhere(['like', 'template_file_name', $this->template_file_name])
|
||||
->andFilterWhere(['like', 'document_type', $this->document_type]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use common\helpers\TemplateDocumentTypeHelper;
|
||||
use kartik\file\FileInput;
|
||||
use mihaildev\elfinder\InputFile;
|
||||
use yii\helpers\Html;
|
||||
@ -17,6 +18,13 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<?= $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' => [
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\document\models\DocumentField;
|
||||
use common\helpers\TemplateDocumentTypeHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\web\YiiAsset;
|
||||
@ -66,7 +67,12 @@ function cut_title($str)
|
||||
// 'class' => 'pull-right detail-button',
|
||||
]);
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
'attribute' => 'document_type',
|
||||
'format' => 'raw',
|
||||
'value' => TemplateDocumentTypeHelper::getDocumentType($model->document_type),
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
|
||||
|
Reference in New Issue
Block a user