Anmeldung fpr 'regular' funktionert nun

This commit is contained in:
rxf
2025-11-17 18:34:50 +01:00
parent e009a16972
commit 07f0711ea0
2 changed files with 46 additions and 3 deletions

View File

@@ -191,11 +191,50 @@ Beobachtergruppe Sternwarte Welzheim`
} }
$('#tabAnmeld tbody').appendChild(sumRow); $('#tabAnmeld tbody').appendChild(sumRow);
} }
// Add group participants line below table
let groupInfoDiv = $('#groupInfo');
if (!groupInfoDiv) {
groupInfoDiv = document.createElement('div');
groupInfoDiv.id = 'groupInfo';
groupInfoDiv.style.fontSize = '75%';
groupInfoDiv.style.textAlign = 'center';
groupInfoDiv.style.marginTop = '10px';
$('#tabAnmeld').parentNode.insertBefore(groupInfoDiv, $('#tabAnmeld').nextSibling);
}
groupInfoDiv.innerHTML = '';
if (query.typ === 'regular' && besucher !== 0) {
const groupName = await getGroupForDate(date);
if (groupName) {
const participants = await getGroupParticipants(groupName);
if (participants.length > 0) {
const participantNames = participants.map(p => `${p.vorname} `).join(', ');
groupInfoDiv.innerHTML = `${groupName} -> ${participantNames}`;
}
}
}
bodytext = TEXTE.bodytext(useDatum, DateTime.fromISO(date).setLocale("de").toFormat("cccc, 'den' d. LLLL yyyy")) bodytext = TEXTE.bodytext(useDatum, DateTime.fromISO(date).setLocale("de").toFormat("cccc, 'den' d. LLLL yyyy"))
betreff = TEXTE.subject(useDatum, DateTime.fromISO(date).setLocale("de").toFormat("cccc, 'den' d. LLLL yyyy")) betreff = TEXTE.subject(useDatum, DateTime.fromISO(date).setLocale("de").toFormat("cccc, 'den' d. LLLL yyyy"))
console.log(betreff) console.log(betreff)
} }
async function getGroupForDate(date) {
const dateInfo = await fetchFromDbase({cmd:'GET_DATES', anzahl: 1, date: date});
return dateInfo && dateInfo.length > 0 ? dateInfo[0].grp : null;
}
async function getGroupParticipants(groupName) {
const allBeos = await fetchFromDbase({cmd:'GET_BEOS', onlyguides: true, what: 'vorname,name,gruppe'});
return allBeos.filter(beo => {
if (!beo.gruppe) return false;
// Split gruppe by comma and check for exact match
// This handles cases like "Mo I, Mo II", "A, B", etc.
const groups = beo.gruppe.split(',').map(g => g.trim());
return groups.includes(groupName);
});
}
async function findName(name) { async function findName(name) {
const update = { cmd: 'GET_TEILN_NAME', name: name }; const update = { cmd: 'GET_TEILN_NAME', name: name };
let erg = await putToDbase(update); let erg = await putToDbase(update);

View File

@@ -1,12 +1,16 @@
// VersiosNummern und -Geschichte // VersiosNummern und -Geschichte
const VERSION="1.9.0"; const VERSION="1.10.0";
const VDATE="2025-11-07"; const VDATE="2025-11-17";
/* History /* History
Rev. Datum Entwickler Rev. Datum Entwickler
1.10.0 2025-11-17 rxf
- als PHP-Interface nun das DB4js_all.php verwendet
- unter Tabelle noch die Namen der Führenden anzeigen
1.9.0 2025-11-07 rxf 1.9.0 2025-11-07 rxf
- Datum der Absge mit in der DB (abgesagt). Wird angezeigt, wenn abgesagt wurde. - Datum der Absge mit in der DB (abgesagt). Wird angezeigt, wenn abgesagt wurde.