diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2018-07-23 21:27:14 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2018-07-23 21:27:26 +0100 |
| commit | 6da9bbe03c7ad1b8370d9a0d9c58280e94e131d0 (patch) | |
| tree | caf88fb55f4a1a7570696e02a25fea04878f9588 /app/Report/ReportParserGenerate.php | |
| parent | bbe4546f1bdac54a85ad695a56563c98fca8fccb (diff) | |
| download | webtrees-6da9bbe03c7ad1b8370d9a0d9c58280e94e131d0.tar.gz webtrees-6da9bbe03c7ad1b8370d9a0d9c58280e94e131d0.tar.bz2 webtrees-6da9bbe03c7ad1b8370d9a0d9c58280e94e131d0.zip | |
Remove global
Diffstat (limited to 'app/Report/ReportParserGenerate.php')
| -rw-r--r-- | app/Report/ReportParserGenerate.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php index 1a4aa98ecc..aafba9a302 100644 --- a/app/Report/ReportParserGenerate.php +++ b/app/Report/ReportParserGenerate.php @@ -1569,64 +1569,6 @@ class ReportParserGenerate extends ReportParserBase } /** - * XML <AgeAtDeath /> element handler - */ - private function ageAtDeathStartHandler() - { - // This duplicates functionality in FunctionsPrint::format_fact_date() - global $factrec; - - $match = []; - if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) { - $person = Individual::getInstance($match[1], $this->tree); - // Recorded age - if (preg_match('/\n2 AGE (.+)/', $factrec, $match)) { - $fact_age = $match[1]; - } else { - $fact_age = ''; - } - if (preg_match('/\n2 HUSB\n3 AGE (.+)/', $factrec, $match)) { - $husb_age = $match[1]; - } else { - $husb_age = ''; - } - if (preg_match('/\n2 WIFE\n3 AGE (.+)/', $factrec, $match)) { - $wife_age = $match[1]; - } else { - $wife_age = ''; - } - - // Calculated age - $birth_date = $person->getBirthDate(); - // Can't use getDeathDate(), as this also gives BURI/CREM events, which - // wouldn't give the correct "days after death" result for people with - // no DEAT. - $death_event = $person->getFirstFact('DEAT'); - if ($death_event) { - $death_date = $death_event->getDate(); - } else { - $death_date = new Date(''); - } - $value = ''; - if (Date::compare($birth_date, $death_date) <= 0 || !$person->isDead()) { - $age = Date::getAgeGedcom($birth_date, $death_date); - // Only show calculated age if it differs from recorded age - if ($age != '' && $age != '0d') { - if ($fact_age != '' && $fact_age != $age || $fact_age == '' && $husb_age == '' && $wife_age == '' || $husb_age != '' && $person->getSex() == 'M' && $husb_age != $age || $wife_age != '' && $person->getSex() == 'F' && $wife_age != $age - ) { - $value = FunctionsDate::getAgeAtEvent($age); - $abbrev = substr($value, 0, strpos($value, ' ') + 5); - if ($value !== $abbrev) { - $value = $abbrev . '.'; - } - } - } - } - $this->current_element->addText($value); - } - } - - /** * XML element Forced line break handler - HTML code */ private function brStartHandler() |
