From eb7afe06ffea8066b9f63ad16efbcc525d12a6c2 Mon Sep 17 00:00:00 2001 From: Blitz08 Date: Sat, 31 Jan 2026 11:42:46 +0100 Subject: [PATCH] admin: read phase-count from Wahl option data-einheiten; fallback to mapping --- includes/force-zuteilung.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/force-zuteilung.php b/includes/force-zuteilung.php index 94f24d5..72ff6b9 100644 --- a/includes/force-zuteilung.php +++ b/includes/force-zuteilung.php @@ -64,8 +64,7 @@ function kc_force_zuteilung_page() { echo ''; echo ''; @@ -121,8 +120,9 @@ jQuery(function($){ $("#kc-force-workshop-dropdown").select2({placeholder:"Workshop auswählen…",allowClear:true}); function refreshPhaseSelect($wahlSelect, $phaseSelect, current) { - var wid = parseInt($wahlSelect.val(),10); - var max = (wid && kcWahlPhases[wid]) ? parseInt(kcWahlPhases[wid],10) : 1; + // prefer data attribute on the selected option; fall back to kcWahlPhases mapping + var selOpt = $wahlSelect.find('option:selected'); + var max = parseInt(selOpt.data('einheiten') || kcWahlPhases[parseInt($wahlSelect.val(),10)] || 1, 10); $phaseSelect.empty(); for(var i=1;i<=max;i++){ var opt = $("