add some api method

This commit is contained in:
iIronside
2022-01-11 13:37:30 +03:00
parent aaf4ee9f53
commit 13a9bdcca0
12 changed files with 656 additions and 10 deletions

View File

@ -144,8 +144,11 @@ class DocumentController extends Controller
public function actionCreateDocument($id)
{
$documentService = new DocumentService($id);
$documentService->setFields();
$documentService->downloadDocument();
if(!empty($this->findModel($id)->template->template_file_name)){
$documentService = new DocumentService($id);
$documentService->setFields();
$documentService->downloadDocument();
}
return $this->redirect(['view', 'id' => $id]);
}
}

View File

@ -97,7 +97,10 @@ class DocumentFieldValueController extends Controller
$documentFieldValues = [];
if (empty($fieldsIdTitleList)) {
$documentFieldValues = [new DocumentFieldValue()];
return $this->redirect([
'document/view',
'id' => $document_id,
]);
}
else {
foreach ($fieldsIdTitleList as $fieldsIdTitle){