updated theme, fix deprecations in events dispatching (#1145)
This commit is contained in:
@@ -88,7 +88,7 @@ class DashboardController extends AbstractController
|
||||
$event->addSection($row);
|
||||
}
|
||||
|
||||
$this->eventDispatcher->dispatch($event, DashboardEvent::DASHBOARD);
|
||||
$this->eventDispatcher->dispatch($event);
|
||||
|
||||
$sections = $event->getSections();
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ class ProfileController extends AbstractController
|
||||
{
|
||||
// we need to prepare the user preferences, which is done via an EventSubscriber
|
||||
$event = new PrepareUserEvent($profile);
|
||||
$this->dispatcher->dispatch($event, PrepareUserEvent::PREPARE);
|
||||
$this->dispatcher->dispatch($event);
|
||||
|
||||
$original = [];
|
||||
foreach ($profile->getPreferences() as $preference) {
|
||||
@@ -303,7 +303,7 @@ class ProfileController extends AbstractController
|
||||
{
|
||||
// we need to prepare the user preferences, which is done via an EventSubscriber
|
||||
$event = new PrepareUserEvent($user);
|
||||
$this->dispatcher->dispatch($event, PrepareUserEvent::PREPARE);
|
||||
$this->dispatcher->dispatch($event);
|
||||
|
||||
return $this->createForm(
|
||||
UserPreferencesForm::class,
|
||||
|
||||
@@ -169,7 +169,7 @@ class SystemConfigurationController extends AbstractController
|
||||
$types = $this->getConfigurationTypes();
|
||||
|
||||
$event = new SystemConfigurationEvent($types);
|
||||
$this->eventDispatcher->dispatch($event, SystemConfigurationEvent::CONFIGURE);
|
||||
$this->eventDispatcher->dispatch($event);
|
||||
|
||||
foreach ($event->getConfigurations() as $configs) {
|
||||
foreach ($configs->getConfiguration() as $config) {
|
||||
|
||||
@@ -19,7 +19,10 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
*/
|
||||
final class ConfigureMainMenuEvent extends Event
|
||||
{
|
||||
public const CONFIGURE = 'app.main_menu_configure';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const CONFIGURE = ConfigureMainMenuEvent::class;
|
||||
|
||||
/**
|
||||
* @var Request
|
||||
|
||||
@@ -15,7 +15,10 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
final class DashboardEvent extends Event
|
||||
{
|
||||
public const DASHBOARD = 'app.dashboard';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const DASHBOARD = DashboardEvent::class;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
|
||||
@@ -17,7 +17,10 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
*/
|
||||
final class PrepareUserEvent extends Event
|
||||
{
|
||||
public const PREPARE = 'app.prepare_user';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const PREPARE = PrepareUserEvent::class;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
|
||||
@@ -17,7 +17,10 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
*/
|
||||
final class SystemConfigurationEvent extends Event
|
||||
{
|
||||
public const CONFIGURE = 'app.system_configuration';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const CONFIGURE = SystemConfigurationEvent::class;
|
||||
|
||||
/**
|
||||
* @var SystemConfiguration[]
|
||||
|
||||
@@ -18,7 +18,10 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
*/
|
||||
final class UserPreferenceEvent extends Event
|
||||
{
|
||||
public const CONFIGURE = 'app.user_preferences';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const CONFIGURE = UserPreferenceEvent::class;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace App\EventSubscriber;
|
||||
|
||||
use App\Event\ConfigureMainMenuEvent;
|
||||
use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent;
|
||||
use KevinPapst\AdminLTEBundle\Event\ThemeEvents;
|
||||
use KevinPapst\AdminLTEBundle\Model\MenuItemModel;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
@@ -48,7 +47,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
ThemeEvents::THEME_SIDEBAR_SETUP_MENU => ['onSetupNavbar', 100],
|
||||
SidebarMenuEvent::class => ['onSetupNavbar', 100],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -72,7 +71,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
||||
new MenuItemModel('system', 'menu.system', '')
|
||||
);
|
||||
|
||||
$this->eventDispatcher->dispatch($menuEvent, ConfigureMainMenuEvent::CONFIGURE);
|
||||
$this->eventDispatcher->dispatch($menuEvent);
|
||||
|
||||
if ($menuEvent->getAdminMenu()->hasChildren()) {
|
||||
$event->addItem(new MenuItemModel('admin', 'menu.admin', ''));
|
||||
|
||||
@@ -163,7 +163,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
$event = new UserPreferenceEvent($user, $this->getDefaultPreferences($user));
|
||||
$this->eventDispatcher->dispatch($event, UserPreferenceEvent::CONFIGURE);
|
||||
$this->eventDispatcher->dispatch($event);
|
||||
|
||||
foreach ($event->getPreferences() as $preference) {
|
||||
/* @var UserPreference[] $prefs */
|
||||
|
||||
@@ -62,7 +62,7 @@ class UserProfileSubscriber implements EventSubscriberInterface
|
||||
$user = $this->storage->getToken()->getUser();
|
||||
|
||||
$event = new PrepareUserEvent($user);
|
||||
$this->eventDispatcher->dispatch($event, PrepareUserEvent::PREPARE);
|
||||
$this->eventDispatcher->dispatch($event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -750,7 +750,7 @@ class TimesheetRepository extends EntityRepository
|
||||
->orderBy('t.end', 'DESC')
|
||||
;
|
||||
|
||||
return $this->getHydratedResultsByQuery($qb, false);
|
||||
return $this->getHydratedResultsByQuery($qb, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user