xref: /webtrees/resources/views/admin/merge-records-step-2.phtml (revision 836659ecfde53265896a47031b990c837ddc95f0)
1<?php
2
3use Fisharebest\Webtrees\GedcomRecord;
4use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
5use Fisharebest\Webtrees\Http\RequestHandlers\MergeFactsAction;
6use Fisharebest\Webtrees\I18N;
7
8?>
9
10<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route('manage-trees', ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
11
12<h1><?= $title ?></h1>
13
14<form method="post" action="<?= e(route(MergeFactsAction::class, ['tree' => $tree->name()])) ?>">
15    <?= csrf_field() ?>
16
17    <input type="hidden" name="xref1" value="<?= e($record1->xref()) ?>">
18    <input type="hidden" name="xref2" value="<?= e($record2->xref()) ?>">
19
20    <p>
21        <?= I18N::translate('Select the facts and events to keep from both records.') ?>
22    </p>
23    <div class="card mb-4">
24        <div class="card-header">
25            <h2 class="card-title">
26                <?= I18N::translate('The following facts and events were found in both records.') ?>
27            </h2>
28        </div>
29        <div class="card-body">
30            <?php if (!empty($facts)) : ?>
31                <table class="table table-bordered table-sm">
32                    <thead>
33                        <tr>
34                            <th>
35                                <?= I18N::translate('Select') ?>
36                            </th>
37                            <th>
38                                <?= I18N::translate('Details') ?>
39                            </th>
40                        </tr>
41                    </thead>
42                    <tbody>
43                        <?php foreach ($facts as $fact_id => $fact) : ?>
44                            <tr>
45                                <td>
46                                    <input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked>
47                                </td>
48                                <td>
49                                    <div class="gedcom-data" dir="ltr"><?= e($fact->gedcom()) ?></div>
50                                    <?php if ($fact->target() instanceof GedcomRecord) : ?>
51                                        <a href="<?= e($fact->target()->url()) ?>">
52                                            <?= $fact->target()->fullName() ?>
53                                        </a>
54                                    <?php endif ?>
55                                </td>
56                            </tr>
57                        <?php endforeach ?>
58                    </tbody>
59                </table>
60            <?php else : ?>
61                <p>
62                    <?= I18N::translate('No matching facts found') ?>
63                </p>
64            <?php endif ?>
65        </div>
66    </div>
67
68    <div class="row">
69        <div class="col-sm-6">
70            <div class="card">
71                <div class="card-header">
72                    <h2 class="card-title">
73                        <?= /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . e($record1->url()) . '">' . $record1->fullName()) . '</a>' ?>
74                    </h2>
75                </div>
76                <div class="card-body">
77                    <?php if (!empty($facts1)) : ?>
78                        <table class="table table-bordered table-sm">
79                            <thead>
80                                <tr>
81                                    <th>
82                                        <?= I18N::translate('Select') ?>
83                                    </th>
84                                    <th>
85                                        <?= I18N::translate('Details') ?>
86                                    </th>
87                                </tr>
88                            </thead>
89                            <tbody>
90                                <?php foreach ($facts1 as $fact_id => $fact) : ?>
91                                    <tr>
92                                        <td>
93                                            <input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked>
94                                        </td>
95                                        <td>
96                                            <div class="gedcom-data" dir="ltr"><?= e($fact->gedcom()) ?></div>
97                                            <?php if ($fact->target() instanceof GedcomRecord) : ?>
98                                                <a href="<?= e($fact->target()->url()) ?>">
99                                                    <?= $fact->target()->fullName() ?>
100                                                </a>
101                                            <?php endif ?>
102                                        </td>
103                                    </tr>
104                                <?php endforeach ?>
105                            </tbody>
106                        </table>
107                    <?php else : ?>
108                        <p>
109                            <?= I18N::translate('No matching facts found') ?>
110                        </p>
111                    <?php endif ?>
112                </div>
113            </div>
114        </div>
115        <div class="col-sm-6">
116            <div class="card">
117                <div class="card-header">
118                    <h2 class="card-title">
119                        <?= /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . e($record2->url()) . '">' . $record2->fullName()) . '</a>' ?>
120                    </h2>
121                </div>
122                <div class="card-body">
123                    <?php if (!empty($facts2)) : ?>
124                        <table class="table table-bordered table-sm">
125                            <thead>
126                                <tr>
127                                    <th>
128                                        <?= I18N::translate('Select') ?>
129                                    </th>
130                                    <th>
131                                        <?= I18N::translate('Details') ?>
132                                    </th>
133                                </tr>
134                            </thead>
135                            <tbody>
136                                <?php foreach ($facts2 as $fact_id => $fact) : ?>
137                                    <tr>
138                                        <td>
139                                            <input type="checkbox" name="keep2[]" value="<?= $fact->id() ?>" checked>
140                                        </td>
141                                        <td>
142                                            <div class="gedcom-data" dir="ltr"><?= e($fact->gedcom()) ?></div>
143                                            <?php if ($fact->target() instanceof GedcomRecord) : ?>
144                                                <a href="<?= e($fact->target()->url()) ?>">
145                                                    <?= $fact->target()->fullName() ?>
146                                                </a>
147                                            <?php endif ?>
148                                        </td>
149                                    </tr>
150                                <?php endforeach ?>
151                            </tbody>
152                        </table>
153                    <?php else : ?>
154                        <p>
155                            <?= I18N::translate('No matching facts found') ?>
156                        </p>
157                    <?php endif ?>
158                </div>
159            </div>
160        </div>
161    </div>
162
163    <button type="submit" class="btn btn-primary">
164        <?= view('icons/save') ?>
165        <?= I18N::translate('save') ?>
166    </button>
167</form>
168