diff options
| author | fisharebest <fisharebest@gmail.com> | 2013-07-05 18:17:29 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2013-07-05 18:17:29 +0000 |
| commit | 8091d202990440159a4d0234828e2f0b87036ea3 (patch) | |
| tree | 34ec6f6f7e9f3b2e73d78198eac5159e801a157c | |
| parent | 4d6804134e9d06c5b5613706aa7d43a629fa2c1a (diff) | |
| download | webtrees-8091d202990440159a4d0234828e2f0b87036ea3.tar.gz webtrees-8091d202990440159a4d0234828e2f0b87036ea3.tar.bz2 webtrees-8091d202990440159a4d0234828e2f0b87036ea3.zip | |
More refactoring - edit_interface
| -rw-r--r-- | edit_interface.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/edit_interface.php b/edit_interface.php index ef9337d69d..06cab762c2 100644 --- a/edit_interface.php +++ b/edit_interface.php @@ -2184,20 +2184,25 @@ function print_indi_form($nextaction, WT_Individual $person=null, WT_Family $fam // Inherit surname from parents, spouse or child if (!$namerec) { // We'll need the parent's name to set the child's surname - $family=WT_Family::getInstance($famid); - if ($family && $family->getHusband()) { - $father_name=get_gedcom_value('NAME', 0, $family->getHusband()->getGedcom()); + $family = WT_Family::getInstance($famid); + $father = $family->getHusband(); + if ($father->getFactByType('NAME')) { + $father_name = $father->getFactByType('NAME')->getValue(); } else { $father_name=''; } - if ($family && $family->getWife()) { - $mother_name=get_gedcom_value('NAME', 0, $family->getWife()->getGedcom()); + $mother = $family->getWife(); + if ($mother->getFactByType('NAME')) { + $mother_name = $mother->getFactByType('NAME')->getValue(); } else { - $mother_name=''; + $mother_name = ''; } // We'll need the spouse/child's name to set the spouse/parent's surname - $prec=find_gedcom_record($xref, WT_GED_ID, true); - $indi_name=get_gedcom_value('NAME', 0, $prec); + if ($person && $person->getFactByType('NAME')) { + $indi_name = $person->getFactByType('NAME')->getValue(); + } else { + $indi_name = ''; + } // Different cultures do surnames differently switch ($SURNAME_TRADITION) { case 'spanish': |
