support custom fields for timesheets, customers, projects and activities (#871)

This commit is contained in:
Kevin Papst
2019-06-26 00:39:05 +02:00
committed by GitHub
parent 994c671fd8
commit d8621f0b7a
103 changed files with 2567 additions and 238 deletions

View File

@@ -0,0 +1,34 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Event;
use App\Entity\Activity;
use Symfony\Component\EventDispatcher\Event;
/**
* This event can be used, to dynamically add meta fields to activities
*/
final class ActivityMetaDefinitionEvent extends Event
{
/**
* @var Activity
*/
protected $entity;
public function __construct(Activity $entity)
{
$this->entity = $entity;
}
public function getEntity(): Activity
{
return $this->entity;
}
}

View File

@@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Request;
/**
* The ConfigureAdminMenuEvent is used for populating the administration navigation.
*/
class ConfigureAdminMenuEvent extends Event
final class ConfigureAdminMenuEvent extends Event
{
public const CONFIGURE = 'app.admin_menu_configure';

View File

@@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
/**
* The ConfigureMainMenuEvent is used for populating the main navigation.
*/
class ConfigureMainMenuEvent extends Event
final class ConfigureMainMenuEvent extends Event
{
public const CONFIGURE = 'app.main_menu_configure';

View File

@@ -0,0 +1,34 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Event;
use App\Entity\Customer;
use Symfony\Component\EventDispatcher\Event;
/**
* This event can be used, to dynamically add meta fields to customers
*/
final class CustomerMetaDefinitionEvent extends Event
{
/**
* @var Customer
*/
protected $entity;
public function __construct(Customer $entity)
{
$this->entity = $entity;
}
public function getEntity(): Customer
{
return $this->entity;
}
}

View File

@@ -13,7 +13,7 @@ use App\Entity\User;
use App\Widget\WidgetContainerInterface;
use Symfony\Component\EventDispatcher\Event;
class DashboardEvent extends Event
final class DashboardEvent extends Event
{
public const DASHBOARD = 'app.dashboard';

View File

@@ -13,9 +13,9 @@ use App\Entity\User;
use Symfony\Component\EventDispatcher\Event;
/**
* This event should be used, if a user profile is loaded and we full data including dynamic user preferences
* This event should be used, if a user profile is loaded and want to fill the dynamic user preferences
*/
class PrepareUserEvent extends Event
final class PrepareUserEvent extends Event
{
public const PREPARE = 'app.prepare_user';

View File

@@ -0,0 +1,34 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Event;
use App\Entity\Project;
use Symfony\Component\EventDispatcher\Event;
/**
* This event can be used, to dynamically add meta fields to projects
*/
final class ProjectMetaDefinitionEvent extends Event
{
/**
* @var Project
*/
protected $entity;
public function __construct(Project $entity)
{
$this->entity = $entity;
}
public function getEntity(): Project
{
return $this->entity;
}
}

View File

@@ -15,7 +15,7 @@ use Symfony\Component\EventDispatcher\Event;
/**
* This event should be used, if system configurations should be changed/added dynamically.
*/
class SystemConfigurationEvent extends Event
final class SystemConfigurationEvent extends Event
{
public const CONFIGURE = 'app.system_configuration';

View File

@@ -12,7 +12,7 @@ namespace App\Event;
use App\Entity\User;
use Symfony\Component\EventDispatcher\Event;
class ThemeEvent extends Event
final class ThemeEvent extends Event
{
public const JAVASCRIPT = 'app.theme.javascript';
public const STYLESHEET = 'app.theme.css';

View File

@@ -0,0 +1,34 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Event;
use App\Entity\Timesheet;
use Symfony\Component\EventDispatcher\Event;
/**
* This event can be used, to dynamically add meta fields to timesheets
*/
final class TimesheetMetaDefinitionEvent extends Event
{
/**
* @var Timesheet
*/
protected $entity;
public function __construct(Timesheet $entity)
{
$this->entity = $entity;
}
public function getEntity(): Timesheet
{
return $this->entity;
}
}

View File

@@ -16,7 +16,7 @@ use Symfony\Component\EventDispatcher\Event;
/**
* This event should be used, if further user preferences should added dynamically
*/
class UserPreferenceEvent extends Event
final class UserPreferenceEvent extends Event
{
public const CONFIGURE = 'app.user_preferences';