summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-02-23 08:48:08 +0000
committerfisharebest <fisharebest@gmail.com>2011-02-23 08:48:08 +0000
commitf40d745ce5ed93b613f154c714403fa77b4f67b3 (patch)
tree970f16e6f263f2e9615c7113159a8367b20dfc18
parent82cd53242ba48cd52fb58f1cbb48e690a947669a (diff)
downloadwebtrees-f40d745ce5ed93b613f154c714403fa77b4f67b3.tar.gz
webtrees-f40d745ce5ed93b613f154c714403fa77b4f67b3.tar.bz2
webtrees-f40d745ce5ed93b613f154c714403fa77b4f67b3.zip
Update to logic for Spanish cousin names (from Wes Groleau)
-rw-r--r--includes/functions/functions.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/includes/functions/functions.php b/includes/functions/functions.php
index 9000bebca0..67e25c3dfc 100644
--- a/includes/functions/functions.php
+++ b/includes/functions/functions.php
@@ -1835,6 +1835,7 @@ function cousin_name2($n, $sex, $relation) {
}
}
+
function get_relationship_name_from_path($path, $pid1, $pid2) {
if (!preg_match('/^(mot|fat|par|hus|wif|spo|son|dau|chi|bro|sis|sib)*$/', $path)) {
// TODO: Update all the "3 RELA " values in class_person
@@ -2745,13 +2746,13 @@ function get_relationship_name_from_path($path, $pid1, $pid2) {
// Source: Wes Groleau. See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html
if ($down==$up) {
return cousin_name($cousin, $sex2);
- } elseif ($down>$up) {
- return cousin_name2($cousin, $sex2, get_relationship_name_from_path('sib' . $descent, null, null));
+ } elseif ($down<$up) {
+ return cousin_name2($cousin+1, $sex2, get_relationship_name_from_path('sib' . $descent, null, null));
} else {
switch ($sex2) {
- case 'M': return cousin_name2($cousin, $sex2, get_relationship_name_from_path('bro' . $descent, null, null));
- case 'F': return cousin_name2($cousin, $sex2, get_relationship_name_from_path('sis' . $descent, null, null));
- case 'U': return cousin_name2($cousin, $sex2, get_relationship_name_from_path('sib' . $descent, null, null));
+ case 'M': return cousin_name2($cousin+1, $sex2, get_relationship_name_from_path('bro' . $descent, null, null));
+ case 'F': return cousin_name2($cousin+1, $sex2, get_relationship_name_from_path('sis' . $descent, null, null));
+ case 'U': return cousin_name2($cousin+1, $sex2, get_relationship_name_from_path('sib' . $descent, null, null));
}
}
case 'en': // See: http://en.wikipedia.org/wiki/File:CousinTree.svg