summaryrefslogtreecommitdiff
path: root/app/Functions
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-08-14 10:06:51 +0100
committerGreg Roach <fisharebest@gmail.com>2015-08-14 10:06:51 +0100
commit17d46ee8239a2c6f105cdd436adb41d549fde480 (patch)
tree02ee30eb3b87eca86e070453478a174bd43cb699 /app/Functions
parent1703759b66d1da891f32e734f7513d5664004398 (diff)
downloadwebtrees-17d46ee8239a2c6f105cdd436adb41d549fde480.tar.gz
webtrees-17d46ee8239a2c6f105cdd436adb41d549fde480.tar.bz2
webtrees-17d46ee8239a2c6f105cdd436adb41d549fde480.zip
Fix #667 - spouse names
Diffstat (limited to 'app/Functions')
-rw-r--r--app/Functions/FunctionsEdit.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php
index 0a962f2df6..c666ccee5d 100644
--- a/app/Functions/FunctionsEdit.php
+++ b/app/Functions/FunctionsEdit.php
@@ -20,6 +20,7 @@ use Fisharebest\Webtrees\Config;
use Fisharebest\Webtrees\Database;
use Fisharebest\Webtrees\Date;
use Fisharebest\Webtrees\Fact;
+use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\Filter;
use Fisharebest\Webtrees\GedcomCode\GedcomCodeAdop;
use Fisharebest\Webtrees\GedcomCode\GedcomCodeName;
@@ -592,6 +593,20 @@ class FunctionsEdit {
}
}
+ // Show names for spouses in MARR/HUSB/AGE and MARR/WIFE/AGE
+ if ($fact === 'HUSB' || $fact === 'WIFE') {
+ $family = Family::getInstance($xref, $WT_TREE);
+ if ($family) {
+ $spouse_link = $family->getFirstFact($fact);
+ if ($spouse_link) {
+ $spouse = $spouse_link->getTarget();
+ if ($spouse) {
+ echo $spouse->getFullName();
+ }
+ }
+ }
+ }
+
if (in_array($fact, Config::emptyFacts()) && ($value === '' || $value === 'Y' || $value === 'y')) {
echo '<input type="hidden" id="', $element_id, '" name="', $element_name, '" value="', $value, '">';
if ($level <= 1) {