xref: /webtrees/resources/views/admin/trees-duplicates.phtml (revision b62a8ecaef02a45d7e018fdb0f702d4575d8d0de)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
5use Fisharebest\Webtrees\Http\RequestHandlers\MergeFactsPage;
6use Fisharebest\Webtrees\I18N;
7
8?>
9
10<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
11
12<h1><?= $title ?></h1>
13
14<?php foreach ($duplicates as $category => $records) : ?>
15    <h2><?= $category ?></h2>
16
17    <?php if (!empty($records)) : ?>
18        <ul>
19            <?php foreach ($records as $duplicates) : ?>
20                <li>
21                    <?= $duplicates[0]->fullName() ?>
22                    <?php foreach ($duplicates as $record) : ?>
2324                        <a href="<?= e($record->url()) ?>">
25                            <?= $record->xref() ?>
26                        </a>
27                    <?php endforeach ?>
28                    <?php if (count($duplicates) === 2) : ?>
2930                        <a href="<?= e(route(MergeFactsPage::class, ['tree' => $tree->name(), 'xref1' => $duplicates[0]->xref(), 'xref2' => $duplicates[1]->xref()])) ?>">
31                            <?= I18N::translate('Merge') ?>
32                        </a>
33                    <?php endif ?>
34                </li>
35            <?php endforeach ?>
36        </ul>
37    <?php else : ?>
38        <p><?= I18N::translate('No duplicates have been found.') ?></p>
39    <?php endif ?>
40<?php endforeach ?>
41