Passed
Push — developer ( c475b4...5772fb )
by Mariusz
69:56 queued 34:42
created

Pdf   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 5
dl 0
loc 41
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 4 1
A getModalSize() 0 4 1
A getModalIcon() 0 4 1
A process() 0 8 1
A postProcessAjax() 0 3 1
A processTplName() 0 4 1
1
<?php
2
/**
3
 * PDF view modal.
4
 *
5
 * @copyright YetiForce Sp. z o.o.
6
 * @license   YetiForce Public License 3.0 (licenses/LicenseEN.txt or yetiforce.com)
7
 * @author    Radosław Skrzypczak <[email protected]>
8
 */
9
10
namespace YF\Modules\Base\View;
11
12
/**
13
 * Pdf class.
14
 */
15
class Pdf extends \App\Controller\Modal
16
{
17
	/** {@inheritdoc} */
18
	protected function getTitle()
19
	{
20
		return \App\Language::translate('LBL_AVAILABLE_PDF_TEMPLATES', $this->request->getModule());
21
	}
22
23
	/** {@inheritdoc} */
24
	protected function getModalSize()
25
	{
26
		return 'modal-md';
27
	}
28
29
	/** {@inheritdoc} */
30
	protected function getModalIcon(): string
31
	{
32
		return 'fas fa-file-pdf';
33
	}
34
35
	/** {@inheritdoc} */
36
	public function process()
37
	{
38
		$moduleName = $this->request->getModule();
39
		$recordId = $this->request->getInteger('record');
40
		$this->viewer->assign('TEMPLATES', \App\Pdf::getTemplates($this->moduleName, $recordId));
41
		$this->viewer->assign('RECORD_ID', $recordId);
42
		$this->viewer->view($this->processTplName(), $moduleName);
43
	}
44
45
	/** {@inheritdoc} */
46
	public function postProcessAjax()
47
	{
48
	}
49
50
	/** {@inheritdoc} */
51
	public function processTplName(): string
52
	{
53
		return 'Modal/Pdf.tpl';
54
	}
55
}
56