mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 00:24:59 +00:00
Compare commits
3 Commits
issue444_m
...
issue443_l
Author | SHA1 | Date | |
---|---|---|---|
58de9f9bf3 | |||
b32ecf98f2 | |||
d47fdc768e |
@@ -15,13 +15,19 @@ use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
|||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class PersonMenuBuilder implements LocalMenuBuilderInterface
|
class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
protected $authorizationChecker;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AuthorizationCheckerInterface $authorizationChecker,
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
|
@@ -109,9 +109,11 @@
|
|||||||
{{ 'Cancel'|trans }}
|
{{ 'Cancel'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(edit_form) }}
|
{{ form_end(edit_form) }}
|
||||||
|
@@ -16,17 +16,29 @@ use Chill\TaskBundle\Templating\UI\CountNotificationTask;
|
|||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
public AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
public $authorizationChecker;
|
||||||
|
|
||||||
public CountNotificationTask $counter;
|
/**
|
||||||
|
* @var CountNotificationTask
|
||||||
|
*/
|
||||||
|
public $counter;
|
||||||
|
|
||||||
public TokenStorageInterface $tokenStorage;
|
/**
|
||||||
|
* @var TokenStorageInterface
|
||||||
|
*/
|
||||||
|
public $tokenStorage;
|
||||||
|
|
||||||
public TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
public $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CountNotificationTask $counter,
|
CountNotificationTask $counter,
|
||||||
|
@@ -14,18 +14,14 @@ namespace Chill\CalendarBundle\Menu;
|
|||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected AuthorizationHelper $authorizationHelper;
|
protected AuthorizationHelper $authorizationHelper;
|
||||||
|
|
||||||
protected Security $security;
|
|
||||||
|
|
||||||
protected TokenStorageInterface $tokenStorage;
|
protected TokenStorageInterface $tokenStorage;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
protected TranslatorInterface $translator;
|
||||||
@@ -33,13 +29,11 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
TokenStorageInterface $tokenStorage,
|
TokenStorageInterface $tokenStorage,
|
||||||
AuthorizationHelper $authorizationHelper,
|
AuthorizationHelper $authorizationHelper,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator
|
||||||
Security $security
|
|
||||||
) {
|
) {
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->authorizationHelper = $authorizationHelper;
|
$this->authorizationHelper = $authorizationHelper;
|
||||||
$this->tokenStorage = $tokenStorage;
|
$this->tokenStorage = $tokenStorage;
|
||||||
$this->security = $security;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
@@ -47,7 +41,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
|
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
|
||||||
if ($this->security->isGranted(AccompanyingPeriodVoter::SEE, $period)) {
|
|
||||||
$menu->addChild($this->translator->trans('Calendar'), [
|
$menu->addChild($this->translator->trans('Calendar'), [
|
||||||
'route' => 'chill_calendar_calendar_list',
|
'route' => 'chill_calendar_calendar_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@@ -56,7 +49,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setExtras(['order' => 35]);
|
->setExtras(['order' => 35]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
|
@@ -41,9 +41,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', document) and document.course != null %}
|
||||||
<li>
|
<li>
|
||||||
{{ m.download_button(document.object, document.title) }}
|
{{ m.download_button(document.object, document.title) }}
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
||||||
<li>
|
<li>
|
||||||
{% if chill_document_is_editable(document.object) %}
|
{% if chill_document_is_editable(document.object) %}
|
||||||
{% if not freezed %}
|
{% if not freezed %}
|
||||||
@@ -54,11 +57,12 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', document) and document.course != null %}
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', document) and document.course != null %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('accompanying_course_document_show', {'course': document.course.id, 'id': document.id}) }}" class="btn btn-show"></a>
|
<a href="{{ chill_path_add_return_path('accompanying_course_document_show', {'course': document.course.id, 'id': document.id}) }}" class="btn btn-show"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -25,9 +25,11 @@
|
|||||||
{{ 'Back to the list' | trans }}
|
{{ 'Back to the list' | trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
||||||
<li class="edit">
|
<li class="edit">
|
||||||
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
|
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -42,9 +42,11 @@
|
|||||||
{{ 'Back to the list' | trans }}
|
{{ 'Back to the list' | trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %}
|
||||||
<li class="edit">
|
<li class="edit">
|
||||||
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
|
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{# {% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
|
{# {% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
|
||||||
<li class="delete">
|
<li class="delete">
|
||||||
{{ include('ChillDocStoreBundle:PersonDocument:_delete_form.html.twig') }}
|
{{ include('ChillDocStoreBundle:PersonDocument:_delete_form.html.twig') }}
|
||||||
|
@@ -46,9 +46,11 @@
|
|||||||
{{ 'Back to the list' | trans }}
|
{{ 'Back to the list' | trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted ('CHILL_PERSON_DOCUMENT_CREATE', person) %}
|
||||||
<li class="create">
|
<li class="create">
|
||||||
<button class="btn btn-create">{{ 'Create'|trans }}</button>
|
<button class="btn btn-create">{{ 'Create'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -15,13 +15,19 @@ use Chill\AMLI\FamilyMembersBundle\Security\Voter\FamilyMemberVoter;
|
|||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
protected $authorizationChecker;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AuthorizationCheckerInterface $authorizationChecker,
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
|
@@ -12,23 +12,11 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Routing\MenuBuilder;
|
namespace Chill\MainBundle\Routing\MenuBuilder;
|
||||||
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
|
||||||
|
|
||||||
class LocationMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
class LocationMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
private AuthorizationCheckerInterface $authorizationChecker;
|
|
||||||
|
|
||||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
|
||||||
{
|
|
||||||
$this->authorizationChecker = $authorizationChecker;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$menu->addChild('Location type list', [
|
$menu->addChild('Location type list', [
|
||||||
'route' => 'chill_crud_main_location_type_index',
|
'route' => 'chill_crud_main_location_type_index',
|
||||||
])->setExtras(['order' => 205]);
|
])->setExtras(['order' => 205]);
|
||||||
|
@@ -12,23 +12,11 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Routing\MenuBuilder;
|
namespace Chill\MainBundle\Routing\MenuBuilder;
|
||||||
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
|
||||||
|
|
||||||
class PermissionMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
class PermissionMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
private AuthorizationCheckerInterface $authorizationChecker;
|
|
||||||
|
|
||||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
|
||||||
{
|
|
||||||
$this->authorizationChecker = $authorizationChecker;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$menu->addChild('Permissions group list', [
|
$menu->addChild('Permissions group list', [
|
||||||
'route' => 'admin_permissionsgroup',
|
'route' => 'admin_permissionsgroup',
|
||||||
])->setExtras([
|
])->setExtras([
|
||||||
|
@@ -15,16 +15,22 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
|||||||
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SectionMenuBuilder.
|
* Class SectionMenuBuilder.
|
||||||
*/
|
*/
|
||||||
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
protected $authorizationChecker;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SectionMenuBuilder constructor.
|
* SectionMenuBuilder constructor.
|
||||||
@@ -40,7 +46,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
*/
|
*/
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if (!$this->authorizationChecker->isGranted('ROLE_USER')) {
|
|
||||||
$menu->addChild($this->translator->trans('Homepage'), [
|
$menu->addChild($this->translator->trans('Homepage'), [
|
||||||
'route' => 'chill_main_homepage',
|
'route' => 'chill_main_homepage',
|
||||||
])
|
])
|
||||||
@@ -57,7 +62,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'order' => 10,
|
'order' => 10,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(ChillExportVoter::EXPORT)) {
|
if ($this->authorizationChecker->isGranted(ChillExportVoter::EXPORT)) {
|
||||||
$menu->addChild($this->translator->trans('Export Menu'), [
|
$menu->addChild($this->translator->trans('Export Menu'), [
|
||||||
|
@@ -15,14 +15,11 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use Chill\MainBundle\Notification\Counter\NotificationByUserCounter;
|
use Chill\MainBundle\Notification\Counter\NotificationByUserCounter;
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
private AuthorizationCheckerInterface $authorizationChecker;
|
|
||||||
|
|
||||||
private NotificationByUserCounter $notificationByUserCounter;
|
private NotificationByUserCounter $notificationByUserCounter;
|
||||||
|
|
||||||
private Security $security;
|
private Security $security;
|
||||||
@@ -35,22 +32,16 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
NotificationByUserCounter $notificationByUserCounter,
|
NotificationByUserCounter $notificationByUserCounter,
|
||||||
WorkflowByUserCounter $workflowByUserCounter,
|
WorkflowByUserCounter $workflowByUserCounter,
|
||||||
Security $security,
|
Security $security,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator
|
||||||
AuthorizationCheckerInterface $authorizationChecker
|
|
||||||
) {
|
) {
|
||||||
$this->notificationByUserCounter = $notificationByUserCounter;
|
$this->notificationByUserCounter = $notificationByUserCounter;
|
||||||
$this->workflowByUserCounter = $workflowByUserCounter;
|
$this->workflowByUserCounter = $workflowByUserCounter;
|
||||||
$this->security = $security;
|
$this->security = $security;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->authorizationChecker = $authorizationChecker;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if (!$this->authorizationChecker->isGranted('ROLE_USER')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->security->getUser();
|
$user = $this->security->getUser();
|
||||||
|
|
||||||
if ($user instanceof User) {
|
if ($user instanceof User) {
|
||||||
|
@@ -19,7 +19,6 @@ use Chill\PersonBundle\Entity\Person;
|
|||||||
use Chill\PersonBundle\Form\HouseholdMemberType;
|
use Chill\PersonBundle\Form\HouseholdMemberType;
|
||||||
use Chill\PersonBundle\Household\MembersEditor;
|
use Chill\PersonBundle\Household\MembersEditor;
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -27,7 +26,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Component\Serializer\Exception;
|
use Symfony\Component\Serializer\Exception;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ class HouseholdMemberController extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function editMembership(Request $request, HouseholdMember $member): Response
|
public function editMembership(Request $request, HouseholdMember $member): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $member);
|
// TODO ACL
|
||||||
|
|
||||||
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
||||||
'validation_groups' => ['household_memberships'],
|
'validation_groups' => ['household_memberships'],
|
||||||
|
@@ -30,7 +30,7 @@ class UserAccompanyingPeriodController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/{_locale}/person/accompanying-periods/my", name="chill_person_accompanying_period_user")
|
* @Route("/{_locale}/accompanying-periods", name="chill_person_accompanying_period_user")
|
||||||
*/
|
*/
|
||||||
public function listAction(Request $request)
|
public function listAction(Request $request)
|
||||||
{
|
{
|
||||||
@@ -50,7 +50,7 @@ class UserAccompanyingPeriodController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/{_locale}/person/accompanying-periods/my/drafts", name="chill_person_accompanying_period_draft_user")
|
* @Route("/{_locale}/accompanying-periods/drafts", name="chill_person_accompanying_period_draft_user")
|
||||||
*/
|
*/
|
||||||
public function listDraftsAction(Request $request)
|
public function listDraftsAction(Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -29,7 +29,10 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
protected Security $security;
|
protected Security $security;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator, Registry $registry, Security $security)
|
public function __construct(TranslatorInterface $translator, Registry $registry, Security $security)
|
||||||
{
|
{
|
||||||
@@ -43,14 +46,12 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
/** @var AccompanyingPeriod $period */
|
/** @var AccompanyingPeriod $period */
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingPeriodVoter::SEE, $period)) {
|
|
||||||
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
||||||
'route' => 'chill_person_accompanying_course_index',
|
'route' => 'chill_person_accompanying_course_index',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'accompanying_period_id' => $period->getId(),
|
'accompanying_period_id' => $period->getId(),
|
||||||
], ])
|
], ])
|
||||||
->setExtras(['order' => 10]);
|
->setExtras(['order' => 10]);
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingPeriodVoter::EDIT, $period)) {
|
if ($this->security->isGranted(AccompanyingPeriodVoter::EDIT, $period)) {
|
||||||
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
||||||
@@ -93,7 +94,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingPeriodVoter::EDIT, $period)) {
|
|
||||||
if (null !== $period->getClosingDate()) {
|
if (null !== $period->getClosingDate()) {
|
||||||
$menu->addChild($this->translator->trans('Re-open accompanying course'), [
|
$menu->addChild($this->translator->trans('Re-open accompanying course'), [
|
||||||
'route' => 'chill_person_accompanying_course_reopen',
|
'route' => 'chill_person_accompanying_course_reopen',
|
||||||
@@ -112,7 +112,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setExtras(['order' => 99999]);
|
->setExtras(['order' => 99999]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
|
@@ -12,9 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Menu;
|
namespace Chill\PersonBundle\Menu;
|
||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Security;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||||
@@ -24,12 +22,9 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
*/
|
*/
|
||||||
protected $translator;
|
protected $translator;
|
||||||
|
|
||||||
private $security;
|
public function __construct(TranslatorInterface $translator)
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator, Security $security)
|
|
||||||
{
|
{
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->security = $security;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
@@ -37,7 +32,6 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
/** @var \Chill\PersonBundle\Entity\Household\Household $household */
|
/** @var \Chill\PersonBundle\Entity\Household\Household $household */
|
||||||
$household = $parameters['household'];
|
$household = $parameters['household'];
|
||||||
|
|
||||||
if ($this->security->isGranted(HouseholdVoter::SEE, $household)) {
|
|
||||||
$menu->addChild($this->translator->trans('household.Household summary'), [
|
$menu->addChild($this->translator->trans('household.Household summary'), [
|
||||||
'route' => 'chill_person_household_summary',
|
'route' => 'chill_person_household_summary',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@@ -51,18 +45,14 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'household_id' => $household->getId(),
|
'household_id' => $household->getId(),
|
||||||
], ])
|
], ])
|
||||||
->setExtras(['order' => 15]);
|
->setExtras(['order' => 15]);
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->security->isGranted(HouseholdVoter::EDIT, $household)) {
|
|
||||||
$menu->addChild($this->translator->trans('household_composition.Compositions'), [
|
$menu->addChild($this->translator->trans('household_composition.Compositions'), [
|
||||||
'route' => 'chill_person_household_composition_index',
|
'route' => 'chill_person_household_composition_index',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'id' => $household->getId(),
|
'id' => $household->getId(),
|
||||||
], ])
|
], ])
|
||||||
->setExtras(['order' => 17]);
|
->setExtras(['order' => 17]);
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->security->isGranted(HouseholdVoter::SEE, $household)) {
|
|
||||||
$menu->addChild($this->translator->trans('household.Accompanying period'), [
|
$menu->addChild($this->translator->trans('household.Accompanying period'), [
|
||||||
'route' => 'chill_person_household_accompanying_period',
|
'route' => 'chill_person_household_accompanying_period',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@@ -77,7 +67,6 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
], ])
|
], ])
|
||||||
->setExtras(['order' => 30]);
|
->setExtras(['order' => 30]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Menu;
|
|||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
@@ -34,7 +33,10 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
*/
|
*/
|
||||||
protected $showAccompanyingPeriod;
|
protected $showAccompanyingPeriod;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
private Security $security;
|
private Security $security;
|
||||||
|
|
||||||
@@ -50,7 +52,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
|
||||||
$menu->addChild($this->translator->trans('Person details'), [
|
$menu->addChild($this->translator->trans('Person details'), [
|
||||||
'route' => 'chill_person_view',
|
'route' => 'chill_person_view',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@@ -60,6 +61,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setExtras([
|
->setExtras([
|
||||||
'order' => 50,
|
'order' => 50,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Residential addresses'), [
|
$menu->addChild($this->translator->trans('Residential addresses'), [
|
||||||
'route' => 'chill_person_residential_address_list',
|
'route' => 'chill_person_residential_address_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@@ -89,7 +91,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setExtras([
|
->setExtras([
|
||||||
'order' => 99999,
|
'order' => 99999,
|
||||||
]);
|
]);
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
'visible' === $this->showAccompanyingPeriod
|
'visible' === $this->showAccompanyingPeriod
|
||||||
@@ -106,7 +107,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
|
||||||
$menu->addChild($this->translator->trans('person_resources_menu'), [
|
$menu->addChild($this->translator->trans('person_resources_menu'), [
|
||||||
'route' => 'chill_person_resource_list',
|
'route' => 'chill_person_resource_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@@ -117,7 +117,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'order' => 99999,
|
'order' => 99999,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
|
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Menu;
|
namespace Chill\PersonBundle\Menu;
|
||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
@@ -57,7 +56,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(AccompanyingPeriodVoter::CREATE)) {
|
|
||||||
$menu->addChild($this->translator->trans('Create an accompanying course'), [
|
$menu->addChild($this->translator->trans('Create an accompanying course'), [
|
||||||
'route' => 'chill_person_accompanying_course_new',
|
'route' => 'chill_person_accompanying_course_new',
|
||||||
])
|
])
|
||||||
@@ -66,7 +64,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'icons' => ['plus'],
|
'icons' => ['plus'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
|
@@ -71,7 +71,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
|||||||
$qb = $this->buildQueryByRecentUserHistory($user, $since);
|
$qb = $this->buildQueryByRecentUserHistory($user, $since);
|
||||||
|
|
||||||
return $qb->select('a')
|
return $qb->select('a')
|
||||||
->addOrderBy('userHistory.startDate', 'DESC')
|
->distinct(true)
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->setMaxResults($limit)
|
->setMaxResults($limit)
|
||||||
->setFirstResult($offset)
|
->setFirstResult($offset)
|
||||||
@@ -95,7 +95,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
|||||||
$qb
|
$qb
|
||||||
->join('a.userHistories', 'userHistory')
|
->join('a.userHistories', 'userHistory')
|
||||||
->where($qb->expr()->eq('a.user', ':user'))
|
->where($qb->expr()->eq('a.user', ':user'))
|
||||||
->andWhere($qb->expr()->neq('a.step', "'" . AccompanyingPeriod::STEP_DRAFT . "'"))
|
|
||||||
->andWhere($qb->expr()->gte('userHistory.startDate', ':since'))
|
->andWhere($qb->expr()->gte('userHistory.startDate', ':since'))
|
||||||
->andWhere($qb->expr()->isNull('userHistory.endDate'))
|
->andWhere($qb->expr()->isNull('userHistory.endDate'))
|
||||||
->setParameter('user', $user)
|
->setParameter('user', $user)
|
||||||
|
@@ -46,8 +46,10 @@
|
|||||||
{% if type == 'new' %}
|
{% if type == 'new' %}
|
||||||
<button class="btn btn-create" type="submit">{{ 'Post a new comment'|trans }}</button>
|
<button class="btn btn-create" type="submit">{{ 'Post a new comment'|trans }}</button>
|
||||||
{% elseif type == 'edit' %}
|
{% elseif type == 'edit' %}
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT', comment) %}
|
||||||
<button class="btn btn-save" type="submit">{{ 'Save'|trans }}</button>
|
<button class="btn btn-save" type="submit">{{ 'Save'|trans }}</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -11,6 +11,6 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }}
|
{{ 'Some people currently do not belong to any household. Add them to a household soon'|trans }}
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -15,10 +15,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
{{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}</p>
|
{{ 'This course is located at a temporary address. You should link this course to a user'|trans }}</p>
|
||||||
{% if not hasPersonLocation %}
|
{% if not hasPersonLocation %}
|
||||||
<p>
|
<p>
|
||||||
{{ 'Associate at least one member with an household, and set an address to this household'|trans }}</p>
|
{{ 'Associate at least one member with a household, and set an address to this household'|trans }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -21,9 +21,11 @@
|
|||||||
{{ 'Return'|trans }}
|
{{ 'Return'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE', accompanyingCourse) %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
{{ 'Return'|trans }}
|
{{ 'Return'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{# TODO: add a right here? Use 'CHILL_ACCOMPANYING_PERIOD_CREATE'? #}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
@@ -108,6 +108,7 @@
|
|||||||
|
|
||||||
{% if displayAction is defined and displayAction == true %}
|
{% if displayAction is defined and displayAction == true %}
|
||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-edit" title="{{ 'Edit'|trans }}"
|
<a class="btn btn-edit" title="{{ 'Edit'|trans }}"
|
||||||
@@ -120,6 +121,7 @@
|
|||||||
></a>
|
></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -9,10 +9,12 @@
|
|||||||
|
|
||||||
{% if works|length == 0 %}
|
{% if works|length == 0 %}
|
||||||
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}
|
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE', accompanyingCourse) %}
|
||||||
<a class="btn btn-sm btn-create"
|
<a class="btn btn-sm btn-create"
|
||||||
title="{{ 'accompanying_course_work.create'|trans }}"
|
title="{{ 'accompanying_course_work.create'|trans }}"
|
||||||
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_new', { 'id': accompanyingCourse.id }) }}"
|
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_new', { 'id': accompanyingCourse.id }) }}"
|
||||||
></a>
|
></a>
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -26,12 +28,14 @@
|
|||||||
{{ chill_pagination(paginator) }}
|
{{ chill_pagination(paginator) }}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE', accompanyingCourse) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_new', { 'id': accompanyingCourse.id }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_new', { 'id': accompanyingCourse.id }) }}"
|
||||||
class="btn btn-new">
|
class="btn btn-new">
|
||||||
{{ 'accompanying_course_work.create'|trans }}
|
{{ 'accompanying_course_work.create'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -5,17 +5,21 @@
|
|||||||
|
|
||||||
{% macro recordAction(period, contextEntity) %}
|
{% macro recordAction(period, contextEntity) %}
|
||||||
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS', period) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
||||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if period.step == 'DRAFT' and contextEntity.type == 'person' %}
|
{% if period.step == 'DRAFT' and contextEntity.type == 'person' %}
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE', period) %}
|
||||||
{% set person = contextEntity.entity %}
|
{% set person = contextEntity.entity %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_course_delete', { 'accompanying_period_id': period.id, 'person_id' : person.id }) }}"
|
<a href="{{ path('chill_person_accompanying_course_delete', { 'accompanying_period_id': period.id, 'person_id' : person.id }) }}"
|
||||||
class="btn btn-delete" title="{{ 'Delete accompanying period'|trans }}">{# {{ 'Delete this period'|trans }} #}</a>
|
class="btn btn-delete" title="{{ 'Delete accompanying period'|trans }}">{# {{ 'Delete this period'|trans }} #}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# DISABLED if new accompanying course, this is not necessary
|
{# DISABLED if new accompanying course, this is not necessary
|
||||||
{% if person is defined %}
|
{% if person is defined %}
|
||||||
|
@@ -12,11 +12,14 @@
|
|||||||
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
|
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
{% if is_granted('CHILL_PERSON_SEE', person) %}
|
||||||
<li class="cancel">
|
<li class="cancel">
|
||||||
<a href="{{ path ('chill_person_view', {'person_id' : person.id } ) }}"
|
<a href="{{ path ('chill_person_view', {'person_id' : person.id } ) }}"
|
||||||
class="btn btn-cancel">{{ 'Person details'|trans }}
|
class="btn btn-cancel">{{ 'Person details'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{# TODO: which right to add here? #}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-create"
|
<a class="btn btn-create"
|
||||||
href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" role="button">
|
href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" role="button">
|
||||||
@@ -24,6 +27,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
{# TODO: should this commented section be deleted? #}
|
||||||
{# Disabled dropdown
|
{# Disabled dropdown
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a class="btn btn-create change-icon dropdown-toggle"
|
<a class="btn btn-create change-icon dropdown-toggle"
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
{{ 'Cancel'|trans }}
|
{{ 'Cancel'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{# TODO: add a right here? Use 'CHILL_ACCOMPANYING_PERIOD_CREATE'? #}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_period_re_open', {'confirm' : true, 'person_id' : person.id, 'period_id' : period.id } ) }}" class="btn btn-create">
|
<a href="{{ path('chill_person_accompanying_period_re_open', {'confirm' : true, 'person_id' : person.id, 'period_id' : period.id } ) }}" class="btn btn-create">
|
||||||
{{'Confirm'|trans }}
|
{{'Confirm'|trans }}
|
||||||
|
@@ -5,10 +5,12 @@
|
|||||||
{% block title %}{{ 'My accompanying periods in draft'|trans }}{% endblock title %}
|
{% block title %}{{ 'My accompanying periods in draft'|trans }}{% endblock title %}
|
||||||
|
|
||||||
{% macro recordAction(period) %}
|
{% macro recordAction(period) %}
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS', period) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
||||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
|
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,10 +5,12 @@
|
|||||||
{% block title %}{{ 'My accompanying periods'|trans }}{% endblock title %}
|
{% block title %}{{ 'My accompanying periods'|trans }}{% endblock title %}
|
||||||
|
|
||||||
{% macro recordAction(period) %}
|
{% macro recordAction(period) %}
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
||||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
|
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
|
||||||
@@ -20,8 +22,6 @@
|
|||||||
<div class="flex-table accompanyingcourse-list">
|
<div class="flex-table accompanyingcourse-list">
|
||||||
{% for period in accompanyingPeriods %}
|
{% for period in accompanyingPeriods %}
|
||||||
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %}
|
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %}
|
||||||
{% else %}
|
|
||||||
<p class="chill-no-data-statement">{{ 'Any accompanying period'|trans }}</p>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -29,13 +29,13 @@
|
|||||||
{% if customButtons['before'] is defined %}
|
{% if customButtons['before'] is defined %}
|
||||||
{{ customButtons['before'] }}
|
{{ customButtons['before'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', member.household) %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-sm btn-edit"
|
<a class="btn btn-sm btn-edit"
|
||||||
title="{{ 'household.Edit member household'|trans }}"
|
title="{{ 'household.Edit member household'|trans }}"
|
||||||
href="{{ chill_path_add_return_path('chill_person_household_member_edit', { 'id': member.id }) }}"></a>
|
href="{{ chill_path_add_return_path('chill_person_household_member_edit', { 'id': member.id }) }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if customButtons['after'] is defined %}
|
{% if customButtons['after'] is defined %}
|
||||||
{{ customButtons['after'] }}
|
{{ customButtons['after'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -41,11 +41,13 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_SEE', household) %}
|
||||||
<li class="cancel">
|
<li class="cancel">
|
||||||
<a href="{{ path ('chill_person_household_summary', {'household_id' : household.id } ) }}" class="btn btn-cancel">
|
<a href="{{ path ('chill_person_household_summary', {'household_id' : household.id } ) }}" class="btn btn-cancel">
|
||||||
{{ 'Household summary'|trans }}
|
{{ 'Household summary'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{#
|
{#
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path ('chill_person_household_accompanying_course_new', {'household_id' : [ household.id ] } ) }}" class="btn btn-create">
|
<a href="{{ path ('chill_person_household_accompanying_course_new', {'household_id' : [ household.id ] } ) }}" class="btn btn-create">
|
||||||
|
@@ -63,11 +63,13 @@
|
|||||||
'has_no_address': true
|
'has_no_address': true
|
||||||
}) }}
|
}) }}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_household_address_edit', { 'household_id': household.id, 'address_id' : address.id } ) }}"
|
<a href="{{ path('chill_person_household_address_edit', { 'household_id': household.id, 'address_id' : address.id } ) }}"
|
||||||
class="btn btn-edit"></a>
|
class="btn btn-edit"></a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -26,11 +26,13 @@
|
|||||||
{{ 'Cancel'|trans }}
|
{{ 'Cancel'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" class="btn btn-save">
|
<button type="submit" class="btn btn-save">
|
||||||
{{ 'Save'|trans }}
|
{{ 'Save'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -64,12 +64,14 @@
|
|||||||
{{ 'household_composition.Since'|trans({'startDate': currentComposition.startDate}) }}
|
{{ 'household_composition.Since'|trans({'startDate': currentComposition.startDate}) }}
|
||||||
</p>
|
</p>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-sm btn-update change-icon"
|
<a class="btn btn-sm btn-update change-icon"
|
||||||
href="{{ path('chill_person_household_composition_index', {'id': household.id}) }}">
|
href="{{ path('chill_person_household_composition_index', {'id': household.id}) }}">
|
||||||
{{ 'household_composition.Update composition'|trans }}
|
{{ 'household_composition.Update composition'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -78,12 +80,14 @@
|
|||||||
{{ 'household_composition.Currently no composition'|trans }}
|
{{ 'household_composition.Currently no composition'|trans }}
|
||||||
</p>
|
</p>
|
||||||
<ul class="record_actions" style="margin-bottom: 0">
|
<ul class="record_actions" style="margin-bottom: 0">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-sm btn-update change-icon"
|
<a class="btn btn-sm btn-update change-icon"
|
||||||
href="{{ path('chill_person_household_composition_index', {'id': household.id}) }}">
|
href="{{ path('chill_person_household_composition_index', {'id': household.id}) }}">
|
||||||
{{ 'household_composition.Add a composition'|trans }}
|
{{ 'household_composition.Add a composition'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -105,16 +109,20 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not household.commentMembers.isEmpty() %}
|
{% if not household.commentMembers.isEmpty() %}
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': household.id, 'edit': 1 }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': household.id, 'edit': 1 }) }}"
|
||||||
class="btn btn-edit btn-block">
|
class="btn btn-edit btn-block">
|
||||||
{{ 'household.Edit comment and expecting birth'|trans }}
|
{{ 'household.Edit comment and expecting birth'|trans }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': household.id, 'edit': 1 }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': household.id, 'edit': 1 }) }}"
|
||||||
class="btn btn-create btn-block">
|
class="btn btn-create btn-block">
|
||||||
{{ 'household.New comment and expecting birth'|trans }}
|
{{ 'household.New comment and expecting birth'|trans }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -129,11 +137,13 @@
|
|||||||
{{ form_widget(form.commentMembers) }}
|
{{ form_widget(form.commentMembers) }}
|
||||||
</div>
|
</div>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" class="btn btn-save" id="form_household_comment_confirm">
|
<button type="submit" class="btn btn-save" id="form_household_comment_confirm">
|
||||||
{{ 'Save'|trans }}
|
{{ 'Save'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -245,12 +255,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_household_members_editor', {'household': household.id }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_household_members_editor', {'household': household.id }) }}"
|
||||||
class="btn btn-create">
|
class="btn btn-create">
|
||||||
{{ 'household.Add a member'|trans }}
|
{{ 'household.Add a member'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -63,9 +63,11 @@
|
|||||||
<li class="cancel" style="margin-right: auto;">
|
<li class="cancel" style="margin-right: auto;">
|
||||||
<a class="btn btn-cancel" href="{{ path('chill_person_household_composition_index', {'id': c.household.id}) }}">{{ 'Cancel'|trans }}</a>
|
<a class="btn btn-cancel" href="{{ path('chill_person_household_composition_index', {'id': c.household.id}) }}">{{ 'Cancel'|trans }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', c.household) %}
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" class="btn btn-create">{{ 'Save'|trans }}</button>
|
<button type="submit" class="btn btn-create">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -79,20 +81,24 @@
|
|||||||
{{ form_widget(form) }}
|
{{ form_widget(form) }}
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" class="btn btn-create">{{ 'Save'|trans }}</button>
|
<button type="submit" class="btn btn-create">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if editId == -1 %}
|
{% if editId == -1 %}
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', household) %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-primary btn-create change-icon" type="button" data-bs-toggle="collapse" data-bs-target="#collapseForm" aria-expanded="false" aria-controls="collapseForm">
|
<button class="btn btn-primary btn-create change-icon" type="button" data-bs-toggle="collapse" data-bs-target="#collapseForm" aria-expanded="false" aria-controls="collapseForm">
|
||||||
{{ 'Create'|trans }}
|
{{ 'Create'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -107,10 +107,12 @@
|
|||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
|
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||||
<a class="btn btn-create dropdown-toggle"
|
<a class="btn btn-create dropdown-toggle"
|
||||||
href="#" role="button" id="newPersonMore" data-bs-toggle="dropdown" aria-expanded="false">
|
href="#" role="button" id="newPersonMore" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
{{ 'Add the person'|trans }}
|
{{ 'Add the person'|trans }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<ul class="dropdown-menu" aria-labelledby="newPersonMore">
|
<ul class="dropdown-menu" aria-labelledby="newPersonMore">
|
||||||
<li>
|
<li>
|
||||||
{{ form_widget(form.editPerson, { 'attr': { 'class': 'dropdown-item' }}) }}
|
{{ form_widget(form.editPerson, { 'attr': { 'class': 'dropdown-item' }}) }}
|
||||||
@@ -122,6 +124,7 @@
|
|||||||
{{ form_widget(form.createPeriod, { 'attr': { 'class': 'dropdown-item' }}) }}
|
{{ form_widget(form.createPeriod, { 'attr': { 'class': 'dropdown-item' }}) }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{# {% endif %} #}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@@ -136,11 +136,13 @@
|
|||||||
{{ 'Return'|trans }}
|
{{ 'Return'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-save" type="submit">
|
<button class="btn btn-save" type="submit">
|
||||||
{{ 'Save'|trans }}
|
{{ 'Save'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
|
||||||
|
@@ -113,14 +113,18 @@
|
|||||||
|
|
||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_SEE', p.household) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}"
|
||||||
class="btn btn-show" title="{{ 'Show'|trans }}"></a>
|
class="btn btn-show" title="{{ 'Show'|trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', p.household) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
||||||
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if p.isCurrent() %}
|
{% if p.isCurrent() %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-misc" href="{{ chill_path_add_return_path( 'chill_person_household_members_editor', { 'persons': [ person.id ], 'allow_leave_without_household': true }) }}">
|
<a class="btn btn-misc" href="{{ chill_path_add_return_path( 'chill_person_household_members_editor', { 'persons': [ person.id ], 'allow_leave_without_household': true }) }}">
|
||||||
@@ -164,10 +168,12 @@
|
|||||||
|
|
||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_HOUSEHOLD_EDIT', p.household) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
||||||
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -69,7 +69,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_SEE', person) %}
|
||||||
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||||
|
{% endif %}
|
||||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||||
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -74,7 +74,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_SEE', person) %}
|
||||||
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||||
|
{% endif %}
|
||||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||||
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -214,12 +214,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<ul class="record_actions record_actions_column">
|
<ul class="record_actions record_actions_column">
|
||||||
|
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
|
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
|
||||||
class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying period'|trans }}">
|
class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying period'|trans }}">
|
||||||
<i class="fa fa-random fa-fw"></i>
|
<i class="fa fa-random fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -20,9 +20,11 @@
|
|||||||
{{ 'Return'|trans }}
|
{{ 'Return'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-save" type="submit">{{ 'Next'|trans }}</button>
|
<button class="btn btn-save" type="submit">{{ 'Next'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -56,9 +56,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_SEE', duplicatePerson) %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-show" target="_blank" href="{{ path('chill_person_view', { person_id : duplicatePerson.id }) }}"></a>
|
<a class="btn btn-show" target="_blank" href="{{ path('chill_person_view', { person_id : duplicatePerson.id }) }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-action" href="{{ path('chill_person_duplicate_confirm', { person1_id : person.id, person2_id : duplicatePerson.id }) }}">
|
<a class="btn btn-action" href="{{ path('chill_person_duplicate_confirm', { person1_id : person.id, person2_id : duplicatePerson.id }) }}">
|
||||||
<i class="fa fa-cog fa-fw"></i>{{ 'Merge'|trans }}</a>
|
<i class="fa fa-cog fa-fw"></i>{{ 'Merge'|trans }}</a>
|
||||||
@@ -124,9 +126,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_SEE', notDuplicatePerson) %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-show" target="_blank" href="{{ path('chill_person_view', { person_id : notDuplicatePerson.id }) }}"></a>
|
<a class="btn btn-show" target="_blank" href="{{ path('chill_person_view', { person_id : notDuplicatePerson.id }) }}"></a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-misc" title="{{ 'Switch to duplicate'|trans }}"
|
<a class="btn btn-misc" title="{{ 'Switch to duplicate'|trans }}"
|
||||||
href="{{ path('chill_person_remove_duplicate_not_duplicate', {person1_id : person.id, person2_id : notDuplicatePerson.id}) }}">
|
href="{{ path('chill_person_remove_duplicate_not_duplicate', {person1_id : person.id, person2_id : notDuplicatePerson.id}) }}">
|
||||||
|
@@ -65,12 +65,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-create"
|
<button class="btn btn-create"
|
||||||
type="submit" id="newPersonResource">
|
type="submit" id="newPersonResource">
|
||||||
{{ 'Save'|trans }}
|
{{ 'Save'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@@ -38,9 +38,11 @@
|
|||||||
{{ 'Cancel'|trans|chill_return_path_label }}
|
{{ 'Cancel'|trans|chill_return_path_label }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -14,11 +14,13 @@
|
|||||||
<td>{{ entity.id }}</td>
|
<td>{{ entity.id }}</td>
|
||||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', entity) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_crud_social_evaluation_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
<a href="{{ chill_path_add_return_path('chill_crud_social_evaluation_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -14,11 +14,13 @@
|
|||||||
<td>{{ entity.id }}</td>
|
<td>{{ entity.id }}</td>
|
||||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', entity) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_crud_social_goal_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
<a href="{{ chill_path_add_return_path('chill_crud_social_goal_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -14,11 +14,13 @@
|
|||||||
<td>{{ entity.id }}</td>
|
<td>{{ entity.id }}</td>
|
||||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', entity) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_crud_social_result_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
<a href="{{ chill_path_add_return_path('chill_crud_social_result_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -14,11 +14,13 @@
|
|||||||
<td>{{ entity.id }}</td>
|
<td>{{ entity.id }}</td>
|
||||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', entity) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_crud_social_action_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
<a href="{{ chill_path_add_return_path('chill_crud_social_action_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -14,11 +14,13 @@
|
|||||||
<td>{{ entity.id }}</td>
|
<td>{{ entity.id }}</td>
|
||||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', entity) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_crud_social_issue_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
<a href="{{ chill_path_add_return_path('chill_crud_social_issue_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@@ -28,12 +28,10 @@ This view should receive those arguments:
|
|||||||
|
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
<div class="timeline">
|
<div class="timeline">
|
||||||
|
|
||||||
{{ timeline|raw }}
|
{{ timeline|raw }}
|
||||||
|
|
||||||
{% if nb_items > paginator.getItemsPerPage %}
|
{% if nb_items > paginator.getItemsPerPage %}
|
||||||
{{ chill_pagination(paginator) }}
|
{{ chill_pagination(paginator) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if display_action is defined and display_action == true %}
|
{% if display_action is defined and display_action == true %}
|
||||||
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', work) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-update"
|
<a class="btn btn-update"
|
||||||
@@ -14,4 +15,5 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
@@ -88,7 +88,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if display_action is defined and display_action == true %}
|
{% if display_action is defined and display_action == true %}
|
||||||
{# TODO add acl #}
|
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE', evaluation.accompanyingPeriodWork) %}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-show" href="{{ path('chill_person_accompanying_period_work_edit', {'id': evaluation.accompanyingPeriodWork.id}) }}">
|
<a class="btn btn-show" href="{{ path('chill_person_accompanying_period_work_edit', {'id': evaluation.accompanyingPeriodWork.id}) }}">
|
||||||
@@ -96,4 +96,5 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -213,7 +213,7 @@ No requestor: Pas de demandeur
|
|||||||
No resources: "Pas d'interlocuteurs privilégiés"
|
No resources: "Pas d'interlocuteurs privilégiés"
|
||||||
Persons associated: Usagers concernés
|
Persons associated: Usagers concernés
|
||||||
Referrer: Référent
|
Referrer: Référent
|
||||||
Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur ménage dès que possible.
|
Some people currently do not belong to any household. Add them to a household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur ménage dès que possible.
|
||||||
Add to household now: Ajouter à un ménage
|
Add to household now: Ajouter à un ménage
|
||||||
Any resource for this accompanying course: Aucun interlocuteur privilégié pour ce parcours
|
Any resource for this accompanying course: Aucun interlocuteur privilégié pour ce parcours
|
||||||
course.draft: Brouillon
|
course.draft: Brouillon
|
||||||
@@ -451,12 +451,12 @@ Edit Accompanying Course: Modifier le parcours
|
|||||||
Close Accompanying Course: Clôturer le parcours
|
Close Accompanying Course: Clôturer le parcours
|
||||||
Create Accompanying Course: Créer un nouveau parcours
|
Create Accompanying Course: Créer un nouveau parcours
|
||||||
Drop Accompanying Course: Supprimer le parcours
|
Drop Accompanying Course: Supprimer le parcours
|
||||||
This course is located at a temporarily address. You should locate this course to an user: Le parcours est localisé à une adresse temporaire. Il devrait être localisé auprès d'une personne concernée.
|
This course is located at a temporary address. You should link this course to a user: Le parcours est localisé à une adresse temporaire. Il devrait être localisé auprès d'une personne concernée.
|
||||||
Accompanying course location: Localisation du parcours
|
Accompanying course location: Localisation du parcours
|
||||||
This course is located by: Localisé auprès de
|
This course is located by: Localisé auprès de
|
||||||
This course has a temporarily location: Localisation temporaire
|
This course has a temporarily location: Localisation temporaire
|
||||||
Choose a person to locate by: Localiser auprès d'un usager concerné
|
Choose a person to locate by: Localiser auprès d'un usager concerné
|
||||||
Associate at least one member with an household, and set an address to this household: Associez au moins un membre du parcours à un ménage, et indiquez une adresse à ce ménage.
|
Associate at least one member with a household, and set an address to this household: Associez au moins un membre du parcours à un ménage, et indiquez une adresse à ce ménage.
|
||||||
Locate by: Localiser auprès de
|
Locate by: Localiser auprès de
|
||||||
fix it: Compléter
|
fix it: Compléter
|
||||||
accompanying_course:
|
accompanying_course:
|
||||||
|
@@ -16,13 +16,19 @@ use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
|||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class MenuBuilder implements LocalMenuBuilderInterface
|
class MenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
protected $authorizationChecker;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AuthorizationCheckerInterface $authorizationChecker,
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
|
@@ -15,13 +15,19 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
|||||||
use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
public AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
public $authorizationChecker;
|
||||||
|
|
||||||
public TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
public $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AuthorizationCheckerInterface $authorizationChecker,
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
|
@@ -17,17 +17,29 @@ use Chill\TaskBundle\Templating\UI\CountNotificationTask;
|
|||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
public AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
public $authorizationChecker;
|
||||||
|
|
||||||
public CountNotificationTask $counter;
|
/**
|
||||||
|
* @var CountNotificationTask
|
||||||
|
*/
|
||||||
|
public $counter;
|
||||||
|
|
||||||
public TokenStorageInterface $tokenStorage;
|
/**
|
||||||
|
* @var TokenStorageInterface
|
||||||
|
*/
|
||||||
|
public $tokenStorage;
|
||||||
|
|
||||||
public TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
public $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CountNotificationTask $counter,
|
CountNotificationTask $counter,
|
||||||
|
@@ -19,9 +19,11 @@
|
|||||||
<a class="btn btn-cancel" href={% if task.person is not null %}"{{ chill_return_path_or('chill_task_singletask_list', { 'person_id': task.person.id } ) }}"{% else %}"{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
|
<a class="btn btn-cancel" href={% if task.person is not null %}"{{ chill_return_path_or('chill_task_singletask_list', { 'person_id': task.person.id } ) }}"{% else %}"{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
|
||||||
{{ 'Cancel'|trans }}</a>
|
{{ 'Cancel'|trans }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if is_granted('CHILL_TASK_TASK_UPDATE', task) %}
|
||||||
<li>
|
<li>
|
||||||
{{ form_widget(form.submit, { 'label': 'Save task', 'attr': {'class' : 'btn btn-update'}})}}
|
{{ form_widget(form.submit, { 'label': 'Save task', 'attr': {'class' : 'btn btn-update'}})}}
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -15,16 +15,22 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
|||||||
use Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter;
|
use Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an entry in section to go to third party index page.
|
* Add an entry in section to go to third party index page.
|
||||||
*/
|
*/
|
||||||
class MenuBuilder implements LocalMenuBuilderInterface
|
class MenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
/**
|
||||||
|
* @var AuthorizationCheckerInterface
|
||||||
|
*/
|
||||||
|
protected $authorizationChecker;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AuthorizationCheckerInterface $authorizationChecker,
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
|
Reference in New Issue
Block a user