mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Documents added to accompanying course menu
This commit is contained in:
@@ -84,6 +84,9 @@ class DocumentAccompanyingCourseController extends AbstractController
|
||||
['date' => 'DESC']
|
||||
);
|
||||
|
||||
// dump($course);
|
||||
// dump($documents);
|
||||
|
||||
// $event = new PrivacyEvent($course, [
|
||||
// 'element_class' => AccompanyingCourseDocument::class,
|
||||
// 'action' => 'index'
|
||||
@@ -118,9 +121,9 @@ class DocumentAccompanyingCourseController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->denyAccessUnlessGranted(
|
||||
'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document,
|
||||
'creation of this activity not allowed');
|
||||
// $this->denyAccessUnlessGranted(
|
||||
// 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document,
|
||||
// 'creation of this activity not allowed');
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($document);
|
||||
|
@@ -72,7 +72,7 @@ class AccompanyingCourseDocumentType extends AbstractType
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('c')
|
||||
->where('c.documentClass = :docClass')
|
||||
->setParameter('docClass', AccompanyingCourseDocument::class);
|
||||
->setParameter('docClass', PersonDocument::class);
|
||||
},
|
||||
'choice_label' => function ($entity = null) {
|
||||
return $entity ? $this->translatableStringHelper->localize($entity->getName()) : '';
|
||||
|
@@ -29,7 +29,7 @@
|
||||
<tr>
|
||||
<td>{{ document.title }}</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>
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
|
||||
@@ -37,12 +37,12 @@
|
||||
{{ m.download_button(document.object, document.title) }}
|
||||
</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>
|
||||
{% endif %}
|
||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
||||
<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>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user