xref: /webtrees/resources/views/admin/trees-renumber.phtml (revision 58c781b3c055e42036269e115fb5a3c4643b0df4)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
5use Fisharebest\Webtrees\Http\RequestHandlers\RenumberTreeAction;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var Tree          $tree
11 * @var string        $title
12 * @var array<string> $xrefs
13 */
14
15?>
16
17<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
18
19<h1><?= $title ?></h1>
20
21<p>
22    <?= I18N::translate('In a family tree, each record has an internal reference number (called an “XREF”) such as “F123” or “R14”.') ?>
23</p>
24
25<p>
26    <?= I18N::translate('You can renumber the records in a family tree, so that these internal reference numbers are not duplicated in any other family tree.') ?>
27</p>
28
29<p>
30    <?= I18N::plural('This family tree has %s record which uses the same “XREF” as another family tree.', 'This family tree has %s records which use the same “XREF” as another family tree.', count($xrefs), I18N::number(count($xrefs))) ?>
31</p>
32
33<?php if (!empty($xrefs)) : ?>
34    <p>
35        <?= I18N::translate('You can renumber this family tree.') ?>
36    </p>
37
38    <form method="post" action="<?= e(route(RenumberTreeAction::class, ['tree' => $tree->name()])) ?>">
39        <button type="submit" class="btn btn-primary">
40            <?= view('icons/save') ?>
41            <?= /* I18N: A button label. */
42            I18N::translate('continue') ?>
43        </button>
44
45        <?= I18N::translate('Caution! This may take a long time. Be patient.') ?>
46
47        <?= csrf_field() ?>
48    </form>
49<?php endif ?>
50