xref: /webtrees/resources/views/admin/trees-merge.phtml (revision 6f59525087dd4ee1d17c7375524d95ace7942861)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\MergeTreesAction;
5use Fisharebest\Webtrees\Http\RequestHandlers\RenumberTreePage;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var string               $title
11 * @var Tree|null            $tree1
12 * @var Tree|null            $tree2
13 * @var array<string,string> $tree_list
14 * @var int                  $xrefs
15 */
16
17?>
18
19<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
20
21<h1><?= $title ?></h1>
22
23<?php if ($xrefs > 0) : ?>
24    <p>
25        <?= I18N::translate('In a family tree, each record has an internal reference number (called an “XREF”) such as “F123” or “R14”.') ?>
26    </p>
27    <p>
28        <?= I18N::plural(/* I18N: An XREF is the identification number used in GEDCOM files. */ 'The two family trees have %1$s record which uses the same “XREF”.', 'The two family trees have %1$s records which use the same “XREF”.', $xrefs, I18N::number($xrefs)) ?>
29    </p>
30    <p>
31        <?= I18N::translate('You must renumber the records in one of the trees before you can merge them.') ?>
32    </p>
33    <p>
34        <a class="current" href="<?= e(route(RenumberTreePage::class, ['tree' => $tree1->name()])) ?>">
35            <?= I18N::translate('Renumber family tree') ?><?= e($tree1->title()) ?>
36        </a>
37    </p>
38    <p>
39        <a class="current" href="<?= e(route(RenumberTreePage::class, ['tree' => $tree2->name()])) ?>">
40            <?= I18N::translate('Renumber family tree') ?><?= e($tree2->title()) ?>
41        </a>
42    </p>
43<?php endif ?>
44
45<form method="post" action="<?= e(route(MergeTreesAction::class)) ?>">
46    <?= csrf_field() ?>
47
48    <div>
49        <?= I18N::translate(/* I18N: Copy all the records from [family tree 1] into [family tree 2] */
50            'Copy all the records from %1$s into %2$s.',
51            view('components/select', ['name' => 'tree1_name', 'selected' => $tree1 instanceof Tree ? $tree1->name() : '', 'options' => $tree_list]),
52            view('components/select', ['name' => 'tree2_name', 'selected' => $tree2 instanceof Tree ? $tree2->name() : '', 'options' => $tree_list])
53        ) ?>
54    </div>
55
56    <div>
57        <button type="submit" class="btn btn-primary">
58            <?= view('icons/save') ?>
59            <?= I18N::translate('continue') ?>
60        </button>
61    </div>
62</form>
63
64<?= I18N::translate('Caution! This may take a long time. Be patient.') ?>
65