support custom fields for timesheets, customers, projects and activities (#871)
This commit is contained in:
34
src/Event/ActivityMetaDefinitionEvent.php
Normal file
34
src/Event/ActivityMetaDefinitionEvent.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
34
src/Event/CustomerMetaDefinitionEvent.php
Normal file
34
src/Event/CustomerMetaDefinitionEvent.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
34
src/Event/ProjectMetaDefinitionEvent.php
Normal file
34
src/Event/ProjectMetaDefinitionEvent.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
34
src/Event/TimesheetMetaDefinitionEvent.php
Normal file
34
src/Event/TimesheetMetaDefinitionEvent.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user