mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Merge branch 'issues546_553_554_documents_acc_period_activity' into 'master'
issues553_554_documents_activity See merge request Chill-Projet/chill-bundles!389
This commit is contained in:
commit
e7b4f1a54f
@ -11,6 +11,8 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
|
* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554)
|
||||||
|
* [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553)
|
||||||
* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517)
|
* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517)
|
||||||
* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546)
|
* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546)
|
||||||
* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512)
|
* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512)
|
||||||
|
@ -179,14 +179,15 @@ final class ActivityController extends AbstractController
|
|||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
|
|
||||||
[$person, $accompanyingPeriod] = $this->getEntity($request);
|
|
||||||
|
|
||||||
$entity = $this->activityRepository->find($id);
|
$entity = $this->activityRepository->find($id);
|
||||||
|
|
||||||
if (null === $entity) {
|
if (null === $entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Activity entity.');
|
throw $this->createNotFoundException('Unable to find Activity entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$accompanyingPeriod = $entity->getAccompanyingPeriod();
|
||||||
|
$person = $entity->getPerson();
|
||||||
|
|
||||||
if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
||||||
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
|
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
|
||||||
$accompanyingPeriod = $entity->getAccompanyingPeriod();
|
$accompanyingPeriod = $entity->getAccompanyingPeriod();
|
||||||
@ -220,6 +221,9 @@ final class ActivityController extends AbstractController
|
|||||||
$this->entityManager->persist($entity);
|
$this->entityManager->persist($entity);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
||||||
|
$params['id'] = $entity->getId();
|
||||||
|
|
||||||
if ($form->has('gendocTemplateId') && null !== $form['gendocTemplateId']->getData()) {
|
if ($form->has('gendocTemplateId') && null !== $form['gendocTemplateId']->getData()) {
|
||||||
return $this->redirectToRoute(
|
return $this->redirectToRoute(
|
||||||
'chill_docgenerator_generate_from_template',
|
'chill_docgenerator_generate_from_template',
|
||||||
@ -227,15 +231,13 @@ final class ActivityController extends AbstractController
|
|||||||
'template' => $form->get('gendocTemplateId')->getData(),
|
'template' => $form->get('gendocTemplateId')->getData(),
|
||||||
'entityClassName' => Activity::class,
|
'entityClassName' => Activity::class,
|
||||||
'entityId' => $entity->getId(),
|
'entityId' => $entity->getId(),
|
||||||
|
'returnPath' => $this->generateUrl('chill_activity_activity_edit', $params)
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
|
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
|
||||||
|
|
||||||
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
|
||||||
$params['id'] = $entity->getId();
|
|
||||||
|
|
||||||
return $this->redirectToRoute('chill_activity_activity_show', $params);
|
return $this->redirectToRoute('chill_activity_activity_show', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,6 +446,9 @@ final class ActivityController extends AbstractController
|
|||||||
'template' => $form->get('gendocTemplateId')->getData(),
|
'template' => $form->get('gendocTemplateId')->getData(),
|
||||||
'entityClassName' => Activity::class,
|
'entityClassName' => Activity::class,
|
||||||
'entityId' => $entity->getId(),
|
'entityId' => $entity->getId(),
|
||||||
|
'returnPath' => $this->generateUrl('chill_activity_activity_edit', [
|
||||||
|
'id' => $entity->getId(),
|
||||||
|
])
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -305,6 +305,7 @@ class ActivityType extends AbstractType
|
|||||||
'label' => $activityType->getLabel('documents'),
|
'label' => $activityType->getLabel('documents'),
|
||||||
'required' => $activityType->isRequired('documents'),
|
'required' => $activityType->isRequired('documents'),
|
||||||
'allow_add' => true,
|
'allow_add' => true,
|
||||||
|
'allow_delete' => true,
|
||||||
'button_add_label' => 'activity.Insert a document',
|
'button_add_label' => 'activity.Insert a document',
|
||||||
'button_remove_label' => 'activity.Remove a document',
|
'button_remove_label' => 'activity.Remove a document',
|
||||||
'empty_collection_explain' => 'No documents',
|
'empty_collection_explain' => 'No documents',
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
div.chill-dropzone__below-zone {
|
||||||
|
a.btn-delete {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// do it in js does not work
|
||||||
|
// document.addEventListener('DOMContentLoaded', e => {
|
||||||
|
// const dropzoneBelow = document.querySelectorAll('div.chill-dropzone__below-zone');
|
||||||
|
// dropzoneBelow.forEach(
|
||||||
|
// d => {
|
||||||
|
// const a = d.querySelector('a.btn-delete');
|
||||||
|
// d.removeChild(a);
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// });
|
@ -30,4 +30,5 @@
|
|||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_async_upload') }}
|
||||||
{{ encore_entry_link_tags('vue_activity') }}
|
{{ encore_entry_link_tags('vue_activity') }}
|
||||||
|
{{ encore_entry_link_tags('page_edit_activity') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -7,5 +7,7 @@ module.exports = function(encore, entries)
|
|||||||
ChillActivityAssets: __dirname + '/Resources/public'
|
ChillActivityAssets: __dirname + '/Resources/public'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
encore.addEntry('page_edit_activity', __dirname + '/Resources/public/page/edit_activity/index.scss');
|
||||||
|
|
||||||
encore.addEntry('vue_activity', __dirname + '/Resources/public/vuejs/Activity/index.js');
|
encore.addEntry('vue_activity', __dirname + '/Resources/public/vuejs/Activity/index.js');
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user