mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'notifications3' into 'master'
Notifications3 See merge request Chill-Projet/chill-bundles!89
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\DataFixtures\ORM;
|
||||
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadAbstractNotificationsTrait;
|
||||
use Chill\PersonBundle\DataFixtures\ORM\LoadAccompanyingPeriod;
|
||||
|
||||
/**
|
||||
* Load notififications into database
|
||||
*/
|
||||
class LoadAccompanyingPeriodNotifications extends AbstractFixture implements DependentFixtureInterface
|
||||
{
|
||||
use LoadAbstractNotificationsTrait;
|
||||
|
||||
public $notifs = [
|
||||
[
|
||||
'message' => 'Hello !',
|
||||
'entityClass' => AccompanyingPeriod::class,
|
||||
'entityRef' => LoadAccompanyingPeriod::ACCOMPANYING_PERIOD,
|
||||
'sender' => 'center a_social',
|
||||
'addressees' => [
|
||||
'center a_social',
|
||||
'center a_administrative',
|
||||
'center a_direction',
|
||||
'multi_center'
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
public function getDependencies()
|
||||
{
|
||||
return [
|
||||
LoadAccompanyingPeriod::class,
|
||||
];
|
||||
}
|
||||
}
|
@@ -74,6 +74,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
$loader->load('services/form.yaml');
|
||||
$loader->load('services/alt_names.yaml');
|
||||
$loader->load('services/household.yaml');
|
||||
$loader->load('services/notification.yaml');
|
||||
// We can get rid of this file when the service 'chill.person.repository.person' is no more used.
|
||||
// We should use the PersonRepository service instead of a custom service name.
|
||||
$loader->load('services/repository.yaml');
|
||||
|
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
final class AccompanyingPeriodNotificationRenderer
|
||||
{
|
||||
public function supports(Notification $notification)
|
||||
{
|
||||
return $notification->getRelatedEntityClass() == AccompanyingPeriod::class;
|
||||
}
|
||||
|
||||
public function getTemplate()
|
||||
{
|
||||
return 'ChillPersonBundle:AccompanyingPeriod:showInNotification.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(Notification $notification)
|
||||
{
|
||||
return ['notification' => $notification];
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
<a href="{{ path('chill_person_accompanying_course_index', {'accompanying_period_id': notification.relatedEntityId }) }}">
|
||||
Go to Acc. period.
|
||||
</a>
|
@@ -0,0 +1,3 @@
|
||||
services:
|
||||
Chill\PersonBundle\Notification\AccompanyingPeriodNotificationRenderer:
|
||||
autowire: true
|
Reference in New Issue
Block a user