'; return; } $module_service = app(ModuleService::class); $menus = $module_service->findByComponent(ModuleChartInterface::class, $individual->tree(), Auth::user())->map(function (ModuleChartInterface $module) use ($individual): ?Menu { return $module->chartBoxMenu($individual); })->filter(); foreach ($individual->spouseFamilies() as $family) { $menus[] = new Menu('' . I18N::translate('Family with spouse') . '', $family->url()); $spouse = $family->spouse($individual); if ($spouse && $spouse->canShow()) { $menus->push(new Menu($spouse->fullName(), $spouse->url())); } foreach ($family->children() as $child) { if ($child->canShow()) { $menus->push(new Menu($child->fullName(), $child->url())); } } } // Do not show these facts in the expanded chart boxes. $exclude = [ 'ADDR', 'ALIA', 'ASSO', 'CHAN', 'CHIL', 'EMAIL', 'FAMC', 'FAMS', 'HUSB', 'NAME', 'NOTE', 'OBJE', 'PHON', 'RESI', 'RESN', 'SEX', 'SOUR', 'SSN', 'SUBM', 'TITL', 'URL', 'WIFE', 'WWW', '_EMAIL', '_TODO', '_UID', '_WT_OBJE_SORT', ]; /** @var Collection|Fact[] $all_facts */ $all_facts = $individual->facts(); foreach ($individual->spouseFamilies() as $family) { foreach ($family->facts() as $fact) { $all_facts->push($fact); } } $all_facts = $all_facts->filter(function (Fact $fact) use ($exclude): bool { return !in_array($fact->getTag(), $exclude); }); $all_facts = Fact::sortFacts($all_facts); $id = Uuid::uuid4()->toString(); /** * @var Individual $individual */ ?>
canShow() && $individual->tree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) : ?>
displayImage(40, 50, 'crop', ['class' => 'wt-chart-box-thumbnail']) ?>
fullName() ?>
alternateName() ?>
getLifeSpan() ?>
tree()->getPreference('CHART_BOX_TAGS'), 0, PREG_SPLIT_NO_EMPTY); // Show BIRT or equivalent event foreach (Gedcom::BIRTH_EVENTS as $birttag) { if (!in_array($birttag, $opt_tags)) { $event = $individual->facts([$birttag])->first(); if ($event instanceof Fact) { echo $event->summary(); break; } } } // Show optional events (before death) foreach ($opt_tags as $key => $tag) { if (!in_array($tag, Gedcom::DEATH_EVENTS)) { $event = $individual->facts([$tag])->first(); if ($event instanceof Fact) { echo $event->summary(); unset($opt_tags[$key]); } } } // Show DEAT or equivalent event foreach (Gedcom::DEATH_EVENTS as $deattag) { $event = $individual->facts([$deattag])->first(); if ($event instanceof Fact) { echo $event->summary(); if (in_array($deattag, $opt_tags)) { unset($opt_tags[array_search($deattag, $opt_tags)]); } break; } } // Show remaining optional events (after death) foreach ($opt_tags as $tag) { $event = $individual->facts([$tag])->first(); if ($event instanceof Fact) { echo $event->summary(); } } ?>