mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-03 12:39:42 +00:00
- Introduced `CommentSubjectConverter` and `CommentSubjectDisplayer` for audit conversion and display logic. - Integrated `TriggerAuditInterface` into `AccompanyingCourseCommentController` and added audit triggers for create, view, update, delete, pin, unpin, and list actions with translatable descriptions. - Added unit test `CommentSubjectConverterTest` to ensure proper behavior of the subject converter. - Enhanced French translations (`messages.fr.yml`) with audit-related labels for comment actions.
34 lines
989 B
PHP
34 lines
989 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\PersonBundle\Audit\Displayer;
|
|
|
|
use Chill\MainBundle\Audit\Subject;
|
|
use Chill\MainBundle\Audit\SubjectDisplayerInterface;
|
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
|
|
final readonly class CommentSubjectDisplayer implements SubjectDisplayerInterface
|
|
{
|
|
public function __construct(
|
|
private TranslatorInterface $translator,
|
|
) {}
|
|
|
|
public function supportsDisplay(Subject $subject, array $options = []): bool
|
|
{
|
|
return 'accompanying_period_comment' === $subject->type;
|
|
}
|
|
|
|
public function display(Subject $subject, string $format = 'html', array $options = []): string
|
|
{
|
|
return $this->translator->trans('audit.accompanying_period_comment.comment_number', ['{id}' => $subject->identifiers['id']]);
|
|
}
|
|
}
|