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)
|
||||
{
|
||||
$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(
|
||||
'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE',
|
||||
@ -55,6 +45,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
dump($form->get('acpw')->getData());
|
||||
$acpw2 = $this->accompanyingPeriodWorkRepository->find($form->get('acpw')->getData());
|
||||
|
||||
$direction = $form->get('direction')->getData();
|
||||
|
@ -27,13 +27,13 @@ class FindAccompanyingPeriodWorkType extends AbstractType
|
||||
}
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$accompanyingPeriod = $options['accompanyingPeriod'];
|
||||
$suggestedAcpw = $this->repository->findByAccompanyingPeriod($accompanyingPeriod);
|
||||
// $accompanyingPeriod = $options['accompanyingPeriod'];
|
||||
// $suggestedAcpw = $this->repository->findByAccompanyingPeriod($accompanyingPeriod);
|
||||
|
||||
$builder
|
||||
->add('acpw', PickLinkedAccompanyingPeriodWorkType::class, [
|
||||
'label' => 'Accompanying period work',
|
||||
'suggested' => $suggestedAcpw,
|
||||
// 'suggested' => $suggestedAcpw,
|
||||
'multiple' => false,
|
||||
])
|
||||
->add('direction', HiddenType::class, [
|
||||
|
@ -4,7 +4,7 @@
|
||||
<label class="acpw-item">
|
||||
|
||||
<div>
|
||||
<input type="radio" :value="acpw.id" v-model="selectedAcpw" name="item"/>
|
||||
<input type="radio" :value="acpw" v-model="selectedAcpw" name="item"/>
|
||||
</div>
|
||||
|
||||
<accompanying-period-work-item :acpw="acpw" />
|
||||
@ -24,6 +24,7 @@ const props = defineProps<{ accompanyingPeriodWorks: AccompanyingPeriodWork[] }>
|
||||
const selectedAcpw = ref<AccompanyingPeriodWork | null>(null);
|
||||
|
||||
const emit = defineEmits();
|
||||
|
||||
watch(selectedAcpw, (newValue) => {
|
||||
emit('update:selectedAcpw', newValue);
|
||||
});
|
||||
|
@ -56,7 +56,11 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getAccompanyingPeriodWorks(parseInt(props.accompanyingPeriodId));
|
||||
if (props.accompanyingPeriodId) {
|
||||
getAccompanyingPeriodWorks(parseInt(props.accompanyingPeriodId));
|
||||
} else {
|
||||
console.error("No accompanyingperiod id was given")
|
||||
}
|
||||
});
|
||||
const getAccompanyingPeriodWorks = (periodId: number) => {
|
||||
const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`;
|
||||
@ -72,9 +76,8 @@ const getAccompanyingPeriodWorks = (periodId: number) => {
|
||||
|
||||
watch(selectedAcpw, (newValue) => {
|
||||
const inputField = document.getElementById('find_accompanying_period_work_acpw') as HTMLInputElement;
|
||||
console.log('selected Acpw', newValue);
|
||||
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 {
|
||||
'displayAction': true,
|
||||
'displayContent': 'short',
|
||||
|
@ -19,9 +19,11 @@
|
||||
</h1>
|
||||
|
||||
<h4>{{ 'Deleted datas'|trans ~ ':' }}</h4>
|
||||
|
||||
{{ details.details(acpw2, accompanyingCourse) }}
|
||||
|
||||
<div class="accompanying-course-work">
|
||||
<div class="flex-table">
|
||||
{{ details.details(acpw2, accompanyingCourse) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -35,8 +37,11 @@
|
||||
</h1>
|
||||
|
||||
<h4>{{ 'acpw_duplicate.Data to keep'|trans ~ ':' }}</h4>
|
||||
{{ details.details(acpw, accompanyingCourse) }}
|
||||
|
||||
<div class="accompanying-course-work">
|
||||
<div class="flex-table">
|
||||
{{ details.details(acpw, accompanyingCourse) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user