Release 2.45 (#5721)

Co-authored-by: Henning Klein <info@henningklein.de>
This commit is contained in:
Kevin Papst
2025-12-21 16:42:34 +01:00
committed by GitHub
parent 8c1ed68817
commit afb5a0bba4
67 changed files with 905 additions and 254 deletions

View File

@@ -0,0 +1,28 @@
<?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\Team;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Base event class triggered for Team manipulations.
*/
abstract class AbstractTeamEvent extends Event
{
public function __construct(private readonly Team $team)
{
}
public function getTeam(): Team
{
return $this->team;
}
}

View File

@@ -0,0 +1,17 @@
<?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;
/**
* Triggered for new team instances, which might or might not be saved.
*/
final class TeamCreateEvent extends AbstractTeamEvent
{
}

View File

@@ -0,0 +1,17 @@
<?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\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'team.created', description: 'Triggered after a team was created', payload: 'object.getTeam()')]
final class TeamCreatePostEvent extends AbstractTeamEvent
{
}

View File

@@ -0,0 +1,17 @@
<?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;
/**
* Triggered for team instances, which are just about to being saved.
*/
final class TeamCreatePreEvent extends AbstractTeamEvent
{
}

View File

@@ -0,0 +1,17 @@
<?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\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'team.deleted', description: 'Triggered after a team was deleted', payload: 'object.getTeam()')]
final class TeamDeleteEvent extends AbstractTeamEvent
{
}

View File

@@ -0,0 +1,17 @@
<?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\Webhook\Attribute\AsWebhook;
#[AsWebhook(name: 'team.updated', description: 'Triggered after a team was updated', payload: 'object.getTeam()')]
final class TeamUpdatePostEvent extends AbstractTeamEvent
{
}

View File

@@ -0,0 +1,17 @@
<?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;
/**
* Triggered for team instances, which are just about to being updated.
*/
final class TeamUpdatePreEvent extends AbstractTeamEvent
{
}

View File

@@ -29,6 +29,8 @@ class ThemeEvent extends Event
private string $content = '';
/**
* User is nullable, because theme events are triggered on anonymous pages, like "Login" or "Kiosk"
*
* @param array<string, mixed|array<mixed>> $payload
*/
public function __construct(private readonly ?User $user = null, protected array $payload = [])