xref: /webtrees/resources/views/edit/link-child-to-family.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\LinkChildToFamilyAction;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Individual;
8use Fisharebest\Webtrees\Registry;
9use Fisharebest\Webtrees\Tree;
10
11/**
12 * @var Individual $individual
13 * @var string     $title
14 * @var Tree       $tree
15 * @var string     $xref
16 */
17
18?>
19
20<h2 class="wt-page-title"><?= $title ?></h2>
21
22<form method="post" action="<?= e(route(LinkChildToFamilyAction::class, ['tree' => $tree->name(), 'xref' => $xref])) ?>" class="wt-page-content">
23    <div class="row mb-3">
24        <label class="col-sm-3 col-form-label" for="famid">
25            <?= I18N::translate('Family') ?>
26        </label>
27        <div class="col-sm-9">
28            <?= view('components/select-family', ['name' => 'famid', 'tree' => $tree]) ?>
29        </div>
30    </div>
31
32    <div class="row mb-3">
33        <label class="col-sm-3 col-form-label" for="PEDI">
34            <?= Registry::elementFactory()->make('INDI:FAMC:PEDI')->label() ?>
35        </label>
36        <div class="col-sm-9">
37            <?= Registry::elementFactory()->make('INDI:FAMC:PEDI')->edit('PEDI', 'PEDI', '', $tree) ?>
38            <div class="form-text">
39                <?= I18N::translate('A child may have more than one set of parents. The relationship between the child and the parents can be biological, legal, or based on local culture and tradition. If no pedigree is specified, then a biological relationship will be assumed.') ?>
40            </div>
41        </div>
42    </div>
43
44    <div class="row mb-3">
45        <div class="col-sm-9 offset-sm-3">
46            <button class="btn btn-primary" type="submit">
47                <?= view('icons/save') ?>
48                <?= /* I18N: A button label. */
49                I18N::translate('save') ?>
50            </button>
51            <a class="btn btn-secondary" href="<?= e($individual->url()) ?>">
52                <?= view('icons/cancel') ?>
53                <?= /* I18N: A button label. */
54                I18N::translate('cancel') ?>
55            </a>
56        </div>
57    </div>
58
59    <?= csrf_field() ?>
60</form>
61