<?php
 namespace Modules\Admin\Config\ClientInvoices\Compensation; class Controller extends \App\Mvc\Controller\Form\WindowAbstract { protected function getDefaultFormData($R) { $clientInvCompensationCfg = \App\Config\ClientInvoicesCompensate::getInstance(); $formData = []; $formData['cashingDocType'] = $clientInvCompensationCfg->get('cashingDocType'); $formData['cashingIdUser'] = $clientInvCompensationCfg->get('cashingIdUser'); return $formData; } protected function processFormData(Array $R, \App\MessagesCollector $msgs) { try { $clientInvCompensationCfg = \App\Config\ClientInvoicesCompensate::getAdmin(); $clientInvCompensationCfg->set('cashingDocType', $R['cashingDocType']); $clientInvCompensationCfg->set('cashingIdUser', $R['cashingIdUser']['id']); $clientInvCompensationCfg->save(); $msgs->addSuccess($this->lang['process']['messages']['success']); } catch (\App\Config\MessageException $e) { $msgs->addError(sprintf($this->lang['process']['messages']['error'],$e->getMessage())); } } }