Permalink
Browse files

TO BE REMOVED: revert some changes in geneweb

  • Loading branch information...
sagotch committed Aug 10, 2018
1 parent a810ba1 commit 4600b08792203211df6d9ff7f31d7bd46c9d2618
@@ -1581,7 +1581,6 @@ let find_event_witness gen tag ip r =
match find_field "RELA" r.rsons with
Some rr ->
if rr.rval = "GODP" then Witness_GodParent
else if rr.rval = "officer" then Witness_Officer
else Witness
| _ -> Witness
in
@@ -1592,7 +1591,6 @@ let find_event_witness gen tag ip r =
match find_field "RELA" r.rsons with
Some rr ->
if rr.rval = "GODP" then Witness_GodParent
else if rr.rval = "officer" then Witness_Officer
else Witness
| _ -> Witness
in
@@ -1616,7 +1614,6 @@ let find_fevent_witness gen tag ifath r =
match find_field "RELA" r.rsons with
Some rr ->
if rr.rval = "GODP" then Witness_GodParent
else if rr.rval = "officer" then Witness_Officer
else Witness
| _ -> Witness
in
@@ -1627,7 +1624,6 @@ let find_fevent_witness gen tag ifath r =
match find_field "RELA" r.rsons with
Some rr ->
if rr.rval = "GODP" then Witness_GodParent
else if rr.rval = "officer" then Witness_Officer
else Witness
| _ -> Witness
in
@@ -1355,8 +1355,7 @@ let find_fevent_witness gen tag ifath r =
match find_field "RELA" r.rsons with
Some rr ->
if rr.rval = "GODP" then Witness_GodParent
else if rr.rval = "officer" then Witness_Officer
else Witness
else Witness
| _ -> Witness
in
(witness, witness_kind) :: find_witnesses asso_l
@@ -1366,7 +1365,6 @@ let find_fevent_witness gen tag ifath r =
match find_field "RELA" r.rsons with
Some rr ->
if rr.rval = "GODP" then Witness_GodParent
else if rr.rval = "officer" then Witness_Officer
else Witness
| _ -> Witness
in
@@ -378,7 +378,6 @@ let ged_pevent base oc per_sel evt =
match wk with
Witness -> Printf.fprintf oc "3 RELA witness\n"
| Witness_GodParent -> Printf.fprintf oc "3 RELA GODP\n"
| Witness_Officer -> Printf.fprintf oc "3 RELA officer\n"
end)
evt.epers_witnesses

@@ -611,7 +610,6 @@ let ged_fevent base oc ifam fam_sel evt =
match wk with
Witness -> Printf.fprintf oc "3 RELA witness\n"
| Witness_GodParent -> Printf.fprintf oc "3 RELA GODP\n"
| Witness_Officer -> Printf.fprintf oc "3 RELA officer\n"
end)
evt.efam_witnesses

@@ -169,7 +169,6 @@ enum EventName {
enum WitnessType {
WITNESS = 0;
WITNESS_GODPARENT = 1;
WITNESS_OFFICER = 2;
}

message WitnessEvent {
@@ -851,7 +851,6 @@ let fill_events conf base p base_prefix p_auth pers_to_piqi_callback witness_con
match wk with
| Witness -> `witness
| Witness_GodParent -> `witness_godparent
| Witness_Officer -> `witness_officer
in
let witness = poi base ip in
let witness = pers_to_piqi_callback conf base witness base_prefix in
@@ -92,7 +92,6 @@ enum RelationType {
enum WitnessType {
WITNESS = 0;
WITNESS_GODPARENT = 1;
WITNESS_OFFICER = 2;
}

enum EventType {
@@ -23,7 +23,6 @@ enum Calendar {
enum WitnessType {
WITNESS = 0;
WITNESS_GODPARENT = 1;
WITNESS_OFFICER = 2;
}

enum Precision {
@@ -81,9 +80,6 @@ message PersonSearch {
optional string image = 6;
required Sosa sosa = 7;
required string family = 8;
required string n = 9;
required string p = 10;
required int32 oc = 11;
}

message SimplePerson {
@@ -91,7 +91,6 @@ let reconstitute_family conf base mod_f =
match witness.Mwrite.Witness.witness_type with
| `witness -> Witness
| `witness_godparent -> Witness_GodParent
| `witness_officer -> Witness_Officer
in
let wit = (reconstitute_somebody base person, wk) in
wit :: accu
@@ -254,7 +254,6 @@ let reconstitute_person conf base mod_p =
match witness.Mwrite.Witness.witness_type with
| `witness -> Witness
| `witness_godparent -> Witness_GodParent
| `witness_officer -> Witness_Officer
in
let wit = (reconstitute_somebody base person, wk) in
wit :: accu
@@ -767,9 +767,6 @@ let pers_to_piqi_person_search conf base p =
image = if image = "" then None else Some image;
sosa = sosa;
family = family;
n = Name.lower (p_surname base p);
p = Name.lower (p_first_name base p);
oc = Int32.of_int (get_occ p);
}


@@ -887,7 +884,6 @@ let pers_to_piqi_person_search_info conf base p =
match wk with
| Witness -> `witness
| Witness_GodParent -> `witness_godparent
| Witness_Officer -> `witness_officer
in
let witness = poi base ip in
let witness =
@@ -1338,7 +1334,6 @@ let pers_to_piqi_mod_person conf base p =
match wk with
| Witness -> `witness
| Witness_GodParent -> `witness_godparent
| Witness_Officer -> `witness_officer
in
let p = poi base ip in
let person_link = pers_to_piqi_person_link conf base p in
@@ -1587,7 +1582,6 @@ let fam_to_piqi_mod_family conf base ifam fam =
match wk with
| Witness -> `witness
| Witness_GodParent -> `witness_godparent
| Witness_Officer -> `witness_officer
in
let p = poi base ip in
let person_link = pers_to_piqi_person_link conf base p in
@@ -1852,7 +1852,6 @@ let pers_to_piqi_app_person conf base p =
match wk with
| Witness -> `witness
| Witness_GodParent -> `witness_godparent
| Witness_Officer -> `witness_officer
in
let index = Int32.of_int (Adef.int_of_iper ip) in
Mapp.Witness_event.({
@@ -228,10 +228,11 @@ let rec print_descend_upto conf base max_cnt ini_p ini_br lev children =
let sibling_has_desc_lev conf base lev (ip, _) =
has_desc_lev conf base lev (pget conf base ip)

let print_cousins_side_of conf base max_cnt a ini_p ini_br lev1 lev2 =
let print_cousins_side_of conf base max_cnt a ini_p ini_br lev1 lev2 tips =
let sib = siblings conf base (get_key_index a) in
if List.exists (sibling_has_desc_lev conf base lev2) sib then
begin
if tips then Util.print_tips_relationship conf ;
if lev1 > 1 then
begin
Wserver.printf "<li>\n";
@@ -257,25 +258,22 @@ let print_cousins_lev conf base max_cnt p lev1 lev2 =
loop Sosa.one lev1
in
let last_sosa = Sosa.twice first_sosa in
Wserver.printf "<div>\n";
Util.print_tips_relationship conf;
Wserver.printf "</div>\n";
if lev1 > 1 then Wserver.printf "<ul>\n";
let some =
let rec loop sosa some =
let rec loop sosa some print_tips =
if !cnt < max_cnt && Sosa.gt last_sosa sosa then
let some =
match Util.branch_of_sosa conf base (get_key_index p) sosa with
Some ((ia, _) :: _ as br) ->
print_cousins_side_of conf base max_cnt (pget conf base ia) p br
lev1 lev2 ||
lev1 lev2 print_tips ||
some
| _ -> some
in
loop (Sosa.inc sosa 1) some
loop (Sosa.inc sosa 1) some false
else some
in
loop first_sosa false
loop first_sosa false true
in
if some then ()
else Wserver.printf "%s.\n" (capitale (transl conf "no match"));
@@ -332,9 +330,9 @@ let print_cousins conf base p lev1 lev2 =
Perso.interp_notempl_with_menu title "perso_header" conf base p;
Wserver.printf "<div>\n";
(*include_templ conf "cousins_tools";*)
Wserver.printf "<h3>\n";
Wserver.printf "<h2>\n";
title false;
Wserver.printf "</h3>\n";
Wserver.printf "</h2>\n";
Wserver.printf "</div>\n";
cnt := 0;
(* Construction de la table des sosa de la base *)
@@ -349,8 +347,7 @@ let print_cousins conf base p lev1 lev2 =
(Util.translate_eval ("@(c)" ^ transl_nth conf "person/persons" 1));
if p_getenv conf.env "spouse" = Some "on" then
Wserver.printf " %s %d %s.\n" (transl conf "and") !cnt_sp
(Util.translate_eval ("@(c)" ^ transl_nth conf "spouse/spouses" 1))
else Wserver.printf ".\n" ;
(Util.translate_eval ("@(c)" ^ transl_nth conf "spouse/spouses" 1)) ;
Wserver.printf "</p>\n";
Wserver.printf "</div>\n";
Hutil.trailer conf
@@ -239,14 +239,10 @@ let string_of_prec_dmy conf s s2 d =
| Before -> transl_decline conf "before (date)" s
| After -> transl_decline conf "after (date)" s
| Maybe -> transl_decline conf "possibly (date)" s
| OrYear _ ->
"<span class=\"text-nowrap\">" ^ s ^ "</span>" ^ " " ^
"<span class=\"text-nowrap\">" ^ transl conf "or" ^ " " ^
Mutil.nominative s2 ^ "</span>"
| OrYear _ -> s ^ " " ^ transl conf "or" ^ " " ^ Mutil.nominative s2
| YearInt _ ->
"<span class=\"text-nowrap\">" ^ transl conf "between (date)" ^ " " ^
s ^ "</span>" ^ " " ^ "<span class=\"text-nowrap\">" ^
transl_nth conf "and" 0 ^ " " ^ Mutil.nominative s2 ^ "</span>"
transl conf "between (date)" ^ " " ^ s ^ " " ^
transl_nth conf "and" 0 ^ " " ^ Mutil.nominative s2

let string_of_dmy_aux fn conf d =
let sy = code_dmy conf d in
@@ -70,7 +70,7 @@ type 'string gen_title =
t_date_end : cdate;
t_nth : int }

type witness_kind = Witness | Witness_GodParent | Witness_Officer
type witness_kind = Witness | Witness_GodParent

type 'string gen_pers_event_name =
Epers_Birth
@@ -1375,17 +1375,17 @@ let print conf base p =
match p_getenv conf.env "t" with
Some ("F" | "L" | "M") -> "deslist"
| Some "D" -> "deslist_hr"
| Some ("H" | "I" | "A") -> "destable"
| Some ((* "H" | *) "I" (* | "A" *)) -> "destable"
| Some "V" -> "destree"
| Some _ -> ""
| _ -> "desmenu"
in
if templ <> "" then Perso.interp_templ templ conf base p
else
match p_getenv conf.env "t", p_getint conf.env "v" with
Some "B", Some v -> print_aboville conf base v p
Some "A" (* "B" *), Some v -> print_aboville conf base v p
| Some "S", Some v -> display_descendants_level conf base v p
| Some "K", Some v -> display_descendant_with_table conf base v p
| Some "H" (* "K" *), Some v -> display_descendant_with_table conf base v p
| Some "N", Some v -> display_descendants_with_numbers conf base v p
| Some "G", Some v -> display_descendant_index conf base v p
| Some "C", Some v -> display_spouse_index conf base v p
@@ -587,7 +587,6 @@ let get_optional_event_date l =
let get_event_witness_kind l =
match l with
"#godp" :: l' -> Witness_GodParent, l'
| "#offi" :: l' -> Witness_Officer, l'
| _ -> Witness, l

let get_mar_date str =
@@ -674,7 +674,6 @@ module Make (Select : Select) =
Printf.fprintf oc ": ";
begin match wk with
Witness_GodParent -> Printf.fprintf oc "#godp "
| Witness_Officer -> Printf.fprintf oc "#offi "
| _ -> ()
end;
print_witness oc base gen p;
@@ -781,7 +780,6 @@ module Make (Select : Select) =
Printf.fprintf oc ": ";
begin match wk with
Witness_GodParent -> Printf.fprintf oc "#godp "
| Witness_Officer -> Printf.fprintf oc "#offi "
| _ -> ()
end;
print_witness oc base gen p;
@@ -1018,7 +1016,6 @@ module Make (Select : Select) =
Printf.fprintf oc ": ";
begin match wk with
Witness_GodParent -> Printf.fprintf oc "#godp "
| Witness_Officer -> Printf.fprintf oc "#offi "
| _ -> ()
end;
print_witness oc base gen p;
@@ -3,6 +3,8 @@

open Config

let up_fname _conf = "up.png"

let commd_no_params conf =
conf.command ^ "?" ^
List.fold_left
@@ -22,22 +24,27 @@ let link_to_referer conf =
else ""

let gen_print_link_to_welcome f conf right_aligned =
if conf.cancel_links then ()
else
begin
if right_aligned then
Wserver.printf "<div class=\"btn-group float-%s mt-2\">\n" conf.right
else Wserver.printf "<p>\n";
f ();
let str = link_to_referer conf in
if str = "" then () else Wserver.printf "%s" str;
Wserver.printf "<a href=\"%s\">\
<span class=\"fa fa-home fa-lg ml-1 px-0\" title=\"%s\"></span>\
</a>\n"
(commd_no_params conf) (Util.capitale (Util.transl conf "home"));
if right_aligned then Wserver.printf "</div>\n"
else Wserver.printf "</p>\n"
end
if not conf.cancel_links then begin
let fname = up_fname conf in
let wid_hei =
match Util.image_size (Util.image_file_name fname) with
| Some (wid, hei) ->
" width=\"" ^ string_of_int wid ^ "\" height=\"" ^ string_of_int hei ^ "\""
| None -> ""
in
if right_aligned then
Wserver.printf "<div style=\"float:%s\">\n" conf.right
else Wserver.printf "<p>\n";
f ();
let str = link_to_referer conf in
if str = "" then () else Wserver.printf "%s" str;
Wserver.printf "<a href=\"%s\">\
<img src=\"%s/%s\"%s alt=\"^^\" title=\"^^\"%s>\
</a>\n"
(commd_no_params conf) (Util.image_prefix conf) fname wid_hei conf.xhs;
if right_aligned then Wserver.printf "</div>\n"
else Wserver.printf "</p>\n"
end

let print_link_to_welcome = gen_print_link_to_welcome (fun () -> ())

@@ -68,13 +75,12 @@ let header_without_http conf title =
Not_found -> ""
in
let s = s ^ Util.body_prop conf in
Wserver.printf "<body%s>\n" s; Util.message_to_wizard conf
Wserver.printf "<body%s>\n" s;
Util.message_to_wizard conf

let header_without_page_title conf title =
Util.html conf;
header_without_http conf title;
(* balancing </div> in gen_trailer *)
Wserver.printf "<div class=\"container\">"
header_without_http conf title

let header_link_welcome conf title =
header_without_page_title conf title;
@@ -97,8 +103,6 @@ let header conf title =

let header_fluid conf title =
header_without_http conf title;
(* balancing </div> in gen_trailer *)
Wserver.printf "<div class=\"container-fluid\">";
Wserver.printf "\n<h1>";
title false;
Wserver.printf "</h1>\n"
Oops, something went wrong.

0 comments on commit 4600b08

Please sign in to comment.