mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Documents added to accompanying course menu
This commit is contained in:
parent
b11592fb6d
commit
5211fb2fe9
Binary file not shown.
@ -84,6 +84,9 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
['date' => 'DESC']
|
['date' => 'DESC']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// dump($course);
|
||||||
|
// dump($documents);
|
||||||
|
|
||||||
// $event = new PrivacyEvent($course, [
|
// $event = new PrivacyEvent($course, [
|
||||||
// 'element_class' => AccompanyingCourseDocument::class,
|
// 'element_class' => AccompanyingCourseDocument::class,
|
||||||
// 'action' => 'index'
|
// 'action' => 'index'
|
||||||
@ -118,9 +121,9 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->denyAccessUnlessGranted(
|
// $this->denyAccessUnlessGranted(
|
||||||
'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document,
|
// 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document,
|
||||||
'creation of this activity not allowed');
|
// 'creation of this activity not allowed');
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->persist($document);
|
$em->persist($document);
|
||||||
|
@ -72,7 +72,7 @@ class AccompanyingCourseDocumentType extends AbstractType
|
|||||||
'query_builder' => function (EntityRepository $er) {
|
'query_builder' => function (EntityRepository $er) {
|
||||||
return $er->createQueryBuilder('c')
|
return $er->createQueryBuilder('c')
|
||||||
->where('c.documentClass = :docClass')
|
->where('c.documentClass = :docClass')
|
||||||
->setParameter('docClass', AccompanyingCourseDocument::class);
|
->setParameter('docClass', PersonDocument::class);
|
||||||
},
|
},
|
||||||
'choice_label' => function ($entity = null) {
|
'choice_label' => function ($entity = null) {
|
||||||
return $entity ? $this->translatableStringHelper->localize($entity->getName()) : '';
|
return $entity ? $this->translatableStringHelper->localize($entity->getName()) : '';
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ document.title }}</td>
|
<td>{{ document.title }}</td>
|
||||||
<td>{{ document.category.name|localize_translatable_string }}</td>
|
<td>{{ document.category.name|localize_translatable_string }}</td>
|
||||||
<td>{{ document.scope.name|localize_translatable_string }}</td>
|
{# <td>{{ document.scope.name|localize_translatable_string }}</td> #}
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
|
||||||
@ -37,12 +37,12 @@
|
|||||||
{{ m.download_button(document.object, document.title) }}
|
{{ m.download_button(document.object, document.title) }}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('accompanying_course_document_show', {'course': course.id, 'id': document.id}) }}" class="btn btn-show"></a>
|
<a href="{{ path('accompanying_course_document_show', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-show"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('accompanying_course_document_edit', {'course': course.id, 'id': document.id}) }}" class="btn btn-update"></a>
|
<a href="{{ path('accompanying_course_document_edit', {'course': accompanyingCourse.id, 'id': document.id }) }}" class="btn btn-update"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -61,12 +61,19 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
]])
|
]])
|
||||||
->setExtras(['order' => 30]);
|
->setExtras(['order' => 30]);
|
||||||
|
|
||||||
|
$menu->addChild($this->translator->trans('Documents'), [
|
||||||
|
'route' => 'accompanying_course_document_index',
|
||||||
|
'routeParameters' => [
|
||||||
|
'course' => $period->getId()
|
||||||
|
]])
|
||||||
|
->setExtras(['order' => 40]);
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Accompanying Course Action'), [
|
$menu->addChild($this->translator->trans('Accompanying Course Action'), [
|
||||||
'route' => 'chill_person_accompanying_period_work_list',
|
'route' => 'chill_person_accompanying_period_work_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'id' => $period->getId()
|
'id' => $period->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 40]);
|
->setExtras(['order' => 50]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user