mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-02 22:17:45 +00:00
FIX [documents][parcours] only show document menu entry when parcours is no longer draft
This commit is contained in:
parent
a4f47ad58b
commit
f0445ea798
@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Menu;
|
|||||||
use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
|
use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
|
||||||
use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter;
|
use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter;
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
@ -60,7 +61,7 @@ final class MenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
$course = $parameters['accompanyingCourse'];
|
$course = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $course)) {
|
if ($this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $course) && !(AccompanyingPeriod::STEP_DRAFT === $course->getStep())) {
|
||||||
$menu->addChild($this->translator->trans('Documents'), [
|
$menu->addChild($this->translator->trans('Documents'), [
|
||||||
'route' => 'accompanying_course_document_index',
|
'route' => 'accompanying_course_document_index',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
|
@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
{{ chill_pagination(pagination) }}
|
{{ chill_pagination(pagination) }}
|
||||||
|
|
||||||
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', accompanyingCourse) and not accompanyingCourse.getStep() is same as('DRAFT') %}
|
||||||
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\PersonBundle\Entity\AccompanyingPeriod" data-entity-id="{{ accompanyingCourse.id }}"></div>
|
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\PersonBundle\Entity\AccompanyingPeriod" data-entity-id="{{ accompanyingCourse.id }}"></div>
|
||||||
|
|
||||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', accompanyingCourse) %}
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li class="create">
|
<li class="create">
|
||||||
<a href="{{ path('accompanying_course_document_new', {'course': accompanyingCourse.id}) }}" class="btn btn-create">
|
<a href="{{ path('accompanying_course_document_new', {'course': accompanyingCourse.id}) }}" class="btn btn-create">
|
||||||
|
@ -56,9 +56,9 @@
|
|||||||
|
|
||||||
{{ chill_pagination(pagination) }}
|
{{ chill_pagination(pagination) }}
|
||||||
|
|
||||||
|
{% if is_granted('CHILL_PERSON_DOCUMENT_CREATE', person) %}
|
||||||
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\PersonBundle\Entity\Person" data-entity-id="{{ person.id }}"></div>
|
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\PersonBundle\Entity\Person" data-entity-id="{{ person.id }}"></div>
|
||||||
|
|
||||||
{% if is_granted('CHILL_PERSON_DOCUMENT_CREATE', person) %}
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li class="create">
|
<li class="create">
|
||||||
<a href="{{ path('person_document_new', {'person': person.id}) }}" class="btn btn-create">
|
<a href="{{ path('person_document_new', {'person': person.id}) }}" class="btn btn-create">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user