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