diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue
index b422ba23d..3e6b40c28 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue
@@ -14,6 +14,18 @@
+
+
+
+
+ {{ $t('courselocation.associate_at_least_one_person_with_one_household_with_address') }}
+
+
+
+
+
+
+
-
{{ $t('courselocation.temporary_address_must_be_changed') }}
+
+ {{ $t('courselocation.temporary_address_must_be_changed') }}
+
+
@@ -116,11 +131,35 @@ export default {
hasNoLocation() {
return this.accompanyingCourse.locationStatus === 'none';
},
+ currentParticipations() {
+ return this.accompanyingCourse.participations.filter(p => p.enddate !== null);
+ },
+ hasNoPersonLocation() {
+ let addressInParticipations_ = []
+ this.currentParticipations.forEach(p => {
+ addressInParticipations_.push(this.checkHouseholdAddressForParticipation(p));
+ });
+ const booleanReducer = (previousValue, currentValue) => previousValue || currentValue;
+ let addressInParticipations = addressInParticipations_.reduce(booleanReducer);
+ //console.log(addressInParticipations_, addressInParticipations);
+ return (
+ this.accompanyingCourse.step !== 'DRAFT'
+ && this.isTemporaryAddress
+ && !addressInParticipations
+ )
+ ;
+ },
isContextEdit() {
return this.context.edit;
}
},
methods: {
+ checkHouseholdAddressForParticipation(participation) {
+ if (participation.person.current_household_id === null) {
+ return false;
+ }
+ return participation.person.current_household_address !== null;
+ },
initAddressContext() {
let context = {
target: {
@@ -166,12 +205,36 @@ export default {
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue
index 97a286d70..52b538284 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue
@@ -26,7 +26,7 @@
:id="p.person.id"
:value="p.person.id"
/>
-