Anmeldung fpr 'regular' funktionert nun
This commit is contained in:
@@ -191,11 +191,50 @@ Beobachtergruppe Sternwarte Welzheim`
|
||||
}
|
||||
$('#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"))
|
||||
betreff = TEXTE.subject(useDatum, DateTime.fromISO(date).setLocale("de").toFormat("cccc, 'den' d. LLLL yyyy"))
|
||||
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) {
|
||||
const update = { cmd: 'GET_TEILN_NAME', name: name };
|
||||
let erg = await putToDbase(update);
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
// VersiosNummern und -Geschichte
|
||||
|
||||
const VERSION="1.9.0";
|
||||
const VDATE="2025-11-07";
|
||||
const VERSION="1.10.0";
|
||||
const VDATE="2025-11-17";
|
||||
|
||||
/* History
|
||||
|
||||
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
|
||||
- Datum der Absge mit in der DB (abgesagt). Wird angezeigt, wenn abgesagt wurde.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user