%nn; %apply;a_of_b%with;[*descendants]%and;%self;%end; %sp;[up to] %e.v; %if;(e.v>1)[generation/generations]1%else;[generation/generations]0%end;

%include;css %include;hed %include;perso_utils %message_to_wizard;
%if;not cancel_links; %include;menubar %end; %define;tothegen(xxx) %if;(e.v>0)[to the %s generation:::xxx]%end; %end;

# %nn; %if;(e.v!=0)%apply;a_of_b%with; %if;(e.only!="on" and e.v!=0)[*descendants]%else; %apply;capitalize%with;%apply;gend("v")%end;%( TODO: look why gend no more defined ! %) %end;%and; %self;%end;%else;%self; ([no descendants])%end; %if;(cancel_links and e.v!=0) %apply;togend(e.v)%end;

%if;not cancel_links; %include;buttons %end; %define;link(aaa,xxx,nnn) %if;(e.cgl="on")xxx%else;xxx%end; %end; %define;date_popup(xxx,yyy) %let;symb;%if;("yyy"="birth")°%elseif;("yyy"="death" and xxx.is_dead)†%end;%in; %if;(e.yyy="on" and famx=1) %if;(wizard and not cancel_links) %nn; %if;(xxx.has_yyy_date)%xxx.slash_yyy_date;%else;%symb;%end;%nn; %else; %if;xxx.has_yyy_date;%xxx.slash_yyy_date;%elseif;(not cancel_links)%symb;%end; %end; %end; %end; %define;place_popup(xxx,yyy) %if;(e.yyy_place="on" and famx=1) %nn; %if;xxx.has_yyy_place;%xxx.yyy_place;%end; %end; %end; %(si t=H on active rowspan pour les données de l’individu et du couple si t=I on n’affiche pas les données xxx est la personne concernée (self) zzz est lui même si yyy="desc" ou son conjoint si yyy="spous" %) %define;table_row(xxx, prefx, fff, fam_cnt, ch_cnt, ch_count, yyy, zzz, ddd, nb_ch_desc, implx) %let;famx;%if;(not has_families or e.t="I")1%else;fam_cnt%end;%in; %let;labl;%if;("prefx"="-1")1%else;%if;("prefx"!="")prefxfff.%end;ch_count%end;%in; %let;labl0;%if;("prefx"="-1")1%else;%if;("prefx"!="")prefxfff.%end;ch_cnt%end;%in; %let;rowspan;%if;(nb_families>1 and e.t="H" and (e.marr="on" or e.marr_date="on" or e.marr_place="on" or e.child="on")) rowspan="%xxx.nb_families;"%end;%in;
%( numéro d'Aboville %) %if;(e.num="on" and famx=1) %if;("yyy"="desc") %if;(labl!=1 and not cancel_links) %nn; %end; %if;not cancel_links;%labl;%else;%labl;%end; %elseif;(e.t="I") %if;(not cancel_links) %nn; %end; %if;(has_families and nb_families>1)%apply;letter(family_cnt)%else; %end;%nn; %if;(not cancel_links) %end; %end; %end; %( Descendant et son conjoint en mode I %) %if;(famx=1) %if;("yyy"="desc") %apply;add_in_sorted_list(xxx.index) %apply;add_in_sorted_listc(xxx.index)
%apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%if;(e.fn=1)%xxx.first_name; %xxx.surname;%else;%xxx;%end;%and;%xxx.index;%end; %if;(e.tt=1 and xxx.title!=""), %xxx.title;%end;
%if;(e.im="" and xxx.has_image) %end;
%elseif;(e.t="I") %apply;add_in_sorted_list(xxx.index) %apply;add_in_sorted_listc(xxx.index)
%if;(e.im="" and xxx.has_image) %else;
%end;
%apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%if;(e.fn=1)%xxx.first_name; %xxx.surname;%else;%xxx;%end;%and;%xxx.index;%end; %if;(e.tt=1 and xxx.title!=""), %xxx.title;%end;
%end; %end; %( Date de naissance %) %apply;date_popup%with;xxx%and;birth%end; %( Lieu de naissance %) %apply;place_popup%with;xxx%and;birth%end; %( Date de baptême %) %apply;date_popup%with;xxx%and;baptism%end; %( Lieu de baptême %) %apply;place_popup%with;xxx%and;baptism%end; %( En mode H, conjoints %) %if;(e.marr="on" and e.t="H") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;(family_cnt=fam_cnt) %nn; %apply;add_in_sorted_list(spouse.index) %if;(zzz.nb_families>1)%apply;letter(family_cnt)%end; %apply;image_MF("spouse") %apply;link%with;%spouse.access;%and;%if;(e.fn=1)%spouse.first_name; %spouse.surname;%else;%spouse;%end;%and;%spouse.index;%end; %if;(e.tt=1 and spouse.title!=""), %spouse.title;%end; %end; %end; %end; %end; %( Date de mariage %) %if;(e.marr_date="on") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;((nb_families=1 and "yyy"="desc") or (nb_families>1 and ((xxx.spouse=zzz and (ddd=family.index)) or (xxx=zzz and family_cnt=fam_cnt and e.t="H")))) %if;(wizard and not cancel_links) %nn; %if;(slash_marriage_date!="")%slash_marriage_date;%else; %end; %nn; %else; %slash_marriage_date; %end; %end; %end; %if;(e.t="I" and nb_families>1 and "yyy"="desc") %end; %end; %end; %( Lieu de mariage %) %if;(e.marr_place="on") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;((nb_families=1 and "yyy"="desc") or (nb_families>1 and ((xxx.spouse=zzz and ddd=family.index) or (xxx=zzz and family_cnt=fam_cnt and e.t="H")))) %nn; %if;(marriage_place!="") %marriage_place;%nn; %end; %end; %end; %if;(e.t="I" and nb_families>1 and "yyy"="desc") %end; %end; %end; %reset_count2; %( Calcul nombre total d'enfants %) %if;(zzz.has_families) %foreach;zzz.family; %if;zzz.has_children; %foreach;zzz.child; %incr_count2; %end; %end; %end; %end; %let;nb_ch_tot_desc;%count2;%in; %reset_count2; %( Calcul nombre d'enfants de l'époux %) %if;(e.t="I") %if;(xxx.has_families) %foreach;xxx.family; %if;xxx.has_children; %foreach;xxx.child; %incr_count2; %end; %end; %end; %end; %else; %if;(xxx.has_families and xxx.spouse.has_families) %foreach;xxx.spouse.family; %if;xxx.spouse.has_children; %foreach;xxx.spouse.child; %incr_count2; %end; %end; %end; %end; %end; %let;nb_ch_tot_spous;%count2;%in; %( Nombre d'enfants %) %if;(e.child="on") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;((nb_families=1 and "yyy"="desc") or (nb_families>1 and ((xxx.spouse=zzz and (ddd=family.index)) or (xxx=zzz and family_cnt=fam_cnt and e.t="H")))) %nn; %if;(nb_children>0 and not cancel_links)%end; %if;("yyy"="desc" and e.t="I") %nb_ch_tot_desc;%if;(nb_ch_tot_desc!=nb_ch_tot_spous)/%nb_ch_tot_spous;%(!! nb_ch_tot_spous is wrong: gives father total of children?! %)%end; %else; nb_ch_desc%if;(nb_ch_desc!=nb_ch_tot_spous)/%nb_ch_tot_spous;%end; %end; %if;(nb_children>0 and not cancel_links)%end; %end; %end; %if;(e.t="I" and nb_families>1 and "yyy"="desc") %nb_ch_tot_desc; %end; %end; %end; %( Date du décès %) %apply;date_popup%with;xxx%and;death%end; %( Lieu de naissance %) %apply;place_popup%with;xxx%and;death%end; %( Date de la sépulture %) %apply;date_popup%with;xxx%and;burial%end; %( Lieu de la sépulture %) %apply;place_popup%with;xxx%and;burial%end; %( Âge %) %if;(e.age="on" and famx=1) %nn; %if;xxx.computable_death_age;%xxx.death_age;%end;%nn; %if;xxx.computable_age;%xxx.age;%end;%nn; %end; %( Profession %) %if;(e.occu="on" and famx=1) %nn; %if;(xxx.has_occupation) %xxx.occupation%nn; %end; %end;
%end; %define;one_child(xxx, prefx, fff, ch_cnt) %incr_count; %( Les enfants d'une personne sont numérotés de 1 à n indépendamment du nombre de mariages %) %let;prfx;%if;("prefx"="-1")%else;prefx%end;%in; %if;(e.t="A") %( d’Aboville %)
%prfx; %apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%xxx.first_name; %xxx.surname;%nn;%and;%xxx.index;%end;%nn; %xxx.title;%nn; %if;(has_families) %foreach;family; %if;(wizard and not cancel_links) %if;(slash_marriage_date!="")%slash_marriage_date;%else;%end;%nn; %else; %slash_marriage_date;%nn; %end; %apply;image_MF("xxx.spouse") %apply;link%with;%xxx.spouse.access;%and;%xxx.spouse.first_name; %xxx.spouse.surname;%and;%xxx.index;%end;%nn; %xxx.spouse.title; %end; %end; %elseif;xxx.has_families; %if;(e.t="H") %foreach;family; %let;ifam;%family.index;%in; %reset_count1; %foreach;sorted_listb_item; %if;(item.1=ifam) %incr_count1; %end; %end; %reset_count2; %foreach;sorted_listc_item; %if;(item.1=index) %incr_count2; %end; %end;%(DEBUG1|xxx.spouse/%prfx;/fff/%family_cnt;/ch_cnt/%count;/desc/xxx/%family.index;/%nb_children;/%expr(count1+count2)|
%) %if;(count1=0 or count2=0 or e.implx="") %apply;table_row%with;xxx%and;%prfx;%and;fff%and;%family_cnt;%and;ch_cnt%and;%count;%and;desc%and;xxx%and;%ifam;%and;%nb_children;%and;%expr(count1+count2)%end; %end; %apply;add_in_sorted_listb(ifam) %end; %elseif;(e.t="I") %reset_count1; %foreach;sorted_listc_item; %if;(item.1=index) %incr_count1; %end; %end;%(DEBUG2|xxx/%prfx;/fff/%family_cnt;/ch_cnt/%count;/desc/xxx/0/%nb_children;/%count1;|
%) %if;(count1=0 or e.implx="") %apply;table_row%with;xxx%and;%prfx;%and;fff%and;%family_cnt;%and;ch_cnt%and;%count;%and;desc%and;xxx%and;0%and;%nb_children;%and;%count1;%end; %end; %apply;add_in_sorted_listc(index) %if;(e.marr="on" or e.marr_date="on" or e.marr_place="on" or e.child="on") %foreach;family; %let;ifam;%family.index;%in; %reset_count1; %foreach;sorted_listb_item; %if;(item.1=ifam) %incr_count1; %end; %end; %reset_count2; %foreach;sorted_listc_item; %if;(item.1=spouse.index) %incr_count2; %end; %end;%(DEBUG3|xxx.spouse/%prfx;/fff/%family_cnt;/ch_cnt/%count;/spous/xxx/%family.index;/%nb_children;/%expr(count1+count2)|
%) %if;(count1=0 or count2=0 or e.implx="") %apply;table_row%with;xxx.spouse%and;%prfx;%and;fff%and;%family_cnt;%and;ch_cnt%and;%count;%and;spous%and;xxx%and;%family.index;%and;%nb_children;%and;%expr(count1+count2)%end; %end; %apply;add_in_sorted_listb(ifam) %end; %end; %end; %else; %reset_count1; %foreach;sorted_listc_item; %if;(item.1=xxx.index) %incr_count1; %end; %end;%(DEBUG4|xxx/%prfx;/fff//ch_cnt/%count;/desc/xxx/0/0/%count1;|
%) %if;(count1=0 or e.implx="") %apply;table_row%with;xxx%and;%prfx;%and;fff%and;%and;ch_cnt%and;%count;%and;desc%and;xxx%and;0%and;0%and;%count1;%end; %end; %apply;add_in_sorted_listc(xxx.index) %end; %end; %define;families_of_one_p(xxx, prefx) %reset_count; %foreach;family; %let;fam;%if;(nb_families>1)%apply;letter(family_cnt)%end;%in; %(%if;(nb_children>0)
one family: #labl
%end;%) %foreach;xxx.child; %apply;one_child("xxx", "prefx", fam, child_cnt) %end; %end; %end; %( d’Aboville %) %define;list_row(xxx, prefx, fam_cnt, ch_cnt) %let;fam;%if;(fam_cnt>0)%apply;letter(fam_cnt)%end;%in; %if;("prefx"!="")
prefx.%end; %sp;%apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%xxx.first_name; %xxx.surname;%and;%xxx.index;%end;%nn; %if;(xxx.title!=""), %xxx.title;%end; %if;(has_families) %foreach;family; &%if;(nb_families>1)%apply;letter(family_cnt)%end; %if;(wizard and not cancel_links) %if;(marriage_date.year!="")%marriage_date.year;%else;%end;%nn; %else; %marriage_date.year;%nn; %end; %sp;%apply;image_MF("xxx.spouse") %apply;link%with;%xxx.spouse.access; %and;%xxx.spouse.first_name; %xxx.spouse.surname;%and;%xxx.spouse.index; %end; %if;(xxx.spouse.title!=""), %xxx.spouse.title;%end; %( (%xxx.nb_children; %if;(1=0 or 1=0 and xxx.spouse.has_families and xxx.spouse.nb_children0)%apply;letter(fam_cnt)%end;%in; %let;nnpref;%npref;%fam;%in; %if;(lv1)%family_cnt;%else;0%end;%in; %if;(has_children) %foreach;child; %let;nnnpref;%nnpref;%if;(npref!="").%end;%child_cnt;%nn;%in; %apply;one_person("child", lv+1, max_l, nnnpref, nfam, child_cnt) %end; %end; %end; %end; %else; %apply;list_row("xxx", nnpref, fam_cnt, ch_cnt) %end; %end; %( Parcours de l'arbre, horizontal, niveau par niveau descendant %) %( À chaque niveau, prefx et faml (lettre) définissent le préfixe d'Aboville %) %define;one_level(xxx, lv, max_l, prefx, faml, ch_cnt) %let;npref;%if;("prefx"!="")prefxfaml.%end;ch_cnt%nn;%in; %if;(lv1)%apply;letter(family_cnt)%end;%in; %foreach;child; %apply;one_level("child", lv+1, max_l, npref, fam, child_cnt) %end; %end; %end; %else; %apply;families_of_one_p("self", npref) %end; %end; %define;desc_count(vvv,ooo,nnn,ttt,ccc)%( lev, only=1, name=1, total=1, count2 %) %reset_count1;%reset_count2; %foreach;descendant_level; %if;(level=vvv) %if;(ooo=0) %if;(number_of_descendants=1)%incr_count1;%if;(ttt!=1)1%end; %else;%number_of_descendants;%nn; %end; %if;(number_of_descendants=ccc)%incr_count2;%end; %else; %if;(number_of_descendants_at_level=1)%incr_count1;%if;(ttt!=1)1%end; %else;%number_of_descendants_at_level;%nn; %end; %if;(number_of_descendants_at_level=ccc)%incr_count2;%end; %end; %end; %end; %if;(nnn=1)%( show names %) %if;(count1=1) %if;(ttt=1)1 [person/persons]0 %else; %if;(vvv<10) [cousins.0.vvv]0%else; [person/persons]0%end; %end; %else; %if;(ttt=1) [descendants]%nn; %else; %if;(vvv<10) [cousins.0.vvv]1%else; [person/persons]1%end; %end; %end; %if;(ttt=1 and count2!=1) %if;(ooo=1) (ccc [person/persons]1 [with] [spouse/spouses]1)%nn; %else; %if;(e.marr="on" or e.t="I") (ccc [person/persons]1 [with root, spouses and unknowns])%end; %end; %end; %end; %end; %( Main %)

%if;(e.t="A") %let;nb_col;1%in; %apply;one_person("self", 0, e.v, "", 0, 0) %else; %reset_count; %( table_header defined in perso_utils for both tables %) %apply;table_header() %let;nb_col;%expr(count)%in; %let;max;%e.v;%in; %reset_count; %empty_sorted_list; %( persons %) %empty_sorted_listb; %( families %) %empty_sorted_listc; %if;(e.only!="on") %apply;one_child("self", "-1", "", 1) %for;lev;0;max; %if;(e.gen=1 and lev [*generation/generations]0 %expr(lev+1) %apply;desc_count(lev+1,1,1,0,0) %end; %apply;one_level("self", 0, lev, "", "", 1) %end; %else; %if;(e.v=0) %apply;one_child("self", "-1", "", 1) %else; %apply;one_level("self", 0, e.v-1, "", "", 1) %end; %end; %end;

[*total][:] %if;(e.only="on") %apply;desc_count(e.v,1,1,1,list_size) %else; %apply;desc_count(max_desc_level,0,1,1,list_size) %end;
%base_trailer; %include;copyr
%include;js