diff --git a/server/public/home.html b/server/public/home.html
index d33b2d3..4b010c9 100644
--- a/server/public/home.html
+++ b/server/public/home.html
@@ -4846,6 +4846,18 @@ function openScheduleModal(gid, editMtg){
const label12=m=>{ let h=Math.floor(m/60),mm=m%60; const ap=h<12?'AM':'PM'; let h12=h%12||12; return h12+':'+pad(mm)+' '+ap; };
const dateLabel=d=>d.toLocaleDateString([],{weekday:'short',month:'short',day:'numeric'});
const invitedIds=new Set(editing&&Array.isArray(editMtg.invitedIds)?editMtg.invitedIds:[]);
+ // #16: scheduling FROM a group doesn't need the invite-participants / invite-by-email / admit-by-host
+ // sections — the group's members are automatically the meeting's participants. Drop them for a group.
+ const fromGroup=!!gid;
+ const inviteBlock = fromGroup ? '' : (
+ ''
+ + (CONTACTS.length>6?'
'
@@ -4860,13 +4872,7 @@ function openScheduleModal(gid, editMtg){
+''
+'
'+DAY1.map((d,i)=>'').join('')+'
'
+''
- +''
- +(CONTACTS.length>6?'':'')
- +'
'+(CONTACTS.length?CONTACTS.map(c=>'').join(''):'
No contacts to invite
')+'
'
- +''
- +''
- +''
- +''
+ +inviteBlock // #16: empty when scheduling from a group — the members are the invitees (no invite/email/admit section)
+''
+'
';
document.body.appendChild(ov);
@@ -4916,8 +4922,8 @@ function openScheduleModal(gid, editMtg){
const emailList=(editing&&Array.isArray(editMtg.guestEmails))?editMtg.guestEmails.slice():[];
function renderEmailChips(){ const w=$('schEmailChips'); if(!w) return; w.innerHTML=emailList.map((e,i)=>''+pEsc(e)+'').join(''); w.querySelectorAll('.echip button').forEach(b=>b.onclick=()=>{ emailList.splice(+b.dataset.i,1); renderEmailChips(); }); }
function addEmail(){ const inp=$('schEmail'); const v=(inp.value||'').trim().toLowerCase(); if(!v) return; if(!EMAIL_RE.test(v)){ err.textContent='Enter a valid email address.'; return; } if(!emailList.includes(v)) emailList.push(v); inp.value=''; err.textContent=''; renderEmailChips(); }
- $('schEmailAdd').onclick=addEmail;
- $('schEmail').addEventListener('keydown',e=>{ if(e.key==='Enter'){ e.preventDefault(); addEmail(); } });
+ { const ea=$('schEmailAdd'); if(ea) ea.onclick=addEmail; } // #16: absent when scheduling from a group
+ { const em=$('schEmail'); if(em) em.addEventListener('keydown',e=>{ if(e.key==='Enter'){ e.preventDefault(); addEmail(); } }); }
renderEmailChips();
// #10: filter the participant list as you type.
{ const ps=$('schPplSearch'); if(ps) ps.addEventListener('input',()=>{ const q=ps.value.trim().toLowerCase(); ov.querySelectorAll('#schPeople .chk').forEach(l=>{ l.style.display=(!q||(l.dataset.nm||'').includes(q))?'':'none'; }); }); }
@@ -4926,7 +4932,7 @@ function openScheduleModal(gid, editMtg){
const desc=$('schDesc').value.trim();
const durationMins=parseInt($('schDur').value,10)||30;
const participants=[...ov.querySelectorAll('#schPeople input:checked')].map(i=>i.value);
- { const pend=($('schEmail').value||'').trim().toLowerCase(); if(pend && EMAIL_RE.test(pend) && !emailList.includes(pend)) emailList.push(pend); } // include a typed-but-not-added email
+ { const em=$('schEmail'); const pend=((em&&em.value)||'').trim().toLowerCase(); if(pend && EMAIL_RE.test(pend) && !emailList.includes(pend)) emailList.push(pend); } // include a typed-but-not-added email (#16: absent for group schedules)
clearErrAll();
if(!title){ err.textContent='Please add a title.'; $('schTitle').classList.add('field-err'); $('schTitle').focus(); return; }
const ts=new Date(selDate.getFullYear(),selDate.getMonth(),selDate.getDate(),Math.floor(selMin/60),selMin%60,0,0).getTime();