xref: /webtrees/resources/views/admin/trees-duplicates.phtml (revision efd4768b0eab1f325771cdbc6181ff84f85f2149)
1<?php
2
3use Fisharebest\Webtrees\GedcomRecord;
4use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
5use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
6use Fisharebest\Webtrees\Http\RequestHandlers\MergeFactsPage;
7use Fisharebest\Webtrees\I18N;
8use Fisharebest\Webtrees\Tree;
9
10/**
11 * @var array<string,array<int,array<int,GedcomRecord>>> $duplicates
12 * @var Tree                                             $tree
13 * @var string                                           $title
14 */
15
16?>
17
18<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
19
20<h1><?= $title ?></h1>
21
22<?php foreach ($duplicates as $category => $records) : ?>
23    <h2><?= $category ?></h2>
24
25    <?php if (!empty($records)) : ?>
26        <ol>
27            <?php foreach ($records as $duplicates) : ?>
28                <li>
29                    <?= $duplicates[0]->fullName() ?>
30                    <?php foreach ($duplicates as $record) : ?>
3132                        <a href="<?= e($record->url()) ?>">
33                            <?= $record->xref() ?>
34                        </a>
35                    <?php endforeach ?>
36                    <?php if (count($duplicates) === 2) : ?>
3738                        <a href="<?= e(route(MergeFactsPage::class, ['tree' => $tree->name(), 'xref1' => $duplicates[0]->xref(), 'xref2' => $duplicates[1]->xref()])) ?>">
39                            <?= I18N::translate('Merge') ?>
40                        </a>
41                    <?php endif ?>
42                </li>
43            <?php endforeach ?>
44        </ol>
45    <?php else : ?>
46        <p><?= I18N::translate('No duplicates have been found.') ?></p>
47    <?php endif ?>
48<?php endforeach ?>
49