complete document service
This commit is contained in:
@ -2,16 +2,13 @@
|
||||
|
||||
namespace backend\modules\document\controllers;
|
||||
|
||||
use backend\modules\card\models\UserCard;
|
||||
use backend\modules\document\models\DocumentTemplate;
|
||||
use common\classes\Debug;
|
||||
use kartik\mpdf\Pdf;
|
||||
use Yii;
|
||||
use backend\modules\document\models\Document;
|
||||
use backend\modules\document\models\DocumentSearch;
|
||||
use common\services\DocumentService;
|
||||
use Yii;
|
||||
use yii\filters\VerbFilter;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* DocumentController implements the CRUD actions for Document model.
|
||||
@ -70,8 +67,8 @@ class DocumentController extends Controller
|
||||
{
|
||||
$model = new Document();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->validate()) { // //$model->save(false)
|
||||
$this::generateDocumentBody($model);
|
||||
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
|
||||
DocumentService::generateDocumentBody($model);
|
||||
$model->save(false);
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
@ -142,7 +139,7 @@ class DocumentController extends Controller
|
||||
* @param integer $id
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionUpdateDocumentBody($id)
|
||||
public function actionUpdateDocumentBody($id): string
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
$model->scenario = $model::SCENARIO_UPDATE_DOCUMENT_BODY;
|
||||
@ -157,67 +154,33 @@ class DocumentController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function generateDocumentBody(Document $model)
|
||||
public function actionDownloadPdf($id): string
|
||||
{
|
||||
$templateModel = DocumentTemplate::findOne($model->template_id);
|
||||
preg_match_all('/(\${\w+})/', $templateModel->template_body,$out);
|
||||
$model = $this->findModel($id);
|
||||
$model->scenario = $model::SCENARIO_DOWNLOAD_DOCUMENT;
|
||||
|
||||
$document = $templateModel->template_body;;
|
||||
foreach ($out[0] as $field) {
|
||||
if (str_contains($document, $field)) {
|
||||
|
||||
if($field == '${contract_number}') {
|
||||
$fieldValue = 101;
|
||||
} elseif ($field == '${title}') {
|
||||
$fieldValue = $model->title;
|
||||
} elseif ($field == '${company}') {
|
||||
$fieldValue = $model->company->name;
|
||||
} elseif ($field == '${manager}') {
|
||||
$fieldValue = $model->manager->userCard->fio;
|
||||
} elseif ($field == '${contractor_company}') {
|
||||
$fieldValue = $model->company->name;
|
||||
} elseif ($field == '${contractor_manager}') {
|
||||
$fieldValue = $model->manager->userCard->fio;
|
||||
}
|
||||
} else {
|
||||
$fieldValue = $field;
|
||||
}
|
||||
$document = str_replace($field, $fieldValue, $document);
|
||||
if ($model->validate()) {
|
||||
DocumentService::downloadPdf($id);
|
||||
}
|
||||
$model->body = $document;
|
||||
|
||||
Yii::$app->session->setFlash('error', $model->getFirstError('body'));
|
||||
return $this->render('download', [
|
||||
'model' => Document::findOne($id)
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionDownloadPdf($id)
|
||||
public function actionDownloadDocx($id): string
|
||||
{
|
||||
$model = Document::findOne($id);
|
||||
$model = $this->findModel($id);
|
||||
$model->scenario = $model::SCENARIO_DOWNLOAD_DOCUMENT;
|
||||
|
||||
$pdf = new Pdf(); // or new Pdf();
|
||||
$mpdf = $pdf->api; // fetches mpdf api
|
||||
// $mpdf->SetHeader('Resume ' . $model->ti . '||Generated by ITGuild.info At: ' . date("d/m/Y")); // call methods or set any properties
|
||||
$mpdf->SetFooter('{PAGENO}');
|
||||
$mpdf->WriteHtml($model->body); // call mpdf write html
|
||||
echo $mpdf->Output("{$model->title}", 'D'); // call the mpdf api output as needed
|
||||
}
|
||||
if ($model->validate()) {
|
||||
DocumentService::downloadPdf($id);
|
||||
}
|
||||
|
||||
public function actionDownloadDocx($id)
|
||||
{
|
||||
$model = Document::findOne($id);
|
||||
|
||||
$pw = new \PhpOffice\PhpWord\PhpWord();
|
||||
|
||||
// (B) ADD HTML CONTENT
|
||||
$section = $pw->addSection();
|
||||
$resumeText = str_replace(array('<br/>', '<br>', '</br>'), ' ', $model->body);
|
||||
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $resumeText, false, false);
|
||||
|
||||
// (C) SAVE TO DOCX ON SERVER
|
||||
// $pw->save("convert.docx", "Word2007");
|
||||
|
||||
// (D) OR FORCE DOWNLOAD
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment;filename=\"$model->title.docx\"");
|
||||
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($pw, "Word2007");
|
||||
$objWriter->save("php://output");
|
||||
exit();
|
||||
Yii::$app->session->setFlash('error', $model->getFirstError('body'));
|
||||
return $this->render('download', [
|
||||
'model' => Document::findOne($id)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
127
backend/modules/document/controllers/DocumentFieldController.php
Normal file
127
backend/modules/document/controllers/DocumentFieldController.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\document\controllers;
|
||||
|
||||
use Yii;
|
||||
use backend\modules\document\models\DocumentField;
|
||||
use backend\modules\document\models\DocumentFieldSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* DocumentFieldController implements the CRUD actions for DocumentField model.
|
||||
*/
|
||||
class DocumentFieldController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all DocumentField models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new DocumentFieldSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single DocumentField model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new DocumentField model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new DocumentField();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing DocumentField model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing DocumentField model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the DocumentField model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return DocumentField the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = DocumentField::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
8
backend/modules/document/models/DocumentField.php
Normal file
8
backend/modules/document/models/DocumentField.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\document\models;
|
||||
|
||||
class DocumentField extends \common\models\DocumentField
|
||||
{
|
||||
|
||||
}
|
69
backend/modules/document/models/DocumentFieldSearch.php
Normal file
69
backend/modules/document/models/DocumentFieldSearch.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\document\models;
|
||||
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use backend\modules\document\models\DocumentField;
|
||||
|
||||
/**
|
||||
* DocumentFieldSearch represents the model behind the search form of `backend\modules\document\models\DocumentField`.
|
||||
*/
|
||||
class DocumentFieldSearch extends DocumentField
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['title', 'field_template'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = DocumentField::find();
|
||||
|
||||
// add conditions that should always apply here
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
// grid filtering conditions
|
||||
$query->andFilterWhere([
|
||||
'id' => $this->id,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'title', $this->title])
|
||||
->andFilterWhere(['like', 'field_template', $this->field_template]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
25
backend/modules/document/views/document-field/_form.php
Normal file
25
backend/modules/document/views/document-field/_form.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?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]) ?>
|
||||
|
||||
<?= $form->field($model, 'field_template')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
31
backend/modules/document/views/document-field/_search.php
Normal file
31
backend/modules/document/views/document-field/_search.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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>
|
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>
|
31
backend/modules/document/views/document-field/index.php
Normal file
31
backend/modules/document/views/document-field/index.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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',
|
||||
'field_template',
|
||||
|
||||
['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>
|
37
backend/modules/document/views/document-field/view.php
Normal file
37
backend/modules/document/views/document-field/view.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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',
|
||||
'field_template',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use asmoday74\ckeditor5\EditorClassic;
|
||||
use backend\modules\document\models\DocumentField;
|
||||
use common\helpers\StatusHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
@ -31,14 +32,6 @@ use yii\widgets\ActiveForm;
|
||||
]
|
||||
]); ?>
|
||||
|
||||
<!-- composer require --prefer-dist stkevich/yii2-ckeditor5 "*"-->
|
||||
<!-- --><?//= $form->field($model, 'text')->widget(CKEditor::className(),[
|
||||
// 'editorOptions' => [ TODO
|
||||
// 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать
|
||||
// 'inline' => false, //по умолчанию false
|
||||
// ],
|
||||
// ]); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
@ -47,14 +40,7 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ['Акт', $time],-->
|
||||
<!-- ['Акт сверки', $time],-->
|
||||
<!-- ['Детализация', $time],-->
|
||||
<!-- ['Доверенность', $time],-->
|
||||
<!-- ['Договор', $time],-->
|
||||
<!-- ['Доп соглашение к договору', $time],-->
|
||||
<!-- ['Транспортная накладная', $time],-->
|
||||
<!-- ['Ценовой лист', $time],-->
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="fieldNameTable">
|
||||
@ -65,63 +51,17 @@ use yii\widgets\ActiveForm;
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="info">
|
||||
<td class="table-cell">№ договора</td>
|
||||
<td class="table-cell">${contract_number}</td>
|
||||
</tr>
|
||||
<tr class="info">
|
||||
<td class="table-cell">Название</td>
|
||||
<td class="table-cell">${title}</td>
|
||||
</tr>
|
||||
<tr class="info">
|
||||
<td class="table-cell">Компания</td>
|
||||
<td class="table-cell">${company}</td>
|
||||
</tr>
|
||||
<tr class="info">
|
||||
<td class="table-cell">Представитель</td>
|
||||
<td class="table-cell">${manager}</td>
|
||||
</tr>
|
||||
<tr class="info">
|
||||
<td class="table-cell">Компания контрагент</td>
|
||||
<td class="table-cell">${contractor_company}</td>
|
||||
</tr>
|
||||
<tr class="info">
|
||||
<td class="table-cell">Представитель контрагента</td>
|
||||
<td class="table-cell">${contractor_manager}</td>
|
||||
</tr>
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell"></td>-->
|
||||
<!-- <td class="table-cell"></td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">№ документа</td>-->
|
||||
<!-- <td class="table-cell">${document_number}</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">от </td>-->
|
||||
<!-- <td class="table-cell">${from}</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">сумма с НДС</td>-->
|
||||
<!-- <td class="table-cell">${sum_with_NDS}</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">НДС</td>-->
|
||||
<!-- <td class="table-cell">${NDS}</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">цена</td>-->
|
||||
<!-- <td class="table-cell">${price}</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">к договору</td>-->
|
||||
<!-- <td class="table-cell">${to_the_contract}</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr class="info">-->
|
||||
<!-- <td class="table-cell">№</td>-->
|
||||
<!-- <td class="table-cell">${number}</td>-->
|
||||
<!-- </tr>-->
|
||||
|
||||
<?php
|
||||
foreach (DocumentField::getTitleFieldTemplateArr() as $fieldTitle => $fieldTemplate) {
|
||||
echo "
|
||||
<tr class='info'>
|
||||
<td class='table-cell'>$fieldTitle</td>
|
||||
<td class='table-cell'>$fieldTemplate</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
use asmoday74\ckeditor5\EditorClassic;
|
||||
//use backend\modules\card\models\ResumeTemplate;
|
||||
use common\helpers\StatusHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\document\models\Document */
|
||||
|
||||
@ -19,9 +18,7 @@ $this->params['breadcrumbs'][] = 'Загрузить';
|
||||
<div class="form-group">
|
||||
<?= Html::a('Редактировать документ', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Просмотр документа', ['view', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div
|
||||
|
||||
<div class="resume-form">
|
||||
|
||||
@ -42,11 +39,10 @@ $this->params['breadcrumbs'][] = 'Загрузить';
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
<?= Html::a('Скачать pdf', ['download-pdf', 'id' => $model->id], ['class' => 'btn btn-success']) ?>
|
||||
<?= Html::a('Скачать docx', ['download-docx', 'id' => $model->id], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
<div>
|
||||
<p>
|
||||
<?= Html::a('Скачать pdf', ['download-pdf', 'id' => $model->id], ['class' => 'btn btn-success']) ?>
|
||||
<?= Html::a('Скачать docx', ['download-docx', 'id' => $model->id], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use common\classes\Debug;
|
||||
use common\models\Document;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
@ -53,7 +55,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'attribute' => 'body',
|
||||
'format' => 'raw',
|
||||
],
|
||||
// 'body:ntext',
|
||||
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
|
Reference in New Issue
Block a user