mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: [calendar] do not show link to document if no document configured
This commit is contained in:
parent
bc1a7c1d7b
commit
7efa95efab
@ -18,6 +18,7 @@ use Chill\CalendarBundle\Repository\CalendarACLAwareRepositoryInterface;
|
|||||||
use Chill\DocGeneratorBundle\Repository\DocGeneratorTemplateRepository;
|
use Chill\DocGeneratorBundle\Repository\DocGeneratorTemplateRepository;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||||
|
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
@ -62,6 +63,8 @@ class CalendarController extends AbstractController
|
|||||||
|
|
||||||
private SerializerInterface $serializer;
|
private SerializerInterface $serializer;
|
||||||
|
|
||||||
|
private UserRepositoryInterface $userRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CalendarACLAwareRepositoryInterface $calendarACLAwareRepository,
|
CalendarACLAwareRepositoryInterface $calendarACLAwareRepository,
|
||||||
DocGeneratorTemplateRepository $docGeneratorTemplateRepository,
|
DocGeneratorTemplateRepository $docGeneratorTemplateRepository,
|
||||||
@ -71,7 +74,8 @@ class CalendarController extends AbstractController
|
|||||||
RemoteCalendarConnectorInterface $remoteCalendarConnector,
|
RemoteCalendarConnectorInterface $remoteCalendarConnector,
|
||||||
SerializerInterface $serializer,
|
SerializerInterface $serializer,
|
||||||
PersonRepository $personRepository,
|
PersonRepository $personRepository,
|
||||||
AccompanyingPeriodRepository $accompanyingPeriodRepository
|
AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||||
|
UserRepositoryInterface $userRepository
|
||||||
) {
|
) {
|
||||||
$this->calendarACLAwareRepository = $calendarACLAwareRepository;
|
$this->calendarACLAwareRepository = $calendarACLAwareRepository;
|
||||||
$this->docGeneratorTemplateRepository = $docGeneratorTemplateRepository;
|
$this->docGeneratorTemplateRepository = $docGeneratorTemplateRepository;
|
||||||
@ -82,6 +86,7 @@ class CalendarController extends AbstractController
|
|||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
$this->personRepository = $personRepository;
|
$this->personRepository = $personRepository;
|
||||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
||||||
|
$this->userRepository = $userRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,7 +150,6 @@ class CalendarController extends AbstractController
|
|||||||
return $this->remoteCalendarConnector->getMakeReadyResponse($request->getUri());
|
return $this->remoteCalendarConnector->getMakeReadyResponse($request->getUri());
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = null;
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
[$person, $accompanyingPeriod] = [$entity->getPerson(), $entity->getAccompanyingPeriod()];
|
[$person, $accompanyingPeriod] = [$entity->getPerson(), $entity->getAccompanyingPeriod()];
|
||||||
@ -161,8 +165,11 @@ class CalendarController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form = $this->createForm(CalendarType::class, $entity)
|
$form = $this->createForm(CalendarType::class, $entity)
|
||||||
->add('save', SubmitType::class)
|
->add('save', SubmitType::class);
|
||||||
->add('save_and_create_doc', SubmitType::class);
|
|
||||||
|
if (0 < $this->docGeneratorTemplateRepository->countByEntity(Calendar::class)) {
|
||||||
|
$form->add('save_and_create_doc', SubmitType::class);
|
||||||
|
}
|
||||||
|
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
@ -310,8 +317,11 @@ class CalendarController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form = $this->createForm(CalendarType::class, $entity)
|
$form = $this->createForm(CalendarType::class, $entity)
|
||||||
->add('save', SubmitType::class)
|
->add('save', SubmitType::class);
|
||||||
->add('save_and_create_doc', SubmitType::class);
|
|
||||||
|
if (0 < $this->docGeneratorTemplateRepository->countByEntity(Calendar::class)) {
|
||||||
|
$form->add('save_and_create_doc', SubmitType::class);
|
||||||
|
}
|
||||||
|
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
@ -77,9 +77,11 @@
|
|||||||
{{ 'Cancel'|trans|chill_return_path_label }}
|
{{ 'Cancel'|trans|chill_return_path_label }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
{% if form.save_and_create_doc is defined %}
|
||||||
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Save and add a document'|trans }) }}
|
<li>
|
||||||
</li>
|
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Save and add a document'|trans }) }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Save'|trans }) }}
|
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Save'|trans }) }}
|
||||||
</li>
|
</li>
|
||||||
|
@ -77,9 +77,11 @@
|
|||||||
{{ 'Cancel'|trans|chill_return_path_label }}
|
{{ 'Cancel'|trans|chill_return_path_label }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
{% if form.save_and_create_doc is defined %}
|
||||||
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Create and add a document'|trans }) }}
|
<li>
|
||||||
</li>
|
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Create and add a document'|trans }) }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Create'|trans }) }}
|
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Create'|trans }) }}
|
||||||
</li>
|
</li>
|
||||||
|
@ -54,6 +54,7 @@ chill_calendar:
|
|||||||
Documents: Documents
|
Documents: Documents
|
||||||
Create and add a document: Créer et ajouter un document
|
Create and add a document: Créer et ajouter un document
|
||||||
Save and add a document: Enregistrer et ajouter un document
|
Save and add a document: Enregistrer et ajouter un document
|
||||||
|
Create for me: Créer un rendez-vous pour moi-même
|
||||||
|
|
||||||
|
|
||||||
remote_ms_graph:
|
remote_ms_graph:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user