%nn; %if;(mrg=1)[*merge::person/persons]1 %elseif;(mod=1)[*modify::person/persons]0 %else;[*add::person/persons]0 %end; # %index;%nn;

%let;mrg;%if;(e.m="MRG_IND_OK" or e.m="MRG_MOD_IND_OK")1%end;%in; %let;mod;%if;(e.m="MOD_IND" or e.m="MOD_IND_OK")1%end;%in; %include;css %include;hed
%message_to_wizard; %( do not use %include;perso_header %) %include_perso_header; %define;nav()
%end; %define;card_header(xx,yy)

### [*yy]1

%end; %define;date(xlab,xvar,xdt,xcond) %let;day_input;pattern="(?:0?[1-9]|1[0-9]|2[0-9]|3[0-1])" size="2" maxlength="2" xcond%in; %let;month_input;pattern="(?:0?[1-9]|1[0-2]|VD|BR|FM|NI|PL|VT|GE|FL|PR|ME|TH|FT|JC|vd|br|fm|ni|pl|vt|ge|fl|pr|me|th|ft|jc)" size="1" maxlength="2" xcond%in; %let;year_input;pattern="[?><~/-+]?\d*/?" size="4" maxlength="8" xcond%in;
xlab
%if;([!dates order]0 = "ddmmyy" or [!dates order]0 = "ddmmyyyy" or [!dates order]0 = "dmyyyy") [year/month/day]2 [year/month/day]1 [year/month/day]0 %elseif;([!dates order]0 = "mmddyyyy") [year/month/day]1 [year/month/day]2 [year/month/day]0 %else; [year/month/day]0 [year/month/day]1 [year/month/day]2 %end;
[precision]0
[calendar/calendars]0
%if;([!dates order]0 = "ddmmyy" or [!dates order]0 = "ddmmyyyy" or [!dates order]0 = "dmyyyy") [year/month/day]2 [year/month/day]1 [year/month/day]0 %elseif;([!dates order]0 = "mmddyyyy") [year/month/day]1 [year/month/day]2 [year/month/day]0 %else; [year/month/day]0 [year/month/day]1 [year/month/day]2 %end;
%end; %define;small_date(kind,xvar,xx,verbose) %let;day_input;pattern="(?:0?[1-9]|1[0-9]|2[0-9]|3[0-1])" size="2" maxlength="2"%in; %let;month_input;pattern="(?:0?[1-9]|1[0-2]|VD|BR|FM|NI|PL|VT|GE|FL|PR|ME|TH|FT|JC|vd|br|fm|ni|pl|vt|ge|fl|pr|me|th|ft|jc)" size="1" maxlength="2"%in; %let;year_input;pattern="[?><~/-+]?\d*/?" size="4" maxlength="8"%in;
[*kind]
%if;([!dates order]0 = "ddmmyy" or [!dates order]0 = "ddmmyyyy" or [!dates order]0 = "dmyyyy") [year/month/day]2 [year/month/day]1 [year/month/day]0 %elseif;([!dates order]0 = "mmddyyyy") [year/month/day]1 [year/month/day]2 [year/month/day]0 %else; [year/month/day]0 [year/month/day]1 [year/month/day]2 %end;
[place]%nn;
%end; %define;birth(xvar,xx,verbose) %apply;small_date("birth","xvarb","xx","verbose") %end; %define;death(xvar,xx,verbose) %apply;small_date("death","xvard","xx","verbose") %end; %define;w_birth(xcnt, wcnt,xx,verbose) %apply;small_date("birth","excnt_witnwcnt_b","witness","verbose") %end; %define;w_death(xcnt, wcnt,xx,verbose) %apply;small_date("death","excnt_witnwcnt_d","witness","verbose") %end; %define;note(xx)
[*note/notes]1
%xx_note;
%end; %define;source(xx)
[*source/sources]0
%xx_src;
%end; %define;selector_pevent(xcnt)
%end; %define;insert_pevent(xcnt)
[*insert]
[event/events]0/[event/events]1
%end; %define;insert_witness(xcnt, wcnt, evt_name)
[*insert]
[witness/witness/witnesses]0/[witness/witness/witnesses]2
%(

[*insert] [nouveau(x)::witness/witnesses]0 %if;("evt_name" = "#bapt")/ [godfather/godmother/godparents]2%end;

%) %end; %define;one_witness(xcnt, wcnt, evt_name)

##### [*witness/witness/witnesses]0 wcnt

[*first name/first names]0
[*number]0
[*surname/surnames]0
%nn; %if;(witness.index!="-1") [*modify] %apply;nth%with;[nth]%and;%wcnt;%end; [witness/witness/witnesses]0 %end;
[*sex]
[M/F]0%nn;
?%nn;
[M/F]1%nn;
[*occupation/occupations]0
[*of course dead]
[*public]
%end; %define;one_pevent(xcnt) %if;(event.e_name != "#birt" and event.e_name != "#bapt" and event.e_name != "#deat" and event.e_name != "#buri" and event.e_name != "#crem")

##### [*event/events]0 %(xcnt needs a count fonction%)

%apply;selector_pevent(xcnt)
[*place]
%apply;date([*date/dates]0, "e_datexcnt", "event_date", "")
[*note/notes]1
%event.e_note;
[*source/sources]0
%if;(event.e_src!="") %event.e_src; %else; %end;
%if;has_witness; %foreach;witness; %apply;one_witness(xcnt, wcnt, "") %if;is_last;%apply;insert_witness(xcnt, wcnt, "")%end; %end; %else; %apply;insert_witness(xcnt, "0", "") %end;

%end; %end; %define;one_specific_pevent(xcnt, evt_name) %if;(event.e_name = "evt_name") %if;("evt_name" = "#deat")
Type
[*killed (in action)]2
[*murdered]2
[*executed (legally killed)]2
[*disappeared]2
[*unspecified]2
%end; %if;("evt_name" = "#buri" or "evt_name" = "#crem")
Type
%end;

[*event/events]0 |

[*place]
%apply;date%with;[*date/dates]0%and;e_datexcnt%and;event_date%and;%if;("evt_name" = "#deat")onfocus='set_death_focus(xcnt)'%end;%end;
[*note/notes]1
%event.e_note;
[*source/sources]0
%if;(event.e_src!="") %event.e_src; %else; %end;
%if;has_witness; %foreach;witness; %apply;one_witness(xcnt, wcnt, "evt_name") %if;is_last;%apply;insert_witness(xcnt, wcnt, "evt_name")%end; %end; %else; %apply;insert_witness(xcnt, "0", "evt_name") %end; %end; %end; %define;one_empty_specific_pevent(xcnt, evt_name) %if;("evt_name" = "#deat")
[*killed (in action)]2
[*murdered]2
[*executed (legally killed)]2
[*disappeared]2
[*unspecified]2
%end; %if;("evt_name" = "#buri" or "evt_name" = "#crem" or "evt_name" = "buri_or_crem")
%end;

[*event/events]0 |

[*place]
%if;("evt_name"="#deat") %apply;date([*date/dates]0, "e_datexcnt", "event_date", "onfocus='set_death_focus(xcnt)'") %elseif;("evt_name"="buri_or_crem") %apply;date([*date/dates]0, "e_datexcnt", "event_date", "onfocus='set_buri(xcnt)'") %else; %apply;date([*date/dates]0, "e_datexcnt", "event_date", "") %end;
[*note/notes]1
[*source/sources]0
%( %if;("evt_name" = "#bapt") %apply;one_empty_witness(xcnt, "1", "evt_name") %apply;one_empty_witness(xcnt, "2", "evt_name") %end; %if;("evt_name" = "#bapt") %apply;insert_witness(xcnt, "1", "evt_name") %else; %apply;insert_witness(xcnt, "0", "evt_name") %end; %) %apply;insert_witness(xcnt, "0", "evt_name") %end; %let;l_on1s;onkeydown="if (event.keyCode == 13) if (!event.shiftKey) javascript:document.upd.submit()"%in;
%apply;nav()
%hidden; %if;(mrg=1) %if;(evar_i2 != "") %end; %if;(evar_ini1 != "" and evar_ini2 != "") %end; %if;(evar.iexcl != "" or evar.fexcl != "") %if;(evar.iexcl != "") %end; %if;(evar.fexcl != "") %end; %end; %elseif;(mod=1) %else; %end;

## %nn; %if;(mrg=1)[*merge::person/persons]1%nn; %elseif;(mod=1)[*modify::person/persons]0%nn; %else;[*add:person/persons]0%end;[:] %first_name; %surname;%if;(occ!="0") (%occ)%end;

##### [*other action][:] [*invert::event/events]1%nn; %if;(first_name!="?" and surname!="?") | [*modify::]/[delete::]/[add picture] %end; | [*merge::] | [*delete::]

[*first name/first names]0
[*number]0
[*surname/surnames]0
[*sex]
[M/F]0
?
[M/F]1
[*public name]
[*image/images]0
[*access]0
[*if titles]0
[*public]0
[*private]0
%if;has_qualifiers; %foreach;qualifier;
[*qualifier]0
[*insert::qualifier]
%end; %elseif;(b.propose_qualifier!="no")
[*qualifier]0
[*insert::qualifier]
%end; %if;has_aliases; %foreach;alias;
[*alias]0
[*insert::alias]
%end; %elseif;(b.propose_alias!="no")
[*alias]0
[*insert::alias]
%end; %if;has_first_names_aliases; %foreach;first_name_alias;
[*first name alias]0
[*insert::first name alias]
%end; %else;
[*first name alias]0
[*insert::first name alias]
%end; %if;has_surnames_aliases; %foreach;surname_alias;
[*surname alias]0
[*insert::surname alias]
%end; %else;
[*surname alias]0
[*insert::surname alias]
%end;
[*occupation/occupations]1
%if;(occupation!="") %occupation; %else; %end;
[*source/sources]0
%if;(sources!="") %sources; %else; %end;
%apply;card_header("birth","birth")
[*born]2… [*place] %apply;date([*date/dates]0, "birth", "birth", "") %apply;note("birth") %apply;source("birth")
%if;has_pevent_birth; %foreach;pevent; %apply;one_specific_pevent(cnt, "#birt") %end; %else; %apply;one_empty_specific_pevent%with;%next_pevent;%and;#birt%end; %incr_next_pevent; %end;
%apply;card_header("baptism","baptism")
[*baptized]2… [*place] %apply;date([*date/dates]0, "bapt", "bapt", "") %apply;note("bapt") %apply;source("bapt")
%if;has_pevent_baptism; %foreach;pevent; %apply;one_specific_pevent(cnt, "#bapt") %end; %else; %apply;one_empty_specific_pevent%with;%next_pevent;%and;#bapt%end; %incr_next_pevent; %end;
%apply;card_header("death","death")

| [*place]0

%apply;date([*date/dates]0, "death", "death", "onfocus='setDead()'")

[*killed (in action)]2 [*murdered]2 [*executed (legally killed)]2 [*disappeared]2 [*unspecified]2

%apply;note("death") %apply;source("death")
%if;has_pevent_death; %foreach;pevent; %apply;one_specific_pevent(cnt, "#deat") %end; %else; %apply;one_empty_specific_pevent%with;%next_pevent;%and;#deat%end; %incr_next_pevent; %end;
%apply;card_header("burial","burial")

| [*place]0

%apply;date([*date/dates]0, "burial", "burial", "") %apply;note("burial") %apply;source("burial")
%if;has_pevent_burial; %foreach;pevent; %apply;one_specific_pevent(cnt, "#buri") %end; %end; %if;has_pevent_cremation; %if;has_pevent_burial;

%end; %foreach;pevent; %apply;one_specific_pevent(cnt, "#crem") %end; %end; %if;(not has_pevent_burial and not has_pevent_cremation) %apply;one_empty_specific_pevent%with;%next_pevent;%and;buri_or_crem%end; %incr_next_pevent; %end;
%apply;card_header("events","event/events")
%if;has_secondary_pevents; %foreach;pevent; %apply;one_pevent(cnt) %end; %apply;insert_pevent%with;%next_pevent;%end; %incr_next_pevent; %else; %apply;insert_pevent%with;%next_pevent;%end; %incr_next_pevent; %end;
%define;insert_relation(xx)
[*insert]
1 [relation/relations]0
%end; %define;relation_type(xx)

##### [*relation/relations]0 xx

%end; %define;one_relation(xcnt,xvar,xrel,xsex)
[*first name/first names]0
[*number]0
[*surname/surnames]0
%if;(relation.xrel.index!="-1") [*modify] %end;
[*occupation/occupations]0
[*of course dead]
[*public]
%end;
%apply;card_header("relations","relation/relations")
%apply;insert_relation("0") %if;has_relations; %foreach;relation;

%apply;relation_type(cnt) %apply;one_relation(cnt,"fath","r_father",[M/F]0) %apply;one_relation(cnt,"moth","r_mother",[M/F]1)

%apply;insert_relation(cnt) %end; %else;

%apply;relation_type("1") %apply;one_relation("1","fath","r_father",[M/F]0) %apply;one_relation("1","moth","r_mother",[M/F]1)

%apply;insert_relation("1") %end;
%define;insert_title(xcnt)
[*insert]
[title/titles]0/[title/titles]1
%end; %define;one_title(xcnt)

[*title/titles]0
[*estate]0
[*name]0
[*nth]0
[*main title]0
%apply;date([*begin]0, "t_date_startxcnt", "title_date_start", "") %apply;date([*end]0, "t_date_endxcnt", "title_date_end", "") %end;
%apply;card_header("titles","title/titles")
%apply;insert_title("0") %if;has_titles; %foreach;title; %apply;one_title(cnt)

%apply;insert_title(cnt) %end; %else; %apply;one_title("1")

%apply;insert_title("1") %end;
%apply;card_header("notes","note/notes")
%include;toolbar
%notes;%sq;
%include;accent
%base_trailer; %include;copyr
%include;js %include;upd_js