mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixes after rebase + apply item styling for accompanying course work
This commit is contained in:
parent
3356ed8e57
commit
17b1363113
@ -33,16 +33,6 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
|
|||||||
public function assignDuplicate(AccompanyingPeriodWork $acpw, Request $request)
|
public function assignDuplicate(AccompanyingPeriodWork $acpw, Request $request)
|
||||||
{
|
{
|
||||||
$accompanyingPeriod = $acpw->getAccompanyingPeriod();
|
$accompanyingPeriod = $acpw->getAccompanyingPeriod();
|
||||||
/* $acpwArray = $this->accompanyingPeriodWorkRepository->findByAccompanyingPeriod($accompanyingPeriod);
|
|
||||||
|
|
||||||
$acpwArray = array_map(function ($acpw) {
|
|
||||||
return [
|
|
||||||
'id' => $acpw->getId(),
|
|
||||||
'socialAction' => $this->stringHelper->localize($acpw->getSocialAction()->getTitle()),
|
|
||||||
'startDate' => $acpw->getStartDate(),
|
|
||||||
'endDate' => $acpw->getEndDate(),
|
|
||||||
];
|
|
||||||
}, $acpwArray);*/
|
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(
|
$this->denyAccessUnlessGranted(
|
||||||
'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE',
|
'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE',
|
||||||
@ -55,6 +45,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
dump($form->get('acpw')->getData());
|
||||||
$acpw2 = $this->accompanyingPeriodWorkRepository->find($form->get('acpw')->getData());
|
$acpw2 = $this->accompanyingPeriodWorkRepository->find($form->get('acpw')->getData());
|
||||||
|
|
||||||
$direction = $form->get('direction')->getData();
|
$direction = $form->get('direction')->getData();
|
||||||
|
@ -27,13 +27,13 @@ class FindAccompanyingPeriodWorkType extends AbstractType
|
|||||||
}
|
}
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$accompanyingPeriod = $options['accompanyingPeriod'];
|
// $accompanyingPeriod = $options['accompanyingPeriod'];
|
||||||
$suggestedAcpw = $this->repository->findByAccompanyingPeriod($accompanyingPeriod);
|
// $suggestedAcpw = $this->repository->findByAccompanyingPeriod($accompanyingPeriod);
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add('acpw', PickLinkedAccompanyingPeriodWorkType::class, [
|
->add('acpw', PickLinkedAccompanyingPeriodWorkType::class, [
|
||||||
'label' => 'Accompanying period work',
|
'label' => 'Accompanying period work',
|
||||||
'suggested' => $suggestedAcpw,
|
// 'suggested' => $suggestedAcpw,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
])
|
])
|
||||||
->add('direction', HiddenType::class, [
|
->add('direction', HiddenType::class, [
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<label class="acpw-item">
|
<label class="acpw-item">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<input type="radio" :value="acpw.id" v-model="selectedAcpw" name="item"/>
|
<input type="radio" :value="acpw" v-model="selectedAcpw" name="item"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<accompanying-period-work-item :acpw="acpw" />
|
<accompanying-period-work-item :acpw="acpw" />
|
||||||
@ -24,6 +24,7 @@ const props = defineProps<{ accompanyingPeriodWorks: AccompanyingPeriodWork[] }>
|
|||||||
const selectedAcpw = ref<AccompanyingPeriodWork | null>(null);
|
const selectedAcpw = ref<AccompanyingPeriodWork | null>(null);
|
||||||
|
|
||||||
const emit = defineEmits();
|
const emit = defineEmits();
|
||||||
|
|
||||||
watch(selectedAcpw, (newValue) => {
|
watch(selectedAcpw, (newValue) => {
|
||||||
emit('update:selectedAcpw', newValue);
|
emit('update:selectedAcpw', newValue);
|
||||||
});
|
});
|
||||||
|
@ -56,7 +56,11 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
if (props.accompanyingPeriodId) {
|
||||||
getAccompanyingPeriodWorks(parseInt(props.accompanyingPeriodId));
|
getAccompanyingPeriodWorks(parseInt(props.accompanyingPeriodId));
|
||||||
|
} else {
|
||||||
|
console.error("No accompanyingperiod id was given")
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const getAccompanyingPeriodWorks = (periodId: number) => {
|
const getAccompanyingPeriodWorks = (periodId: number) => {
|
||||||
const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`;
|
const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`;
|
||||||
@ -72,9 +76,8 @@ const getAccompanyingPeriodWorks = (periodId: number) => {
|
|||||||
|
|
||||||
watch(selectedAcpw, (newValue) => {
|
watch(selectedAcpw, (newValue) => {
|
||||||
const inputField = document.getElementById('find_accompanying_period_work_acpw') as HTMLInputElement;
|
const inputField = document.getElementById('find_accompanying_period_work_acpw') as HTMLInputElement;
|
||||||
console.log('selected Acpw', newValue);
|
|
||||||
if (inputField) {
|
if (inputField) {
|
||||||
inputField.value = String(newValue?.id);
|
inputField.value = String(newValue.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{%- macro details(acpw, options) -%}
|
{%- macro details(w, accompanyingCourse, options) -%}
|
||||||
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with {
|
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with {
|
||||||
'displayAction': true,
|
'displayAction': true,
|
||||||
'displayContent': 'short',
|
'displayContent': 'short',
|
||||||
|
@ -19,9 +19,11 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<h4>{{ 'Deleted datas'|trans ~ ':' }}</h4>
|
<h4>{{ 'Deleted datas'|trans ~ ':' }}</h4>
|
||||||
|
<div class="accompanying-course-work">
|
||||||
|
<div class="flex-table">
|
||||||
{{ details.details(acpw2, accompanyingCourse) }}
|
{{ details.details(acpw2, accompanyingCourse) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -35,8 +37,11 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<h4>{{ 'acpw_duplicate.Data to keep'|trans ~ ':' }}</h4>
|
<h4>{{ 'acpw_duplicate.Data to keep'|trans ~ ':' }}</h4>
|
||||||
|
<div class="accompanying-course-work">
|
||||||
|
<div class="flex-table">
|
||||||
{{ details.details(acpw, accompanyingCourse) }}
|
{{ details.details(acpw, accompanyingCourse) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user