xref: /webtrees/resources/views/admin/trees-duplicates.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
10c0910bfSGreg Roach<?php
2dd6b2bfcSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
57c2c99faSGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
60c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
76fd01894SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
85f8464a7SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\MergeFactsPage;
90c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
107c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
117c2c99faSGreg Roach
127c2c99faSGreg Roach/**
137c2c99faSGreg Roach * @var array<string,array<int,array<int,GedcomRecord>>> $duplicates
147c2c99faSGreg Roach * @var Tree                                             $tree
157c2c99faSGreg Roach * @var string                                           $title
167c2c99faSGreg Roach */
170c0910bfSGreg Roach
180c0910bfSGreg Roach?>
190c0910bfSGreg Roach
206fd01894SGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
23dd6b2bfcSGreg Roach
24dd6b2bfcSGreg Roach<?php foreach ($duplicates as $category => $records) : ?>
25dd6b2bfcSGreg Roach    <h2><?= $category ?></h2>
26dd6b2bfcSGreg Roach
27dd6b2bfcSGreg Roach    <?php if (!empty($records)) : ?>
2892ae7c02SGreg Roach        <ol>
29dd6b2bfcSGreg Roach            <?php foreach ($records as $duplicates) : ?>
30dd6b2bfcSGreg Roach                <li>
3139ca88baSGreg Roach                    <?= $duplicates[0]->fullName() ?>
32dd6b2bfcSGreg Roach                    <?php foreach ($duplicates as $record) : ?>
33dd6b2bfcSGreg Roach34dd6b2bfcSGreg Roach                        <a href="<?= e($record->url()) ?>">
35c0935879SGreg Roach                            <?= $record->xref() ?>
36dd6b2bfcSGreg Roach                        </a>
37dd6b2bfcSGreg Roach                    <?php endforeach ?>
38dd6b2bfcSGreg Roach                    <?php if (count($duplicates) === 2) : ?>
39dd6b2bfcSGreg Roach405f8464a7SGreg Roach                        <a href="<?= e(route(MergeFactsPage::class, ['tree' => $tree->name(), 'xref1' => $duplicates[0]->xref(), 'xref2' => $duplicates[1]->xref()])) ?>">
41dd6b2bfcSGreg Roach                            <?= I18N::translate('Merge') ?>
42dd6b2bfcSGreg Roach                        </a>
43dd6b2bfcSGreg Roach                    <?php endif ?>
44dd6b2bfcSGreg Roach                </li>
45dd6b2bfcSGreg Roach            <?php endforeach ?>
4692ae7c02SGreg Roach        </ol>
47dd6b2bfcSGreg Roach    <?php else : ?>
48dd6b2bfcSGreg Roach        <p><?= I18N::translate('No duplicates have been found.') ?></p>
49dd6b2bfcSGreg Roach    <?php endif ?>
50dd6b2bfcSGreg Roach<?php endforeach ?>
51