diff options
| author | Greg Roach <fisharebest@gmail.com> | 2013-10-15 22:24:25 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2013-10-15 22:24:25 +0100 |
| commit | 7edb92cc1f5022f374a3a3aa10751fc4dfaa0417 (patch) | |
| tree | 3ea97b5fc8e849d7e36b1d0bb4ad7f78114ae6e7 /includes | |
| parent | 2f53df7f389e12ea7a1ce8faabe26dd9a1959457 (diff) | |
| download | webtrees-7edb92cc1f5022f374a3a3aa10751fc4dfaa0417.tar.gz webtrees-7edb92cc1f5022f374a3a3aa10751fc4dfaa0417.tar.bz2 webtrees-7edb92cc1f5022f374a3a3aa10751fc4dfaa0417.zip | |
#1236081 - Close Family Events - Individual Names Missing
Diffstat (limited to 'includes')
| -rw-r--r-- | includes/functions/functions_print_facts.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php index c2788d9777..7ad22bdad8 100644 --- a/includes/functions/functions_print_facts.php +++ b/includes/functions/functions_print_facts.php @@ -200,15 +200,18 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { echo '</td><td class="optionbox ', $styleadd, ' wrap">'; - // Print the spouse and family of this fact/event - if ($parent instanceof WT_Family && $record instanceof WT_Individual) { - foreach ($parent->getSpouses() as $spouse) { - if ($record !== $spouse) { - echo '<a href="', $spouse->getHtmlUrl(), '">', $spouse->getFullName(), '</a> — '; + // Event from another record? + if ($parent !== $record) { + if ($parent instanceof WT_Family) { + foreach ($parent->getSpouses() as $spouse) { + if ($record !== $spouse) { + echo '<a href="', $spouse->getHtmlUrl(), '">', $spouse->getFullName(), '</a> — '; + } } + echo '<a href="', $parent->getHtmlUrl(), '">', WT_I18N::translate('View family'), '</a><br>'; + } elseif ($parent instanceof WT_Individual) { + echo '<a href="', $parent->getHtmlUrl(), '">', $parent->getFullName(), '</a><br>'; } - // Family events on an individual page - echo '<a href="', $parent->getHtmlUrl(), '">', WT_I18N::translate('View family'), '</a><br>'; } // Print the value of this fact/event |
