configs: overwrite via prepend, mode instead of duration_only (#715)

This commit is contained in:
Kevin Papst
2019-04-26 16:14:28 +02:00
committed by GitHub
parent f0f757cf75
commit 32f0d80729
24 changed files with 253 additions and 45 deletions

View File

@@ -9,13 +9,15 @@
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as BaseAbstractController;
use Symfony\Component\Translation\DataCollectorTranslator;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* The abstract base controller.
*/
abstract class AbstractController extends Controller
abstract class AbstractController extends BaseAbstractController implements ServiceSubscriberInterface
{
public const FLASH_SUCCESS = 'success';
public const FLASH_WARNING = 'warning';
@@ -89,4 +91,11 @@ abstract class AbstractController extends Controller
$this->addFlash($type, $message);
}
public static function getSubscribedServices()
{
return array_merge(parent::getSubscribedServices(), [
'translator' => TranslatorInterface::class
]);
}
}

View File

@@ -14,6 +14,7 @@ use App\Event\SystemConfigurationEvent;
use App\Form\Model\Configuration;
use App\Form\Model\SystemConfiguration as SystemConfigurationModel;
use App\Form\SystemConfigurationForm;
use App\Form\Type\TimesheetModeType;
use App\Repository\ConfigurationRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -199,11 +200,11 @@ class SystemConfigurationController extends AbstractController
->setSection(SystemConfigurationModel::SECTION_TIMESHEET)
->setConfiguration([
(new Configuration())
->setName('timesheet.markdown_content')
->setType(CheckboxType::class)
->setName('timesheet.mode')
->setType(TimesheetModeType::class)
->setTranslationDomain('system-configuration'),
(new Configuration())
->setName('timesheet.duration_only')
->setName('timesheet.markdown_content')
->setType(CheckboxType::class)
->setTranslationDomain('system-configuration'),
(new Configuration())

View File

@@ -69,7 +69,6 @@ class TimesheetController extends AbstractController
'showFilter' => $form->isSubmitted(),
'toolbarForm' => $form->createView(),
'showSummary' => $this->getUser()->getPreferenceValue('timesheet.daily_stats', false),
'duration_only' => $this->configuration->isDurationOnly(),
]);
}

View File

@@ -65,7 +65,6 @@ class TimesheetTeamController extends AbstractController
'query' => $query,
'showFilter' => $form->isSubmitted(),
'toolbarForm' => $form->createView(),
'duration_only' => $this->configuration->isDurationOnly(),
]);
}