%nn; [*list/list (ancestors)] [of] [person/persons]0%if;(e.surn!="") [by] [surname/surnames]0%end; [by] [place]%nn;

%include;css %include;hed %include;home %message_to_wizard;
%include;perso_utils %define;get_ip(n) %e.in; %end; %define;get_var(vv, i) %evar_cur.vv.i; %end; %define;get_pl(i) %e.pi; %end; %define;get_sub(nn,ss) %substr_start.nn.ss; %end; %( %qvar.index.marriage_places; renvoie une chaine avec les places de mariage, séparées par des | %) %define;get_marriage(myindex) %qvar.myindex.marriage_places; %end; %define;get_value(myindex,param) %qvar.myindex.param; %end;

# [*list/list (ancestors)] [of] [person/persons]1%if;(e.surn!="") [by] [surname/surnames]0%end; [by] [place]

[*date/dates]1 %nn; %nn; [*parents] %if;(e.nb!=1) [*sort by/branch/alphabetic order]0 %if;(e.datesort=1)[sort by/date begin/alphabetic order/nb individuals/nb events]2%nn; %else;[sort by/date begin/alphabetic order/nb individuals/nb events]1%end; %end;
%let;opt;%nn; %if;(e.bi="on")&bi=on%end;%nn; %if;(e.ba="on")&bp=on%end;%nn; %if;(e.ma="on")&ma=on%end;%nn; %if;(e.de="on")&de=on%end;%nn; %if;(e.bu="on")&bu=on%end;%nn; %if;(e.long="on")&long=on%end;%nn; %if;(e.f_sort="on")&f_sort=on%end;%in; %let;k;%if;(e.k!="")%e.k;%end;%in; %let;nbs;&nbs=%if;(e.nbs!="")%e.nbs;%else;3%end;%in; %define;book_of(xx)[*book of %s:::xx]%end; %define;evt(vv,tt,ii) %if;("vv"!="bi"), %end;%if;(e.vv!="on")%else;%end;tt ii%if;(e.vv!="on")%else;%end;%nn; %end;
%if;(e.surn!="")[*surname/surnames]0[:] %e.surn;.%end; [*event/events]1[:] %apply;evt("bi",[birth],"N") %apply;evt("ba",[baptism],"B") %apply;evt("ma",[marriage event],"M") %apply;evt("de",[death],"D") %apply;evt("bu",[burial],"S").
%define;nbmds(xx,yy,tt,kk) %if;(xx!="" and xx="kk")yy%nn; %else;%if;("tt"=1) %end; %end; %end; %define;nbmds_m(xx,yy,tt,kk) %if;(xx!="" and ("kk" is_substr xx or xx="kk"))yy%nn; %else;%if;("tt"=1) %end; %end; %end; %define;tags(xx,tt,ss) %let;myindex;xx%in; %let;birthplace;%apply;get_value(myindex, "birth_place_raw")%in; %let;baptismplace;%apply;get_value(myindex, "baptism_place_raw")%in; %let;marriageplace;%apply;get_marriage(myindex)%in; %let;deathplace;%apply;get_value(myindex, "death_place_raw")%in; %let;burialplace;%apply;get_value(myindex, "burial_place_raw")%in; %apply;nbmds("birthplace","N","tt","ss")%nn; %apply;nbmds("baptismplace","B","tt","ss")%nn; %apply;nbmds_m("marriageplace","M","tt","ss")%nn; %apply;nbmds("deathplace","D","tt","ss")%nn; %apply;nbmds("burialplace","S","tt","ss")%nn; %end; %empty_sorted_list %for;i;0;e.nb; %let;myindex;%apply;get_ip(i)%in; %let;first_name;%apply;get_value(myindex, "first_name")%in; %let;surname;%apply;get_value(myindex, "surname")%in; %let;occ;%apply;get_value(myindex, "occ")%in; %(TODO: would we want to sort by event dates? it was "dates_sort" before %) %let;dates;%apply;get_value(myindex, "dates")%in; %let;s;%apply;get_var("p", i)%in; %let;so;%if;(s="")%k;%else;%s;%end;%in; %apply;add_in_sorted_list%with; %so;%and; %if;(e.datesort=1)%dates;%else;%if;(e.surn="")%surname;%end;%first_name;%occ;%end;%and; %myindex;%and; %i;%and; %end; %end;
%foreach;sorted_list_item; %let;sub;%apply;get_sub(5, item.1)%in; %( was item.2 %) %if;(item.1!=prev_item.1 or prev_item.1="")
%if;wizard; %end; %if;(k!="")%nn; %item.1;%end; (%e.nb; %if;(e.nb>1)[person/persons]1%else;[person/persons]0%end;, %if;(e.datesort=1)[date/dates]1%else;[sort by/branch/alphabetic order]2%end;)
%end;
%let;myindex;%item.3;%in; %let;so;%item.1;%in; %let;access;%apply;get_value(myindex, "access")%in; %let;sex;%apply;get_value(myindex, "sex")%in; %apply;tags(myindex,"1", item.1)%nn; %nn; %apply;get_value(myindex, "first_name")%sp; %apply;get_value(myindex, "surname")%nn; %( Occurence number is hidden of those lists at the moment %let;occ;%apply;get_value(myindex, "occ")%in;%nn; %if;(occ!="0")%sp;%[%occ;%]%end;%)%nn; %if;(e.dates!=0) %apply;get_value(myindex, "dates")%nn; %end; %if;(e.parents!=0) %( TODO: father/mother need to test has_parents since v5! %) %let;fa;%apply;get_value(myindex, "father")%in; %let;mo;%apply;get_value(myindex, "mother")%in; %if;(fa!="" or mo!=""), %sp; %let;fa;%if;(fa="")?%else;%fa;%end;%in; %let;mo;%if;(mo="")?%else;%mo;%end;%in; %apply;a_of_b%with; %if;(sex=0)[son/daughter/child]0 %elseif;(sex=1)[son/daughter/child]1 %else;[son/daughter/child]2%end; %and;%fa; [and] %mo; %end; %end; %end;
%end;
%let;max_rlm_nbr;%if;(e.max_rlm_nbr!="")%e.max_rlm_nbr;%elseif;(b.max_rlm_nbr!="")%b.max_rlm_nbr;%else;80%end;%in; %( RLM commence a i1 et non i0 on décale i(0) en i(nb), à défaut on pourrait aussi tout décaller à i+1 %)
%if;(e.nb!=1 and e.nb [*multi relations graph] %else; %e.nb; [person/persons]1[:] [too big to draw RLM graph] (max %max_rlm_nbr;) %end;
%base_trailer; %include;copyr
%include;js