diff options
| -rw-r--r-- | descendancy.php | 4 | ||||
| -rw-r--r-- | expand_view.php | 4 | ||||
| -rw-r--r-- | includes/functions/functions_print.php | 14 | ||||
| -rw-r--r-- | library/WT/Controller/Descendancy.php | 18 | ||||
| -rw-r--r-- | library/WT/Controller/Family.php | 2 | ||||
| -rw-r--r-- | library/WT/Controller/Familybook.php | 28 | ||||
| -rw-r--r-- | library/WT/Controller/Fanchart.php | 4 | ||||
| -rw-r--r-- | library/WT/Controller/GedcomRecord.php | 4 | ||||
| -rw-r--r-- | library/WT/Controller/Hourglass.php | 54 | ||||
| -rw-r--r-- | library/WT/Controller/Lifespan.php | 5 | ||||
| -rw-r--r-- | library/WT/Individual.php | 47 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php | 91 | ||||
| -rw-r--r-- | modules_v3/descendancy/module.php | 9 | ||||
| -rw-r--r-- | modules_v3/family_nav/module.php | 16 | ||||
| -rw-r--r-- | modules_v3/personal_facts/module.php | 2 | ||||
| -rw-r--r-- | modules_v3/tree/class_treeview.php | 7 | ||||
| -rw-r--r-- | pedigree.php | 12 |
17 files changed, 117 insertions, 204 deletions
diff --git a/descendancy.php b/descendancy.php index 3e17eaaf37..4ab6cf337c 100644 --- a/descendancy.php +++ b/descendancy.php @@ -132,8 +132,8 @@ function indi_desc($person, $n, $array) { } $array[$person->getXref()]=$person; foreach ($person->getSpouseFamilies() as $family) { - $spouse=$family->getSpouse($person); - if (isset($spouse)) $array[$spouse->getXref()]=$spouse; + $spouse = $family->getSpouse($person); + $array[$spouse->getXref()] = $spouse; foreach ($family->getChildren() as $child) { $array=indi_desc($child, $n-1, $array); } diff --git a/expand_view.php b/expand_view.php index d5ca426583..4598effe27 100644 --- a/expand_view.php +++ b/expand_view.php @@ -90,9 +90,7 @@ foreach ($facts as $event) { // Show spouse/family for family events if ($event->getParent() instanceof WT_Family) { $spouse = $event->getParent()->getSpouse($person); - if ($spouse) { - echo ' <a href="', $spouse->getHtmlUrl(), '">', $spouse->getFullName(), '</a> - '; - } + echo ' <a href="', $spouse->getHtmlUrl(), '">', $spouse->getFullName(), '</a> - '; echo '<a href="', $event->getParent()->getHtmlUrl(), '">', WT_I18N::translate('View Family'), ' - </a>'; } echo ' ',format_fact_place($event, true, true); diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php index c2502fd473..08e3367296 100644 --- a/includes/functions/functions_print.php +++ b/includes/functions/functions_print.php @@ -107,19 +107,11 @@ function print_pedigree_person($person, $style=1, $count=0, $personcount="1") { } foreach ($person->getSpouseFamilies() as $family) { $spouse = $family->getSpouse($person); - $children = $family->getChildren(); - $num = count($children); $personlinks .= '<li>'; - if ((!empty($spouse))||($num>0)) { - $personlinks .= '<a href="'.$family->getHtmlUrl().'"><b>'.WT_I18N::translate('Family with spouse').'</b></a><br>'; - if (!empty($spouse)) { - $personlinks .= '<a href="'.$spouse->getHtmlUrl().'">'; - $personlinks .= $spouse->getFullName(); - $personlinks .= '</a>'; - } - } + $personlinks .= '<a href="'.$family->getHtmlUrl().'"><b>'.WT_I18N::translate('Family with spouse').'</b></a><br>'; + $personlinks .= '<a href="'.$spouse->getHtmlUrl().'">' . $spouse->getFullName() . '</a>'; $personlinks .= '</li><li><ul>'; - foreach ($children as $child) { + foreach ($family->getChildren() as $child) { $personlinks .= '<li><a href="'.$child->getHtmlUrl().'">'; $personlinks .= $child->getFullName(); $personlinks .= '</a></li>'; diff --git a/library/WT/Controller/Descendancy.php b/library/WT/Controller/Descendancy.php index 9ee2c3d733..d40004c0f4 100644 --- a/library/WT/Controller/Descendancy.php +++ b/library/WT/Controller/Descendancy.php @@ -196,26 +196,22 @@ class WT_Controller_Descendancy extends WT_Controller_Chart { if (is_null($family)) return; if (is_null($person)) return; - $spouse=$family->getSpouse($person); - if (!$spouse) { - // One parent families have no spouse - $spouse=new WT_Individual(''); - } - // print marriage info echo '<li>'; echo '<img src="', $WT_IMAGES['spacer'], '" height="2" width="', ($Dindent+4), '" alt="">'; echo '<span class="details1" style="white-space:nowrap;">'; echo "<a href=\"#\" onclick=\"expand_layer('".$family->getXref().$personcount."'); return false;\" class=\"top\"><i id=\"".$family->getXref().$personcount."_img\" class=\"icon-minus\" title=\"".WT_I18N::translate('View Family')."\"></i></a>"; - $marriage = $family->getMarriage(); - if ($marriage->canShow()) { - echo ' <a href="', $family->getHtmlUrl(), '" class="details1">'; - $marriage->print_simple_fact(); - echo '</a>'; + foreach ($family->getFacts(WT_EVENTS_MARR) as $fact) { + if ($fact->canShow()) { + echo ' <a href="', $family->getHtmlUrl(), '" class="details1">'; + $fact->print_simple_fact(); + echo '</a>'; + } } echo '</span>'; // print spouse + $spouse=$family->getSpouse($person); echo '<ul style="list-style:none; display:block;" id="'.$family->getXref().$personcount.'">'; echo '<li>'; echo '<table border="0" cellpadding="0" cellspacing="0"><tr><td>'; diff --git a/library/WT/Controller/Family.php b/library/WT/Controller/Family.php index 686627562b..cb9b9181c9 100644 --- a/library/WT/Controller/Family.php +++ b/library/WT/Controller/Family.php @@ -68,7 +68,7 @@ class WT_Controller_Family extends WT_Controller_GedcomRecord { function getTimelineIndis($tags) { preg_match_all('/\n1 (?:'.implode('|', $tags).') @('.WT_REGEX_XREF.')@/', $this->record->getGedcom(), $matches); foreach ($matches[1] as &$match) { - $match='pids[]='.$match; + $match='pids%5B%5D='.$match; } return implode('&', $matches[1]); } diff --git a/library/WT/Controller/Familybook.php b/library/WT/Controller/Familybook.php index c509a10af4..8d01fcddec 100644 --- a/library/WT/Controller/Familybook.php +++ b/library/WT/Controller/Familybook.php @@ -216,22 +216,18 @@ class WT_Controller_Familybook extends WT_Controller_Chart { if ($count==1 ) { if ($this->show_spouse) { foreach ($sfamilies as $family) { - if (!is_null($family)) { - $spouse = $family->getSpouse($person); - if ($spouse!=null) { - echo '</td></tr><tr><td>'; - //-- shrink the box for the spouses - $tempw = $bwidth; - $temph = $bheight; - $bwidth -= 10; - $bheight -= 10; - print_pedigree_person($spouse); - $bwidth = $tempw; - $bheight = $temph; - $numkids += 0.95; - echo '</td><td></td>'; - } - } + $spouse = $family->getSpouse($person); + echo '</td></tr><tr><td>'; + //-- shrink the box for the spouses + $tempw = $bwidth; + $temph = $bheight; + $bwidth -= 10; + $bheight -= 10; + print_pedigree_person($spouse); + $bwidth = $tempw; + $bheight = $temph; + $numkids += 0.95; + echo '</td><td></td>'; } } } diff --git a/library/WT/Controller/Fanchart.php b/library/WT/Controller/Fanchart.php index ea6edf7c12..2eccce80f5 100644 --- a/library/WT/Controller/Fanchart.php +++ b/library/WT/Controller/Fanchart.php @@ -321,9 +321,7 @@ class WT_Controller_Fanchart extends WT_Controller_Chart { // spouse(s) and children foreach ($person->getSpouseFamilies() as $family) { $spouse=$family->getSpouse($person); - if ($spouse) { - $html.= '<br><a href="'.$spouse->getHtmlUrl().'" class="name1">'.$spouse->getFullName().'</a>'; - } + $html.= '<br><a href="'.$spouse->getHtmlUrl().'" class="name1">'.$spouse->getFullName().'</a>'; foreach ($family->getChildren() as $child) { $html.= '<br> <a href="'.$child->getHtmlUrl().'" class="name1">< '.$child->getFullName().'</a>'; } diff --git a/library/WT/Controller/GedcomRecord.php b/library/WT/Controller/GedcomRecord.php index 233c7fbaac..205ba4d4d4 100644 --- a/library/WT/Controller/GedcomRecord.php +++ b/library/WT/Controller/GedcomRecord.php @@ -29,6 +29,10 @@ class WT_Controller_GedcomRecord extends WT_Controller_Page { public $record; // individual, source, repository, etc. public function __construct() { + // Non-existant record? + if ($this->record->getXref() == WT_GedcomRecord::DUMMY_XREF) { + $this->record = null; + } // Automatically fix broken links if ($this->record && $this->record->canEdit()) { $broken_links=0; diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php index 01285b296b..d60dcc1e92 100644 --- a/library/WT/Controller/Hourglass.php +++ b/library/WT/Controller/Hourglass.php @@ -301,13 +301,8 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { //-- move the arrow up to line up with the correct box if ($this->show_spouse) { foreach ($families as $family) { - /* @var $family Family */ - if (!is_null($family)) { - $spouse = $family->getSpouse($person); - if ($spouse!=null) { - echo "<br><br><br>"; - } - } + $spouse = $family->getSpouse($person); + echo "<br><br><br>"; } } echo "</td><td width=\"$bwidth\">"; @@ -321,23 +316,17 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { //----- Print the spouse if ($this->show_spouse) { foreach ($families as $family) { - /* @var $family Family */ - if (!is_null($family)) { - $spouse = $family->getSpouse($person); - if ($spouse!=null) { - echo "</td></tr><tr><td align=\"$otablealign\">"; - //-- shrink the box for the spouses - $tempw = $bwidth; - $temph = $bheight; - $bwidth -= 10; - $bheight -= 10; - print_pedigree_person($spouse); - $bwidth = $tempw; - $bheight = $temph; - $numkids += 0.95; - echo "</td><td></td>"; - } - } + echo "</td></tr><tr><td align=\"$otablealign\">"; + //-- shrink the box for the spouses + $tempw = $bwidth; + $temph = $bheight; + $bwidth -= 10; + $bheight -= 10; + print_pedigree_person($family->getSpouse($person)); + $bwidth = $tempw; + $bheight = $temph; + $numkids += 0.95; + echo "</td><td></td>"; } //-- add offset divs to make things line up better if ($count==$this->dgenerations) echo "<tr><td colspan\"2\"><div style=\"height: ".($bhalfheight/2)."px; width: ".$bwidth."px;\"><br></div>"; @@ -365,16 +354,12 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { foreach ($famids as $family) { $spouse = $family->getSpouse($person); - if ($spouse) { - $spid = $spouse->getXref(); - echo "<a href=\"hourglass.php?rootid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\" class=\"name1\">"; - echo $spouse->getFullName(); - echo '</a><br>'; - - } + $spid = $spouse->getXref(); + echo "<a href=\"hourglass.php?rootid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\" class=\"name1\">"; + echo $spouse->getFullName(); + echo '</a><br>'; - $children = $family->getChildren(); - foreach ($children as $id=>$child) { + foreach ($family->getChildren() as $child) { $cid = $child->getXref(); echo " <a href=\"hourglass.php?rootid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\" class=\"name1\">"; echo $child->getFullName(); @@ -401,11 +386,10 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { echo '</a><br>'; } } - $children = $family->getChildren(); $num = $family->getNumberOfChildren(); if ($num>2) echo "<span class=\"name1\"><br>".WT_I18N::translate('Siblings')."<br></span>"; if ($num==2) echo "<span class=\"name1\"><br>".WT_I18N::translate('Sibling')."<br></span>"; - foreach ($children as $id=>$child) { + foreach ($family->getChildren() as $child) { $cid = $child->getXref(); if ($cid!=$pid) { echo " <a href=\"hourglass.php?rootid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\" class=\"name1\">"; diff --git a/library/WT/Controller/Lifespan.php b/library/WT/Controller/Lifespan.php index e142ad9343..5412b60e95 100644 --- a/library/WT/Controller/Lifespan.php +++ b/library/WT/Controller/Lifespan.php @@ -211,10 +211,7 @@ class WT_Controller_Lifespan extends WT_Controller_Page { $this->pids[]=$person->getXref(); if ($add_family) { foreach ($person->getSpouseFamilies() as $family) { - $spouse=$family->getSpouse($person); - if ($spouse) { - $this->pids[]=$spouse->getXref(); - } + $this->pids[]=$family->getSpouse($person)->getXref(); foreach ($family->getChildren() as $child) { $this->pids[]=$child->getXref(); } diff --git a/library/WT/Individual.php b/library/WT/Individual.php index eefcef6c1c..0f53915a7d 100644 --- a/library/WT/Individual.php +++ b/library/WT/Individual.php @@ -208,14 +208,12 @@ class WT_Individual extends WT_GedcomRecord { } // Check spouse dates $spouse=$family->getSpouse($this, WT_PRIV_HIDE); - if ($spouse) { - preg_match_all('/\n2 DATE (.+)/', $spouse->gedcom, $date_matches); - foreach ($date_matches[1] as $date_match) { - $date=new WT_Date($date_match); - // Assume max age difference between spouses of 40 years - if ($date->isOK() && $date->MaxJD() <= WT_SERVER_JD - 365*($MAX_ALIVE_AGE+40)) { - return true; - } + preg_match_all('/\n2 DATE (.+)/', $spouse->gedcom, $date_matches); + foreach ($date_matches[1] as $date_match) { + $date=new WT_Date($date_match); + // Assume max age difference between spouses of 40 years + if ($date->isOK() && $date->MaxJD() <= WT_SERVER_JD - 365*($MAX_ALIVE_AGE+40)) { + return true; } } // Check child dates @@ -907,12 +905,9 @@ class WT_Individual extends WT_GedcomRecord { $step_families=array(); $families=$this->getSpouseFamilies(); foreach ($families as $family) { - $spouse=$family->getSpouse($this); - if ($spouse) { - foreach ($spouse->getSpouseFamilies() as $step_family) { - if (!in_array($step_family, $families, true)) { - $step_families[]=$step_family; - } + foreach ($family->getSpouse($this)->getSpouseFamilies() as $step_family) { + if (!in_array($step_family, $families, true)) { + $step_families[]=$step_family; } } } @@ -972,27 +967,9 @@ class WT_Individual extends WT_GedcomRecord { throw new Exception('Invalid family in WT_Individual::getStepFamilyLabel(' . $family . ')'); } - /** - * get the correct label for a family - * @param Family $family the family to get the label for - * @return string - */ - function getSpouseFamilyLabel($family) { - if (is_null($family)) { - $spouse=WT_I18N::translate('unknown person'); - } else { - $husb = $family->getHusband(); - $wife = $family->getWife(); - if ($this->equals($husb) && !is_null($wife)) { - $spouse = $wife->getFullName(); - } elseif ($this->equals($wife) && !is_null($husb)) { - $spouse = $husb->getFullName(); - } else { - $spouse = WT_I18N::translate('unknown person'); - } - } - // I18N: %s is the spouse name - return WT_I18N::translate('Family with %s', $spouse); + // TODO - this function doesn't belong in this class + function getSpouseFamilyLabel(WT_Family $family) { + return /* I18N: %s is the spouse name */ WT_I18N::translate('Family with %s', $family->getSpouse($this)->getFullName()); } /** diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php b/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php index ab5e17cba2..e061b74302 100644 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php +++ b/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php @@ -285,8 +285,7 @@ if ($pid=="") { // Get child's marriage status $married=""; foreach ($child->getSpouseFamilies() as $childfamily) { - $tmp=$childfamily->getMarriageDate(); - $married = WT_Date::Compare($censdate, $tmp); + $married = WT_Date::Compare($censdate, $childfamily->getMarriageDate()); } $fulln =strip_tags($child->getFullName()); $menu = new WT_Menu(" " . $child->getLabel()); @@ -794,8 +793,7 @@ if ($pid=="") { // Get child's marriage status $married=""; foreach ($child->getSpouseFamilies() as $childfamily) { - $tmp=$childfamily->getMarriageDate(); - $married = WT_Date::Compare($censdate, $tmp); + $married = WT_Date::Compare($censdate, $childfamily->getMarriageDate()); } $fulln =strip_tags($child->getFullName()); $menu = new WT_Menu(" " . $child->getLabel()); @@ -897,7 +895,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", global $CHART_BOX_TAGS, $SHOW_LDS_AT_GLANCE, $PEDIGREE_SHOW_GENDER; global $SEARCH_SPIDER; - global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent, $tabno; + global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent; global $natdad, $natmom, $censyear, $censdate; if ($style != 2) $style=1; @@ -948,7 +946,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if (!is_null($family)) { $husb = $family->getHusband($person); $wife = $family->getWife($person); - // $spouse = $family->getSpouse($person); $children = $family->getChildren(); $num = count($children); $marrdate = $family->getMarriageDate(); @@ -957,7 +954,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($husb || $num>0) { if ($husb) { $person_parent="Yes"; - $tmp=$husb->getXref(); if ($husb->canShowName()) { $fulln =strip_tags($husb->getFullName()); $parentlinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; @@ -994,7 +990,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($wife || $num>0) { if ($wife) { $person_parent="Yes"; - $tmp=$wife->getXref(); if ($wife->canShowName()) { $married = WT_Date::Compare($censdate, $marrdate); $fulln =strip_tags($wife->getFullName()); @@ -1036,7 +1031,6 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if (!is_null($family)) { $husb = $family->getHusband($person); $wife = $family->getWife($person); - // $spouse = $family->getSpouse($person); $children = $family->getChildren(); $num = count($children); $marrdate = $family->getMarriageDate(); @@ -1050,7 +1044,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $tmp=$husb->getXref(); if ($husb->canShowName()) { $fulln =strip_tags($husb->getFullName()); - $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom=".WT_GEDURL."\">"; + $parentlinks .= "<a href=\"individual.php?pid={$tmp}&&gedcom=".WT_GEDURL."\">"; $parentlinks .= $husb->getFullName(); $parentlinks .= "</a>"; } else { @@ -1071,7 +1065,7 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", if ($wife->canShowName()) { $married = WT_Date::Compare($censdate, $marrdate); $fulln =addslashes($wife->getFullName()); - $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom=".WT_GEDURL."\">"; + $parentlinks .= "<a href=\"individual.php?pid={$tmp}&gedcom=".WT_GEDURL."\">"; $parentlinks .= $wife->getFullName(); $parentlinks .= "</a>"; } else { @@ -1093,50 +1087,45 @@ function print_pedigree_person_nav2($pid, $style=1, $count=0, $personcount="1", $marrdate = $family->getMarriageDate(); // Spouse ------------------------------ - if ($spouse || $num>0) { - if ($spouse) { - $tmp=$spouse->getXref(); - if ($spouse->canShowName()) { - $married = WT_Date::Compare($censdate, $marrdate); - $fulln =strip_tags($spouse->getFullName()); - $spouselinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; - $spouselinks .= "'".$spouse->getXref()."',"; // pid = PID - $spouselinks .= "'".strip_tags($spouse->getFullName())."',"; // Full Name - if ($currpid=="Son" || $currpid=="Daughter") { - if ($spouse->getSex()=="M") { - $spouselinks .= "'Son in Law',"; // label = Male Relationship - } else { - $spouselinks .= "'Daughter in Law',"; // label = Female Relationship - } - } else { - if ($spouse->getSex()=="M") { - $spouselinks .= "'Brother in Law',"; // label = Male Relationship - } else { - $spouselinks .= "'Sister in Law',"; // label = Female Relationship - } - } - $spouselinks .= "'".$spouse->getSex()."',"; // sex = Gender - $spouselinks .= "''".","; // cond = Condition (Married etc) - $spouselinks .= "'".$spouse->getbirthyear()."',"; // yob = Year of Birth - if ($spouse->getbirthyear()>=1) { - $spouselinks .= "'".($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth - } else { - $spouselinks .= "''".","; // age = Undefined - } - $spouselinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days - $spouselinks .= "''".","; // occu = Occupation - $spouselinks .= "'".$spouse->getcensbirthplace()."'"; // birthpl = Birthplace - $spouselinks .= ");\">"; - $spouselinks .= $spouse->getFullName(); // Full Name - $spouselinks .= "</a>"; + if ($spouse->canShowName()) { + $married = WT_Date::Compare($censdate, $marrdate); + $fulln =strip_tags($spouse->getFullName()); + $spouselinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; + $spouselinks .= "'".$spouse->getXref()."',"; // pid = PID + $spouselinks .= "'".strip_tags($spouse->getFullName())."',"; // Full Name + if ($currpid=="Son" || $currpid=="Daughter") { + if ($spouse->getSex()=="M") { + $spouselinks .= "'Son in Law',"; // label = Male Relationship } else { - $spouselinks .= WT_I18N::translate('Private'); + $spouselinks .= "'Daughter in Law',"; // label = Female Relationship } - $spouselinks .= "</a>"; - if ($spouse->getFullName() != "") { - $persons = "Yes"; + } else { + if ($spouse->getSex()=="M") { + $spouselinks .= "'Brother in Law',"; // label = Male Relationship + } else { + $spouselinks .= "'Sister in Law',"; // label = Female Relationship } } + $spouselinks .= "'".$spouse->getSex()."',"; // sex = Gender + $spouselinks .= "''".","; // cond = Condition (Married etc) + $spouselinks .= "'".$spouse->getbirthyear()."',"; // yob = Year of Birth + if ($spouse->getbirthyear()>=1) { + $spouselinks .= "'".($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth + } else { + $spouselinks .= "''".","; // age = Undefined + } + $spouselinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days + $spouselinks .= "''".","; // occu = Occupation + $spouselinks .= "'".$spouse->getcensbirthplace()."'"; // birthpl = Birthplace + $spouselinks .= ");\">"; + $spouselinks .= $spouse->getFullName(); // Full Name + $spouselinks .= "</a>"; + } else { + $spouselinks .= WT_I18N::translate('Private'); + } + $spouselinks .= "</a>"; + if ($spouse->getFullName() != "") { + $persons = "Yes"; } // Children ------------------------------ @var $child Person diff --git a/modules_v3/descendancy/module.php b/modules_v3/descendancy/module.php index 7eeef47220..e04c3e9a85 100644 --- a/modules_v3/descendancy/module.php +++ b/modules_v3/descendancy/module.php @@ -209,14 +209,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $person = WT_Individual::getInstance($pid); if ($person && $person->canShow()) { foreach($person->getSpouseFamilies() as $family) { - $spouse = $family->getSpouse($person); - if ($spouse) { - $out .= $this->getFamilyLi($family, $spouse, $generations-1); - } else { - foreach($family->getChildren() as $child) { - $out .= $this->getPersonLi($child, $generations-1); - } - } + $out .= $this->getFamilyLi($family, $family->getSpouse($person), $generations-1); } } if ($out) { diff --git a/modules_v3/family_nav/module.php b/modules_v3/family_nav/module.php index df555669a5..40f0a6956c 100644 --- a/modules_v3/family_nav/module.php +++ b/modules_v3/family_nav/module.php @@ -246,16 +246,12 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar { $children = $family->getChildren(); // Spouse ------------------------------ - if ($spouse || $children) { - if ($spouse) { - $spouselinks .= '<a class="flyout3" href="' . $spouse->getHtmlUrl() . '">'; - $spouselinks .= $spouse->getFullName(); - $spouselinks .= '</a>'; - $spouselinks .= '<br>'; - if ($spouse->getFullName() != '') { - $persons = 'Yes'; - } - } + $spouselinks .= '<a class="flyout3" href="' . $spouse->getHtmlUrl() . '">'; + $spouselinks .= $spouse->getFullName(); + $spouselinks .= '</a>'; + $spouselinks .= '<br>'; + if ($spouse->getFullName() != '') { + $persons = 'Yes'; } // Children ------------------------------ @var $child Person diff --git a/modules_v3/personal_facts/module.php b/modules_v3/personal_facts/module.php index ca557b457c..5678fefba7 100644 --- a/modules_v3/personal_facts/module.php +++ b/modules_v3/personal_facts/module.php @@ -190,7 +190,7 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { global $SHOW_RELATIVES_EVENTS; $facts = array(); - if ($spouse && strstr($SHOW_RELATIVES_EVENTS, '_DEAT_SPOU')) { + if (strstr($SHOW_RELATIVES_EVENTS, '_DEAT_SPOU')) { // Only include events between birth and death $birt_date = $person->getEstimatedBirthDate(); $deat_date = $person->getEstimatedDeathDate(); diff --git a/modules_v3/tree/class_treeview.php b/modules_v3/tree/class_treeview.php index 81cb5ef422..152020a036 100644 --- a/modules_v3/tree/class_treeview.php +++ b/modules_v3/tree/class_treeview.php @@ -121,12 +121,7 @@ class TreeView { $person = WT_Individual::getInstance($pid); $r = $this->getPersonDetails($person, $person, null); foreach ($person->getSpouseFamilies() as $family) { - if (!empty($family)) { - $partner = $family->getSpouse($person); - if (!empty($partner)) { - $r .= $this->getPersonDetails($person, $partner, $family); - } - } + $r .= $this->getPersonDetails($person, $family->getSpouse($person), $family); } return $r; } diff --git a/pedigree.php b/pedigree.php index 5a88cec160..6d7d423d3f 100644 --- a/pedigree.php +++ b/pedigree.php @@ -200,13 +200,11 @@ if (count($famids)>0) { echo $xoffset, 'px; top:', $yoffset, 'px;">'; foreach ($famids as $family) { $spouse=$family->getSpouse($controller->root); - if ($spouse) { - echo "<a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$spouse->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; - $name = $spouse->getFullName(); - echo 'class="name1">'; - echo $name; - echo '<br></span></a>'; - } + echo "<a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$spouse->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; + $name = $spouse->getFullName(); + echo 'class="name1">'; + echo $name; + echo '<br></span></a>'; $children = $family->getChildren(); foreach ($children as $child) { echo " <a href=\"pedigree.php?PEDIGREE_GENERATIONS={$controller->PEDIGREE_GENERATIONS}&rootid=".$child->getXref()."&show_full={$controller->show_full}&talloffset={$talloffset}\"><span "; |
