summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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) {