Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the age of an "associated people" #3484

Closed
ckl67 opened this issue Aug 20, 2020 · 2 comments
Closed

Display the age of an "associated people" #3484

ckl67 opened this issue Aug 20, 2020 · 2 comments
Labels
enhancement feature request

Comments

@ckl67
Copy link

ckl67 commented Aug 20, 2020

When associating an external people to an event, Webtrees should also display the age of this people.

Example of situation
The civil register of a death is pointing out the witness, who for example noticed the dead.
The civil register highlighting also the age of this witness.

Displaying the age of the "associate people" could help to see if this age matches with the information indicated in the Register.

Example: Currently for a Dead event we have
Associate : Paul Klugesherz - Son

Target
Associate : Paul Klugesherz (Aged 27 years) - Son

@fisharebest fisharebest added the enhancement feature request label Aug 21, 2020
@ckl67
Copy link
Author

ckl67 commented Oct 14, 2020

Sorry to bother you about this feature.
For me, this is a "must have feature".

Another example is the census.
In the census, most of the time the age is indicated.
So this could be a double check between the information added in the TEXT of the source (where we highlight the people + age) and the associated people (where the age is computed )

Can I have estimated target date when this feature might be included in a future release ?

Thank you in advance

@ckl67
Copy link
Author

ckl67 commented Nov 14, 2020

Humm, The case can be fixed in only a few lines..
in FunctionsPrinFacts.php

            // Compute age of associated Person at the event (Person BIRT is mandatory )
            $ageOfAssociated ="";
            if (preg_match('/\n2 DATE (.+)/', $event->gedcom(), $match1)) {
                if (preg_match('/\n1 BIRT/', $person->gedcom(), $match)) {
                    preg_match('/\n2 DATE (.+)/', $person->gedcom(), $match2);
                    $dateEvent = new Date($match1[1]);
                    $dateAssoP = new Date($match2[1]);
                    $ageOfAssociated   = (new Age($dateAssoP, $dateEvent ))->ageAtEvent(true);
                }
            }
            $values = ['<a href="' . e($person->url()) . '">' . $person->fullName() . '<i> ' . $ageOfAssociated . '</i>' . '</a>'];

Agreed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants