Support oft parent groups
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
'eventIban': String,
|
||||
"eventPayPerDay": Boolean,
|
||||
"participationFeeType": String,
|
||||
"participantGroupTypes": {type: Array, default: () => []},
|
||||
})
|
||||
|
||||
const errors = reactive({})
|
||||
@@ -35,6 +36,7 @@
|
||||
eventIban: props.eventIban ? props.eventIban : '',
|
||||
eventPayPerDay: props.eventPayPerDay ? props.eventPayPerDay : false,
|
||||
eventParticipationFeeType: props.participationFeeType ? props.participationFeeType : 'fixed',
|
||||
eventParticipantGroupType: 'local_group',
|
||||
});
|
||||
|
||||
watch(
|
||||
@@ -159,6 +161,7 @@
|
||||
eventIban: formData.eventIban,
|
||||
eventPayPerDay: formData.eventPayPerDay,
|
||||
eventParticipationFeeType: formData.eventParticipationFeeType,
|
||||
eventParticipantGroupType: formData.eventParticipantGroupType,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -256,6 +259,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<th class="width-medium pr-20 height-50">Bei der Anmeldung abfragen</th>
|
||||
<td class="height-50">
|
||||
<select v-model="formData.eventParticipantGroupType" class="width-half-full">
|
||||
<option v-for="type in props.participantGroupTypes" :key="type.value" :value="type.value">{{ type.label }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<th class="width-medium pr-20 height-50">Preiserhöhung nach Early-Bird-Phase</th>
|
||||
|
||||
@@ -10,6 +10,7 @@ import Overview from "./Partials/Overview.vue";
|
||||
|
||||
const props = defineProps({
|
||||
event: Object,
|
||||
participantGroupLabel: {type: String, default: 'Stamm'},
|
||||
})
|
||||
|
||||
const tabs = [
|
||||
@@ -24,7 +25,7 @@ const tabs = [
|
||||
endpoint: "/api/v1/event/details/" + props.event.identifier + '/participants/all',
|
||||
},
|
||||
{
|
||||
title: 'Teilis nach Stamm',
|
||||
title: 'Teilis nach ' + props.participantGroupLabel,
|
||||
component: ParticipantsList,
|
||||
endpoint: "/api/v1/event/details/" + props.event.identifier + '/participants/by-local-group',
|
||||
},
|
||||
|
||||
@@ -16,8 +16,13 @@ const emit = defineEmits(['close'])
|
||||
const dynmicProps = reactive({
|
||||
localGroups: [],
|
||||
eatingHabits:[],
|
||||
participantGroupTypes: [],
|
||||
localGroupLabelPlural: 'Stämme',
|
||||
});
|
||||
|
||||
// Umstellen zwischen Local und Parent Group nur, solange es keine Anmeldungen gibt.
|
||||
const participantGroupTypeLocked = (props.event.totalParticipantCount ?? 0) > 0
|
||||
|
||||
const contributingLocalGroups = ref([])
|
||||
const eatingHabits = ref([]);
|
||||
|
||||
@@ -41,6 +46,7 @@ const emit = defineEmits(['close'])
|
||||
swimmingPermissionRequired: props.event.swimmingPermissionRequired,
|
||||
flatSupport: props.event.flatSupportEdit,
|
||||
supportPerson: props.event.supportPersonIndex,
|
||||
participantGroupType: props.event.participantGroupType ?? 'local_group',
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -76,6 +82,7 @@ const emit = defineEmits(['close'])
|
||||
supportPerson: formData.supportPerson,
|
||||
contributingLocalGroups: contributingLocalGroups.value,
|
||||
eatingHabits: eatingHabits.value,
|
||||
participantGroupType: formData.participantGroupType,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -173,6 +180,18 @@ const emit = defineEmits(['close'])
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Bei der Anmeldung abfragen</th>
|
||||
<td>
|
||||
<select v-model="formData.participantGroupType" class="width-full" :disabled="participantGroupTypeLocked">
|
||||
<option v-for="type in dynmicProps.participantGroupTypes" :key="type.value" :value="type.value">{{ type.label }}</option>
|
||||
</select>
|
||||
<span v-if="participantGroupTypeLocked" style="font-size: 0.8rem; color: #6b7280;">
|
||||
Nicht mehr änderbar, da bereits Anmeldungen vorliegen.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Mindestalter für Alkoholkonsum</th>
|
||||
<td>
|
||||
@@ -223,7 +242,7 @@ const emit = defineEmits(['close'])
|
||||
<div class="right">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Teilnehmende Stämme</th>
|
||||
<th>Teilnehmende {{ dynmicProps.localGroupLabelPlural }}</th>
|
||||
</tr>
|
||||
<tr v-for="localGroup in dynmicProps.localGroups">
|
||||
<td>
|
||||
|
||||
@@ -42,7 +42,7 @@ const form = reactive({
|
||||
address_2: '',
|
||||
postcode: '',
|
||||
city: '',
|
||||
localgroup: '',
|
||||
participantGroup: '',
|
||||
birthday: '',
|
||||
email_1: '',
|
||||
phone_1: '',
|
||||
@@ -71,6 +71,9 @@ const form = reactive({
|
||||
// Teilnahmeoptionen des Events (Definition mit Titel/Frage/Optionen).
|
||||
const participationQuestions = computed(() => staticProps.event?.participationOptions ?? []);
|
||||
|
||||
// Bezeichnung der gewählten Gruppe (z. B. „Stamm" oder „Bund"), je nach Einstellung der Veranstaltung.
|
||||
const localGroupLabel = computed(() => staticProps.event?.participantGroupLabel ?? 'Stamm');
|
||||
|
||||
// Zusatzoptionen (Event-Addons) des Events.
|
||||
const eventAddons = computed(() => staticProps.event?.addons ?? []);
|
||||
|
||||
@@ -95,7 +98,7 @@ watch(
|
||||
form.address_2 = participant?.address_2 ?? '';
|
||||
form.postcode = participant?.postcode ?? '';
|
||||
form.city = participant?.city ?? '';
|
||||
form.localgroup = participant?.local_group ?? '';
|
||||
form.participantGroup = participant?.participantGroupValue ?? '';
|
||||
form.birthday = participant?.birthdayDate ?? '';
|
||||
form.email_1 = participant?.email_1 ?? '';
|
||||
form.phone_1 = participant?.phone_1 ?? '';
|
||||
@@ -229,12 +232,12 @@ function saveParticipant() {
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Stamm</th>
|
||||
<th>{{ localGroupLabel }}</th>
|
||||
<td>
|
||||
<span v-if="!staticProps.editMode">{{ props.participant.localgroup }}</span>
|
||||
<select v-else v-model="form.localgroup">
|
||||
<option value="">Kein Stamm</option>
|
||||
<option v-for="group in staticProps.event.contributingLocalGroups" :key="group.id" :value="group.slug">{{ group.name }}</option>
|
||||
<span v-if="!staticProps.editMode">{{ props.participant.participantGroup }}</span>
|
||||
<select v-else v-model="form.participantGroup">
|
||||
<option value="">Keine Angabe</option>
|
||||
<option v-for="group in staticProps.event.participantGroupOptions" :key="group.id" :value="group.value">{{ group.name }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -162,7 +162,7 @@ async function saveParticipant(formData) {
|
||||
document.getElementById('participant-' + data.participant.identifier + '-fullname').innerHTML = data.participant.fullname;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-birthday').innerText = data.participant.birthday;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-age').innerText = data.participant.age;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-localgroup').innerText = data.participant.localgroup;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-localgroup').innerText = data.participant.participantGroup;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-arrival').innerText = data.participant.arrival;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-departure').innerText = data.participant.departure;
|
||||
document.getElementById('participant-' + data.participant.identifier + '-email_1').innerText = data.participant.email_1;
|
||||
@@ -641,7 +641,7 @@ function mailToGroup(groupKey) {
|
||||
<tr class="participant-meta-row" :id="'participant-' + participant.identifier + '-meta'">
|
||||
<td colspan="5" class="pl-meta">
|
||||
<label :id="'participant-' + participant.identifier +'-localgroup'">
|
||||
{{ participant?.localgroup ?? "-" }}
|
||||
{{ participant?.participantGroup ?? "-" }}
|
||||
</label> |
|
||||
<strong> Anreise: </strong>
|
||||
<label :id="'participant-' + participant.identifier +'-arrival'">
|
||||
|
||||
@@ -13,10 +13,12 @@ export function useShortSignupForm(event, participantData) {
|
||||
// Gibt es nur eine Zahlungsart, wird sie vorausgewählt und der Zahlungsschritt entfällt.
|
||||
const activeMethods = (event.paymentMethods ?? []).filter(m => m.active)
|
||||
|
||||
// Bei genau einem teilnehmenden Stamm wird dieser gesetzt, ohne danach zu fragen; erst ab zwei
|
||||
// Stämmen erscheint das Auswahlfeld.
|
||||
const localGroups = event.contributingLocalGroups ?? []
|
||||
// Auswahl je nach Veranstaltung: teilnehmende Stämme oder deren Bünde. Bei genau einer Option wird diese
|
||||
// gesetzt, ohne danach zu fragen; erst ab zwei Optionen erscheint das Auswahlfeld.
|
||||
const localGroups = event.participantGroupOptions ?? []
|
||||
const needsLocalGroup = localGroups.length > 1
|
||||
// Vorbelegung mit dem Stamm des eingeloggten Nutzers nur, wenn er zur Auswahl gehört (bei Bund-Abfrage nie).
|
||||
const preselectedGroup = localGroups.some(g => g.id === participantData.localGroup) ? participantData.localGroup : '-1'
|
||||
|
||||
const formData = reactive({
|
||||
userId: participantData.id,
|
||||
@@ -26,7 +28,7 @@ export function useShortSignupForm(event, participantData) {
|
||||
geburtsdatum: participantData.birthday ?? '',
|
||||
email_1: participantData.email ?? '',
|
||||
telefon_1: participantData.phone ?? '',
|
||||
localGroup: localGroups.length === 1 ? localGroups[0].id : (participantData.localGroup ?? '-1'),
|
||||
localGroup: localGroups.length === 1 ? localGroups[0].id : preselectedGroup,
|
||||
ansprechpartner: '',
|
||||
email_2: '',
|
||||
allergien: participantData.allergies ?? '',
|
||||
|
||||
@@ -11,6 +11,9 @@ const props = defineProps({
|
||||
})
|
||||
const emit = defineEmits(['next'])
|
||||
|
||||
// Bezeichnung der Auswahl (z. B. „Stamm" oder „Bund"), je nach Einstellung der Veranstaltung.
|
||||
const localGroupLabel = props.event?.participantGroupLabel ?? 'Stamm'
|
||||
|
||||
const errors = reactive({
|
||||
vorname: '',
|
||||
nachname: '',
|
||||
@@ -46,7 +49,7 @@ const next = () => {
|
||||
}
|
||||
|
||||
if (props.needsLocalGroup && (!props.formData.localGroup || props.formData.localGroup === '-1')) {
|
||||
errors.localGroup = 'Bitte einen Stamm auswählen.'
|
||||
errors.localGroup = 'Bitte bei „' + localGroupLabel + '" eine Auswahl treffen.'
|
||||
hasError = true
|
||||
}
|
||||
|
||||
@@ -122,7 +125,7 @@ const next = () => {
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="needsLocalGroup">
|
||||
<td>Stamm:</td>
|
||||
<td>{{ localGroupLabel }}:</td>
|
||||
<td>
|
||||
<select v-model="formData.localGroup">
|
||||
<option value="-1">Bitte wählen</option>
|
||||
|
||||
@@ -43,9 +43,9 @@ const selectedParticipationOptions = computed(() =>
|
||||
}).filter(entry => entry.value !== '')
|
||||
)
|
||||
|
||||
// Der Stamm steht entweder fest (genau ein teilnehmender Stamm) oder wurde auf Seite 1 gewählt.
|
||||
// Die Gruppe (Stamm oder Bund) steht entweder fest (genau eine Option) oder wurde auf Seite 1 gewählt.
|
||||
const localGroupName = computed(() =>
|
||||
(props.event.contributingLocalGroups ?? []).find(g => g.id === props.formData.localGroup)?.name ?? null
|
||||
(props.event.participantGroupOptions ?? []).find(g => g.id === props.formData.localGroup)?.name ?? null
|
||||
)
|
||||
|
||||
const permissionName = (list, slug) =>
|
||||
@@ -84,7 +84,7 @@ const canSubmit = computed(() =>
|
||||
<td>{{ formData.telefon_1 }}</td>
|
||||
</tr>
|
||||
<tr v-if="localGroupName">
|
||||
<td>Stamm:</td>
|
||||
<td>{{ event.participantGroupLabel ?? 'Stamm' }}:</td>
|
||||
<td>{{ localGroupName }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ const steps = [
|
||||
<form @submit.prevent="submit">
|
||||
<StepAge v-if="currentStep === 1" :event="event" @next="goToStep" />
|
||||
<StepContactPerson v-if="currentStep === 2" :formData="formData" :event="event" @next="goToStep" @back="goToStep" />
|
||||
<StepPersonalData v-if="currentStep === 3" :formData="formData" :localGroups="localGroups" @next="goToStep" @back="goToStep" />
|
||||
<StepPersonalData v-if="currentStep === 3" :formData="formData" :event="event" :localGroups="localGroups" @next="goToStep" @back="goToStep" />
|
||||
<StepArrival v-if="currentStep === 4" :formData="formData" :event="event" @next="goToStep" @back="goToStep" />
|
||||
<StepRegistrationMode v-if="currentStep === 5" :formData="formData" :event="event" @next="goToStep" @back="goToStep" />
|
||||
<StepAddons v-if="currentStep === 6" :formData="formData" :event="event" :selectedAddons="selectedAddons" @next="goToStep" @back="goToStep" />
|
||||
|
||||
@@ -24,7 +24,10 @@ export function useSignupForm(event, participantData) {
|
||||
vorname: participantData.firstname ?? '',
|
||||
nachname: participantData.lastname ?? '',
|
||||
pfadiname: participantData.nickname ?? '',
|
||||
localGroup: participantData.localGroup ?? '-1',
|
||||
// Vorbelegung mit dem Stamm des eingeloggten Nutzers nur, wenn er zur Auswahl gehört (bei Bund-Abfrage nie).
|
||||
localGroup: (event.participantGroupOptions ?? []).some(g => g.id === participantData.localGroup)
|
||||
? participantData.localGroup
|
||||
: '-1',
|
||||
geburtsdatum: participantData.birthday ?? '',
|
||||
address1: participantData.address_1 ?? '',
|
||||
address2: participantData.address_2 ?? '',
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
import {reactive} from "vue";
|
||||
import ErrorText from "../../../../../../Views/Components/ErrorText.vue";
|
||||
|
||||
const props = defineProps({ formData: Object, localGroups: Array })
|
||||
const props = defineProps({ formData: Object, event: Object, localGroups: Array })
|
||||
const emit = defineEmits(['next', 'back'])
|
||||
|
||||
// Bezeichnung der Auswahl (z. B. „Stamm" oder „Bund"), je nach Einstellung der Veranstaltung.
|
||||
const localGroupLabel = props.event?.participantGroupLabel ?? 'Stamm'
|
||||
|
||||
const errors = reactive({
|
||||
vorname: '',
|
||||
nachname: '',
|
||||
@@ -46,7 +49,7 @@ const next = () => {
|
||||
}
|
||||
|
||||
if (props.formData.localGroup === '-1') {
|
||||
errors.localGroup = 'Bitte den Stamm auswählen.'
|
||||
errors.localGroup = 'Bitte bei „' + localGroupLabel + '" eine Auswahl treffen.'
|
||||
hasError = true
|
||||
}
|
||||
|
||||
@@ -90,7 +93,7 @@ const next = () => {
|
||||
<tr><td>Nachname:</td><td><input type="text" v-model="props.formData.nachname" /><ErrorText :message="errors.nachname"/></td></tr>
|
||||
<tr><td>Pfadiname:</td><td><input type="text" v-model="props.formData.pfadiname" /></td></tr>
|
||||
<tr>
|
||||
<td>Stamm:</td>
|
||||
<td>{{ localGroupLabel }}:</td>
|
||||
<td>
|
||||
<select v-model="props.formData.localGroup">
|
||||
<option value="-1">Bitte wählen</option>
|
||||
|
||||
Reference in New Issue
Block a user