diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2022-11-18 14:27:42 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2022-11-18 14:27:42 +0000 |
| commit | 55cc2880d59de14938207a26a5dca695729b3cc7 (patch) | |
| tree | fcfa43844c3559f252b75ae6833b7d9c84a8d373 /resources/views | |
| parent | 0653586aae4099252bab36305fed980feed7ba49 (diff) | |
| download | webtrees-55cc2880d59de14938207a26a5dca695729b3cc7.tar.gz webtrees-55cc2880d59de14938207a26a5dca695729b3cc7.tar.bz2 webtrees-55cc2880d59de14938207a26a5dca695729b3cc7.zip | |
CodeStyle
Diffstat (limited to 'resources/views')
| -rw-r--r-- | resources/views/lists/families-table.phtml | 249 | ||||
| -rw-r--r-- | resources/views/lists/individuals-table.phtml | 238 |
2 files changed, 239 insertions, 248 deletions
diff --git a/resources/views/lists/families-table.phtml b/resources/views/lists/families-table.phtml index 0196ef2f00..0e550eed29 100644 --- a/resources/views/lists/families-table.phtml +++ b/resources/views/lists/families-table.phtml @@ -12,8 +12,8 @@ use Fisharebest\Webtrees\Tree; use Fisharebest\Webtrees\View; use Illuminate\Support\Collection; -$table_id = Registry::idFactory()->id(); // lists requires a unique ID in case there are multiple lists per page - +// lists require a unique ID in case there are multiple lists per page +$table_id = Registry::idFactory()->id(); $today = new Date(strtoupper(date('d M Y'))); $today_jd = Registry::timestampFactory()->now()->julianDay(); $hundred_years_ago = Registry::timestampFactory()->now()->subtractYears(100)->julianDay(); @@ -176,149 +176,150 @@ $("#<?= e($table_id) ?>") </thead> <tbody> - <?php foreach ($families as $family) : ?> - <?php $husb = $family->husband() ?? Registry::individualFactory()->new('H', '0 @H@ INDI', null, $family->tree()) ?> - <?php $wife = $family->wife() ?? Registry::individualFactory()->new('W', '0 @W@ INDI', null, $family->tree()) ?> + <?php foreach ($families as $family) : ?> + <?php $husb = $family->husband() ?? Registry::individualFactory()->new('H', '0 @H@ INDI', null, $family->tree()) ?> + <?php $wife = $family->wife() ?? Registry::individualFactory()->new('W', '0 @W@ INDI', null, $family->tree()) ?> - <tr class="<?= $family->isPendingAddition() ? 'wt-new' : '' ?> <?= $family->isPendingDeletion() ? 'wt-old' : '' ?>"> - <!-- Husband name --> - <td colspan="2" data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', implode(',', array_reverse(explode(',', $husb->sortName()))))) ?>"> - <?php foreach ($husb->getAllNames() as $num => $name) : ?> - <?php if ($name['type'] !== '_MARNM' || $num === $husb->getPrimaryName()) : ?> - <a title="<?= $name['type'] === '_MARNM' ? I18N::translate('Married name') : '' ?>" href="<?= e($family->url()) ?>" class="<?= $num === $husb->getPrimaryName() ? '' : 'text-muted' ?>"> - <?= $name['full'] ?> - </a> - <?php if ($num === $husb->getPrimaryName()) : ?> - <small><?= view('icons/sex', ['sex' => $husb->sex()]) ?></small> + <tr class="<?= $family->isPendingAddition() ? 'wt-new' : '' ?> <?= $family->isPendingDeletion() ? 'wt-old' : '' ?>"> + <!-- Husband name --> + <td colspan="2" data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', implode(',', array_reverse(explode(',', $husb->sortName()))))) ?>"> + <?php foreach ($husb->getAllNames() as $num => $name) : ?> + <?php if ($name['type'] !== '_MARNM' || $num === $husb->getPrimaryName()) : ?> + <div> + <a title="<?= $name['type'] === '_MARNM' ? I18N::translate('Married name') : '' ?>" href="<?= e($family->url()) ?>" class="<?= $num === $husb->getPrimaryName() ? '' : 'text-muted' ?>"> + <?= $name['full'] ?> + </a> + <?php if ($num === $husb->getPrimaryName()) : ?> + <small><?= view('icons/sex', ['sex' => $husb->sex()]) ?></small> + <?php endif ?> + </div> <?php endif ?> - <br> - <?php endif ?> - <?php endforeach ?> - <?= view('lists/individual-table-parents', ['individual' => $husb]) ?> - </td> + <?php endforeach ?> + <?= view('lists/individual-table-parents', ['individual' => $husb]) ?> + </td> - <td hidden data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', $husb->sortName())) ?>"></td> + <td hidden data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', $husb->sortName())) ?>"></td> - <!-- Husband age --> - <?php $age = new Age($husb->getBirthDate(), $family->getMarriageDate()) ?> - <td class="text-center" data-sort="<?= $age->ageDays() ?>"> - <?= $age->ageYearsString() ?> - </td> + <!-- Husband age --> + <?php $age = new Age($husb->getBirthDate(), $family->getMarriageDate()) ?> + <td class="text-center" data-sort="<?= $age->ageDays() ?>"> + <?= $age->ageYearsString() ?> + </td> - <!-- Wife name --> - <td colspan="2" data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', implode(',', array_reverse(explode(',', $wife->sortName()))))) ?>"> - <?php foreach ($wife->getAllNames() as $num => $name) : ?> - <?php if ($name['type'] !== '_MARNM' || $num === $wife->getPrimaryName()) : ?> - <a title="<?= $name['type'] === '_MARNM' ? I18N::translate('Married name') : '' ?>" href="<?= e($family->url()) ?>" class="<?= $num === $wife->getPrimaryName() ? '' : 'text-muted' ?>"> - <?= $name['full'] ?> - </a> - <?php if ($num === $wife->getPrimaryName()) : ?> - <small><?= view('icons/sex', ['sex' => $wife->sex()]) ?></small> + <!-- Wife name --> + <td colspan="2" data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', implode(',', array_reverse(explode(',', $wife->sortName()))))) ?>"> + <?php foreach ($wife->getAllNames() as $num => $name) : ?> + <?php if ($name['type'] !== '_MARNM' || $num === $wife->getPrimaryName()) : ?> + <div> + <a title="<?= $name['type'] === '_MARNM' ? I18N::translate('Married name') : '' ?>" href="<?= e($family->url()) ?>" class="<?= $num === $wife->getPrimaryName() ? '' : 'text-muted' ?>"> + <?= $name['full'] ?> + </a> + <?php if ($num === $wife->getPrimaryName()) : ?> + <small><?= view('icons/sex', ['sex' => $wife->sex()]) ?></small> + <?php endif ?> + </div> <?php endif ?> - <br> - <?php endif ?> - <?php endforeach ?> - <?= view('lists/individual-table-parents', ['individual' => $wife]) ?> - </td> + <?php endforeach ?> + <?= view('lists/individual-table-parents', ['individual' => $wife]) ?> + </td> - <td hidden data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', $wife->sortName())) ?>"></td> + <td hidden data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', $wife->sortName())) ?>"></td> - <!-- Wife age --> - <?php $age = new Age($wife->getBirthDate(), $family->getMarriageDate()) ?> - <td class="text-center" data-sort="<?= $age->ageDays() ?>"> - <?= $age->ageYearsString() ?> - </td> + <!-- Wife age --> + <?php $age = new Age($wife->getBirthDate(), $family->getMarriageDate()) ?> + <td class="text-center" data-sort="<?= $age->ageDays() ?>"> + <?= $age->ageYearsString() ?> + </td> - <!-- Marriage date --> - <td data-sort="<?= $family->getMarriageDate()->julianDay() ?>"> - <?php if ($marriage_dates = $family->getAllMarriageDates()) : ?> - <?php foreach ($marriage_dates as $n => $marriage_date) : ?> - <div><?= $marriage_date->display($tree, null, true) ?></div> - <?php endforeach ?> - <?php elseif ($family->facts(['_NMR'])->isNotEmpty()) : ?> - <?= I18N::translate('no') ?> - <?php elseif ($family->facts(['MARR'])->isNotEmpty()) : ?> + <!-- Marriage date --> + <td data-sort="<?= $family->getMarriageDate()->julianDay() ?>"> + <?php if ($marriage_dates = $family->getAllMarriageDates()) : ?> + <?php foreach ($marriage_dates as $marriage_date) : ?> + <div><?= $marriage_date->display($tree, null, true) ?></div> + <?php endforeach ?> + <?php elseif ($family->facts(['MARR'])->isEmpty()) : ?> + <?= I18N::translate('no') ?> + <?php elseif ($family->facts(['MARR'])->isNotEmpty()) : ?> <?= I18N::translate('yes') ?> - <?php endif ?> - </td> + <?php endif ?> + </td> - <!-- Marriage anniversary --> - <?php $age = new Age($family->getMarriageDate(), $today) ?> - <td class="text-center" data-sort="<?= $age->ageDays() ?>"> - <?= $age->ageYearsString() ?> - </td> + <!-- Marriage anniversary --> + <?php $age = new Age($family->getMarriageDate(), $today) ?> + <td class="text-center" data-sort="<?= $age->ageDays() ?>"> + <?= $age->ageYearsString() ?> + </td> - <!-- Marriage place --> - <td data-sort="<?= e($family->getMarriagePlace()->gedcomName()) ?>"> - <?php foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) : ?> - <?= $marriage_place->shortName(true) ?> - <br> - <?php endforeach ?> - </td> + <!-- Marriage place --> + <td data-sort="<?= e($family->getMarriagePlace()->gedcomName()) ?>"> + <?php foreach ($family->getAllMarriagePlaces() as $marriage_place) : ?> + <div><?= $marriage_place->shortName(true) ?></div> + <?php endforeach ?> + </td> - <!-- Number of children --> - <td class="text-center" data-sort="<?= $family->numberOfChildren() ?>"> - <?= I18N::number($family->numberOfChildren()) ?> - </td> + <!-- Number of children --> + <td class="text-center" data-sort="<?= $family->numberOfChildren() ?>"> + <?= I18N::number($family->numberOfChildren()) ?> + </td> - <!-- Last change --> - <td data-sort="<?= $family->lastChangeTimestamp()->timestamp() ?>"> - <?= view('components/datetime', ['timestamp' => $family->lastChangeTimestamp()]) ?> - </td> + <!-- Last change --> + <td data-sort="<?= $family->lastChangeTimestamp()->timestamp() ?>"> + <?= view('components/datetime', ['timestamp' => $family->lastChangeTimestamp()]) ?> + </td> - <!-- Filter by marriage date --> - <td hidden> - <?php if ($family->getMarriageDate()->maximumJulianDay() > $hundred_years_ago && $family->getMarriageDate()->maximumJulianDay() <= $today_jd) : ?> - Y100 - <?php elseif ($family->facts(['MARR'])->isNotEmpty()) : ?> - YES - <?php else : ?> - U - <?php endif ?> - <?php if ($family->facts(['DIV'])->isNotEmpty()) : ?> - D - <?php endif ?> - <?php if (count($husb->spouseFamilies()) > 1 || count($wife->spouseFamilies()) > 1) : ?> - M - <?php endif ?> - </td> + <!-- Filter by marriage date --> + <td hidden> + <?php if ($family->getMarriageDate()->maximumJulianDay() > $hundred_years_ago && $family->getMarriageDate()->maximumJulianDay() <= $today_jd) : ?> + Y100 + <?php elseif ($family->facts(['MARR'])->isNotEmpty()) : ?> + YES + <?php else : ?> + U + <?php endif ?> + <?php if ($family->facts(['DIV'])->isNotEmpty()) : ?> + D + <?php endif ?> + <?php if (count($husb->spouseFamilies()) > 1 || count($wife->spouseFamilies()) > 1) : ?> + M + <?php endif ?> + </td> - <!-- Filter by alive/dead --> - <td hidden> - <?php if ($husb->isDead() && $wife->isDead()) : ?> - Y - <?php endif ?> - <?php if ($husb->isDead() && !$wife->isDead()) : ?> - <?php if ($wife->sex() === 'F') : ?> - H + <!-- Filter by alive/dead --> + <td hidden> + <?php if ($husb->isDead() && $wife->isDead()) : ?> + Y <?php endif ?> - <?php if ($wife->sex() === 'M') : ?> - W + <?php if ($husb->isDead() && !$wife->isDead()) : ?> + <?php if ($wife->sex() === 'F') : ?> + H + <?php endif ?> + <?php if ($wife->sex() === 'M') : ?> + W + <?php endif ?> <?php endif ?> - <?php endif ?> - <?php if (!$husb->isDead() && $wife->isDead()) : ?> - <?php if ($husb->sex() === 'M') : ?> - W + <?php if (!$husb->isDead() && $wife->isDead()) : ?> + <?php if ($husb->sex() === 'M') : ?> + W + <?php endif ?> + <?php if ($husb->sex() === 'F') : ?> + H + <?php endif ?> <?php endif ?> - <?php if ($husb->sex() === 'F') : ?> - H + <?php if (!$husb->isDead() && !$wife->isDead()) : ?> + N <?php endif ?> - <?php endif ?> - <?php if (!$husb->isDead() && !$wife->isDead()) : ?> - N - <?php endif ?> - </td> + </td> - <!-- Filter by roots/leaves --> - <td hidden> - <?php if ($husb->childFamilies()->isEmpty() && $wife->childFamilies()->isEmpty()) : ?> - R - <?php elseif (!$husb->isDead() && !$wife->isDead() && $family->numberOfChildren() === 0) : ?> - L - <?php endif ?> - </td> - </tr> - <?php endforeach ?> + <!-- Filter by roots/leaves --> + <td hidden> + <?php if ($husb->childFamilies()->isEmpty() && $wife->childFamilies()->isEmpty()) : ?> + R + <?php elseif (!$husb->isDead() && !$wife->isDead() && $family->numberOfChildren() === 0) : ?> + L + <?php endif ?> + </td> + </tr> + <?php endforeach ?> </tbody> <tfoot> diff --git a/resources/views/lists/individuals-table.phtml b/resources/views/lists/individuals-table.phtml index c67da31457..101865da03 100644 --- a/resources/views/lists/individuals-table.phtml +++ b/resources/views/lists/individuals-table.phtml @@ -22,17 +22,12 @@ use Illuminate\Support\Collection; * @var Tree $tree */ -// lists requires a unique ID in case there are multiple lists per page -$table_id = Registry::idFactory()->id(); - -$today_jd = Registry::timestampFactory()->now()->julianDay(); -$hundred_years_ago = Registry::timestampFactory()->now()->subtractYears(100)->julianDay(); - -$unique_indis = []; // Don't double-count indis with multiple names. - +// lists require a unique ID in case there are multiple lists per page +$table_id = Registry::idFactory()->id(); +$today_jd = Registry::timestampFactory()->now()->julianDay(); +$hundred_years_ago = Registry::timestampFactory()->now()->subtractYears(100)->julianDay(); $show_estimated_dates = (bool) $tree->getPreference('SHOW_EST_LIST_DATES'); - -$today = new Date(strtoupper(date('d M Y'))); +$today = new Date(strtoupper(date('d M Y'))); $module = app(ModuleService::class) ->findByComponent(ModuleChartInterface::class, $tree, Auth::user()) @@ -206,141 +201,136 @@ $("#<?= e($table_id) ?>") <tbody> <?php foreach ($individuals as $key => $individual) : ?> - <tr class="<?= $individual->isPendingAddition() ? 'wt-new' : '' ?> <?= $individual->isPendingDeletion() ? 'wt-old' : '' ?>"> - <td colspan="2" data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', implode(',', array_reverse(explode(',', $individual->sortName()))))) ?>"> - <?php foreach ($individual->getAllNames() as $num => $name) : ?> - <a title="<?= $name['type'] === '_MARNM' ? I18N::translate('Married name') : '' ?>" href="<?= e($individual->url()) ?>" class="<?= $num === $individual->getPrimaryName() ? '' : 'text-muted' ?>"> - <?= $name['full'] ?> - </a> - <?php if ($num === $individual->getPrimaryName()) : ?> - <small><?= view('icons/sex', ['sex' => $individual->sex()]) ?></small> - <?php endif ?> - <br> - <?php endforeach ?> - <?= view('lists/individual-table-parents', ['individual' => $individual]) ?> - </td> + <tr class="<?= $individual->isPendingAddition() ? 'wt-new' : '' ?> <?= $individual->isPendingDeletion() ? 'wt-old' : '' ?>"> + <td colspan="2" data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', implode(',', array_reverse(explode(',', $individual->sortName()))))) ?>"> + <?php foreach ($individual->getAllNames() as $num => $name) : ?> + <div> + <a title="<?= $name['type'] === '_MARNM' ? I18N::translate('Married name') : '' ?>" href="<?= e($individual->url()) ?>" class="<?= $num === $individual->getPrimaryName() ? '' : 'text-muted' ?>"> + <?= $name['full'] ?> + </a> + <?php if ($num === $individual->getPrimaryName()) : ?> + <small><?= view('icons/sex', ['sex' => $individual->sex()]) ?></small> + <?php endif ?> + </div> + <?php endforeach ?> + <?= view('lists/individual-table-parents', ['individual' => $individual]) ?> + </td> - <td hidden data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', $individual->sortName())) ?>"></td> + <td hidden data-sort="<?= e(str_replace([',', Individual::PRAENOMEN_NESCIO, Individual::NOMEN_NESCIO], 'AAAA', $individual->sortName())) ?>"></td> - <td class="text-center" data-sort="<?= $key ?>"> - <?php if ($sosa) : ?> - <?php if ($module instanceof RelationshipsChartModule) : ?> - <a href="<?= e($module->chartUrl($individuals[1], ['xref2' => $individual->xref()])) ?>" rel="nofollow" title="<?= I18N::translate('Relationships') ?>" rel="nofollow"> + <td class="text-center" data-sort="<?= $key ?>"> + <?php if ($sosa) : ?> + <?php if ($module instanceof RelationshipsChartModule) : ?> + <a href="<?= e($module->chartUrl($individuals[1], ['xref2' => $individual->xref()])) ?>" rel="nofollow" title="<?= I18N::translate('Relationships') ?>" rel="nofollow"> + <?= I18N::number($key) ?> + </a> + <?php else : ?> <?= I18N::number($key) ?> - </a> - <?php else : ?> - <?= I18N::number($key) ?> + <?php endif ?> <?php endif ?> - <?php endif ?> - </td> + </td> - <!-- Birth date --> - <?php $estimated_birth_date = $individual->getEstimatedBirthDate(); ?> + <!-- Birthdate --> + <?php $estimated_birth_date = $individual->getEstimatedBirthDate(); ?> - <td data-sort="<?= $estimated_birth_date->julianDay() ?>"> - <?php $birth_dates = $individual->getAllBirthDates(); ?> + <td data-sort="<?= $estimated_birth_date->julianDay() ?>"> + <?php $birth_dates = $individual->getAllBirthDates(); ?> - <?php foreach ($birth_dates as $n => $birth_date) : ?> - <?= $birth_date->display($tree, null, true) ?> - <br> - <?php endforeach ?> + <?php foreach ($birth_dates as $birth_date) : ?> + <div><?= $birth_date->display($tree, null, true) ?></div> + <?php endforeach ?> - <?php if (empty($birth_dates) && $show_estimated_dates) : ?> - <?= $estimated_birth_date->display($tree, null, true) ?> - <?php endif ?> - </td> - - <!-- Birth anniversary --> - <td class="text-center" data-sort="<?= - $estimated_birth_date->julianDay() ?>"> - <?= (new Age($birth_dates[0] ?? new Date(''), $today))->ageYearsString() ?> - </td> + <?php if ($birth_dates === [] && $show_estimated_dates) : ?> + <?= $estimated_birth_date->display($tree, null, true) ?> + <?php endif ?> + </td> - <!-- birthplace --> - <td data-sort="<?= e($individual->getBirthPlace()->gedcomName()) ?>"> - <?php foreach ($individual->getAllBirthPlaces() as $n => $birth_place) : ?> - <?= $birth_place->shortName(true) ?> - <br> - <?php endforeach ?> - </td> + <!-- Birth anniversary --> + <td class="text-center" data-sort="<?= - $estimated_birth_date->julianDay() ?>"> + <?= (new Age($birth_dates[0] ?? new Date(''), $today))->ageYearsString() ?> + </td> - <!-- Number of children --> - <td class="text-center" data-sort="<?= $individual->numberOfChildren() ?>"> - <?= I18N::number($individual->numberOfChildren()) ?> - </td> + <!-- birthplace --> + <td data-sort="<?= e($individual->getBirthPlace()->gedcomName()) ?>"> + <?php foreach ($individual->getAllBirthPlaces() as $birth_place) : ?> + <div><?= $birth_place->shortName(true) ?></div> + <?php endforeach ?> + </td> - <!-- Death date --> - <?php $death_dates = $individual->getAllDeathDates() ?> - <td data-sort="<?= $individual->getEstimatedDeathDate()->julianDay() ?>"> - <?php foreach ($death_dates as $num => $death_date) : ?> - <?= $death_date->display($tree, null, true) ?> - <br> - <?php endforeach ?> + <!-- Number of children --> + <td class="text-center" data-sort="<?= $individual->numberOfChildren() ?>"> + <?= I18N::number($individual->numberOfChildren()) ?> + </td> - <?php if (empty($death_dates) && $show_estimated_dates && $individual->getEstimatedDeathDate()->minimumDate()->minimumJulianDay() < $today_jd) : ?> - <?= $individual->getEstimatedDeathDate()->display($tree, null, true) ?> - <?php endif ?> - </td> + <!-- Death date --> + <?php $death_dates = $individual->getAllDeathDates() ?> + <td data-sort="<?= $individual->getEstimatedDeathDate()->julianDay() ?>"> + <?php foreach ($death_dates as $num => $death_date) : ?> + <div><?= $death_date->display($tree, null, true) ?></div> + <?php endforeach ?> - <!-- Death anniversary --> - <td class="text-center" data-sort="<?= - $individual->getEstimatedDeathDate()->julianDay() ?>"> - <?= (new Age($death_dates[0] ?? new Date(''), $today))->ageYearsString() ?> - </td> + <?php if ($death_dates === [] && $show_estimated_dates && $individual->getEstimatedDeathDate()->minimumDate()->minimumJulianDay() < $today_jd) : ?> + <?= $individual->getEstimatedDeathDate()->display($tree, null, true) ?> + <?php endif ?> + </td> - <!-- Age at death --> - <?php $age = new Age($birth_dates[0] ?? new Date(''), $death_dates[0] ?? new Date('')) ?> - <td class="text-center" data-sort="<?= $age->ageDays() ?>"> - <?= $age->ageYearsString() ?> - </td> + <!-- Death anniversary --> + <td class="text-center" data-sort="<?= - $individual->getEstimatedDeathDate()->julianDay() ?>"> + <?= (new Age($death_dates[0] ?? new Date(''), $today))->ageYearsString() ?> + </td> - <!-- Death place --> - <td data-sort="<?= e($individual->getDeathPlace()->gedcomName()) ?>"> - <?php foreach ($individual->getAllDeathPlaces() as $n => $death_place) : ?> - <?= $death_place->shortName(true) ?> - <br> - <?php endforeach ?> - </td> + <!-- Age at death --> + <?php $age = new Age($birth_dates[0] ?? new Date(''), $death_dates[0] ?? new Date('')) ?> + <td class="text-center" data-sort="<?= $age->ageDays() ?>"> + <?= $age->ageYearsString() ?> + </td> - <!-- Last change --> - <td data-sort="<?= $individual->lastChangeTimestamp()->timestamp() ?>"> - <?= view('components/datetime', ['timestamp' => $individual->lastChangeTimestamp()]) ?> - </td> + <!-- Death place --> + <td data-sort="<?= e($individual->getDeathPlace()->gedcomName()) ?>"> + <?php foreach ($individual->getAllDeathPlaces() as $death_place) : ?> + <div><?= $death_place->shortName(true) ?></div> + <?php endforeach ?> + </td> - <!-- Filter by sex --> - <td hidden> - <?= $individual->sex() ?> - </td> + <!-- Last change --> + <td data-sort="<?= $individual->lastChangeTimestamp()->timestamp() ?>"> + <?= view('components/datetime', ['timestamp' => $individual->lastChangeTimestamp()]) ?> + </td> - <!-- Filter by birth date --> - <td hidden> - <?php if ($estimated_birth_date->maximumJulianDay() > $hundred_years_ago && $estimated_birth_date->maximumJulianDay() <= $today_jd) : ?> - Y100 - <?php else : ?> - YES - <?php endif ?> - </td> + <!-- Filter by sex --> + <td hidden> + <?= $individual->sex() ?> + </td> - <!-- Filter by death date --> - <td hidden> - <?php if ($individual->getEstimatedDeathDate()->maximumJulianDay() > $hundred_years_ago && $individual->getEstimatedDeathDate()->maximumJulianDay() <= $today_jd) : ?> - Y100 - <?php elseif ($individual->isDead()) : ?> - YES - <?php else : ?> - N - <?php endif ?> - </td> + <!-- Filter by birthdate --> + <td hidden> + <?php if ($estimated_birth_date->maximumJulianDay() > $hundred_years_ago && $estimated_birth_date->maximumJulianDay() <= $today_jd) : ?> + Y100 + <?php else : ?> + YES + <?php endif ?> + </td> - <!-- Filter by roots/leaves --> - <td hidden> - <?php if ($individual->childFamilies()->isEmpty()) : ?> - R - <?php elseif (!$individual->isDead() && $individual->numberOfChildren() < 1) : ?> - L - <?php endif ?> - </td> - </tr> + <!-- Filter by death date --> + <td hidden> + <?php if ($individual->getEstimatedDeathDate()->maximumJulianDay() > $hundred_years_ago && $individual->getEstimatedDeathDate()->maximumJulianDay() <= $today_jd) : ?> + Y100 + <?php elseif ($individual->isDead()) : ?> + YES + <?php else : ?> + N + <?php endif ?> + </td> - <?php $unique_indis[$individual->xref()] = true ?> + <!-- Filter by roots/leaves --> + <td hidden> + <?php if ($individual->childFamilies()->isEmpty()) : ?> + R + <?php elseif (!$individual->isDead() && $individual->numberOfChildren() < 1) : ?> + L + <?php endif ?> + </td> + </tr> <?php endforeach ?> </tbody> |
