36 lines
959 B
PHP
36 lines
959 B
PHP
<?php
|
|
|
|
|
|
class stSantanderRatyBackendActions extends autoStSantanderRatyBackendActions
|
|
{
|
|
public function validateConfig()
|
|
{
|
|
if ($this->getRequest()->getMethod() == sfRequest::POST)
|
|
{
|
|
$data = $this->getRequestParameter('config');
|
|
|
|
if (isset($data['shop_number']) && empty($data['shop_number']))
|
|
{
|
|
$this->getRequest()->setError('config{shop_number}', 'Proszę uzupełnić pole.');
|
|
}
|
|
}
|
|
|
|
return !$this->getRequest()->hasErrors();
|
|
}
|
|
|
|
protected function saveConfig()
|
|
{
|
|
$result = parent::saveConfig();
|
|
|
|
if ($this->config->get('enabled'))
|
|
{
|
|
stPaymentType::get(stSantanderRatyPaymentType::class)->getConfiguration()->enable();
|
|
}
|
|
else
|
|
{
|
|
stPaymentType::get(stSantanderRatyPaymentType::class)->getConfiguration()->disable();
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
} |