Passed
Pull Request — developer (#17179)
by Mariusz
29:27 queued 10:21
created

Settings_Comarch_EditConfigModal_View   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 13
dl 0
loc 24
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 10 2
1
<?php
2
3
/**
4
 * Config edit view file for Settings Comarch module.
5
 *
6
 * @package   Settings.View
7
 *
8
 * @copyright YetiForce S.A.
9
 * @license   YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
10
 * @author    Mariusz Krzaczkowski <[email protected]>
11
 */
12
/**
13
 * Config edit view class for Settings Comarch module.
14
 */
15
class Settings_Comarch_EditConfigModal_View extends \App\Controller\ModalSettings
16
{
17
	/** {@inheritdoc} */
18
	protected $pageTitle = 'LBL_EDIT_CONFIG';
19
	/** {@inheritdoc} */
20
	public $modalIcon = 'fas fa-chart-bar';
21
	/** {@inheritdoc} */
22
	public $modalSize = 'modal-lg';
23
	/** {@inheritdoc} */
24
	public $successBtn = '';
25
	/** {@inheritdoc} */
26
	public $dangerBtn = 'LBL_CLOSE';
27
28
	/** {@inheritdoc} */
29
	public function process(App\Request $request)
30
	{
31
		$viewer = $this->getViewer($request);
32
		try {
33
			$connector = (new App\Integrations\Comarch($request->getInteger('record')));
34
			$viewer->assign('INFO', $connector->getInfo());
35
		} catch (\Throwable $th) {
36
			$viewer->assign('EXCEPTION', $th);
37
		}
38
		$viewer->view('EditConfigModal.tpl', $request->getModule(false));
39
	}
40
}
41