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\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
@ -62,6 +63,8 @@ class CalendarController extends AbstractController
|
||||
|
||||
private SerializerInterface $serializer;
|
||||
|
||||
private UserRepositoryInterface $userRepository;
|
||||
|
||||
public function __construct(
|
||||
CalendarACLAwareRepositoryInterface $calendarACLAwareRepository,
|
||||
DocGeneratorTemplateRepository $docGeneratorTemplateRepository,
|
||||
@ -71,7 +74,8 @@ class CalendarController extends AbstractController
|
||||
RemoteCalendarConnectorInterface $remoteCalendarConnector,
|
||||
SerializerInterface $serializer,
|
||||
PersonRepository $personRepository,
|
||||
AccompanyingPeriodRepository $accompanyingPeriodRepository
|
||||
AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||
UserRepositoryInterface $userRepository
|
||||
) {
|
||||
$this->calendarACLAwareRepository = $calendarACLAwareRepository;
|
||||
$this->docGeneratorTemplateRepository = $docGeneratorTemplateRepository;
|
||||
@ -82,6 +86,7 @@ class CalendarController extends AbstractController
|
||||
$this->serializer = $serializer;
|
||||
$this->personRepository = $personRepository;
|
||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,7 +150,6 @@ class CalendarController extends AbstractController
|
||||
return $this->remoteCalendarConnector->getMakeReadyResponse($request->getUri());
|
||||
}
|
||||
|
||||
$view = null;
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
[$person, $accompanyingPeriod] = [$entity->getPerson(), $entity->getAccompanyingPeriod()];
|
||||
@ -161,8 +165,11 @@ class CalendarController extends AbstractController
|
||||
}
|
||||
|
||||
$form = $this->createForm(CalendarType::class, $entity)
|
||||
->add('save', SubmitType::class)
|
||||
->add('save_and_create_doc', SubmitType::class);
|
||||
->add('save', SubmitType::class);
|
||||
|
||||
if (0 < $this->docGeneratorTemplateRepository->countByEntity(Calendar::class)) {
|
||||
$form->add('save_and_create_doc', SubmitType::class);
|
||||
}
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
@ -310,8 +317,11 @@ class CalendarController extends AbstractController
|
||||
}
|
||||
|
||||
$form = $this->createForm(CalendarType::class, $entity)
|
||||
->add('save', SubmitType::class)
|
||||
->add('save_and_create_doc', SubmitType::class);
|
||||
->add('save', SubmitType::class);
|
||||
|
||||
if (0 < $this->docGeneratorTemplateRepository->countByEntity(Calendar::class)) {
|
||||
$form->add('save_and_create_doc', SubmitType::class);
|
||||
}
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
|
@ -77,9 +77,11 @@
|
||||
{{ 'Cancel'|trans|chill_return_path_label }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Save and add a document'|trans }) }}
|
||||
</li>
|
||||
{% if form.save_and_create_doc is defined %}
|
||||
<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>
|
||||
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Save'|trans }) }}
|
||||
</li>
|
||||
|
@ -77,9 +77,11 @@
|
||||
{{ 'Cancel'|trans|chill_return_path_label }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Create and add a document'|trans }) }}
|
||||
</li>
|
||||
{% if form.save_and_create_doc is defined %}
|
||||
<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>
|
||||
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Create'|trans }) }}
|
||||
</li>
|
||||
|
@ -54,6 +54,7 @@ chill_calendar:
|
||||
Documents: Documents
|
||||
Create and add a document: Créer 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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user