xref: /webtrees/resources/views/edit/link-spouse-to-individual.phtml (revision 2ec6adfb1a72db53f622dde7c671ffffa02e7a2f)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
310e06497SGreg Roachdeclare(strict_types=1);
410e06497SGreg Roach
57c7d1e03SGreg Roachuse Fisharebest\Webtrees\I18N;
69ba2a180SGreg Roachuse Fisharebest\Webtrees\Services\GedcomEditService;
77c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
87c2c99faSGreg Roach
97c2c99faSGreg Roach/**
10efd4768bSGreg Roach * @var string            $cancel_url
119ba2a180SGreg Roach * @var GedcomEditService $gedcom_edit_service
129ba2a180SGreg Roach * @var string            $label
13efd4768bSGreg Roach * @var string            $post_url
149ba2a180SGreg Roach * @var string            $title
157c2c99faSGreg Roach * @var Tree              $tree
167c2c99faSGreg Roach */
17d70512abSGreg Roach
18d70512abSGreg Roach?>
19dd6b2bfcSGreg Roach
20dd6b2bfcSGreg Roach<h2 class="wt-page-title"><?= $title ?></h2>
21dd6b2bfcSGreg Roach
22efd4768bSGreg Roach<form method="post" action="<?= e($post_url) ?>" class="wt-page-content">
23efd4768bSGreg Roach    <div class="card mb-2">
24efd4768bSGreg Roach        <div class="card-header">
25dd6b2bfcSGreg Roach            <?= $label ?>
26efd4768bSGreg Roach        </div>
27efd4768bSGreg Roach        <div class="card-body pb-1">
28b6c326d8SGreg Roach            <?= view('components/select-individual', ['name' => 'spid', 'id' => 'spouse', 'tree' => $tree]) ?>
29dd6b2bfcSGreg Roach        </div>
30dd6b2bfcSGreg Roach    </div>
31dd6b2bfcSGreg Roach
32efd4768bSGreg Roach    <?php foreach ($facts ?? [] as $prefix => $prefix_facts) : ?>
33efd4768bSGreg Roach        <?php foreach ($prefix_facts as $fact) : ?>
34efd4768bSGreg Roach            <div class="card mb-2">
35efd4768bSGreg Roach                <div class="card-header">
36efd4768bSGreg Roach                    <?= $fact->label() ?>
37efd4768bSGreg Roach                </div>
38efd4768bSGreg Roach                <div class="card-body pb-1">
399ba2a180SGreg Roach                    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom_edit_service->insertMissingFactSubtags($fact, false), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => $prefix]) ?>
40efd4768bSGreg Roach                </div>
41efd4768bSGreg Roach            </div>
42efd4768bSGreg Roach        <?php endforeach ?>
43efd4768bSGreg Roach    <?php endforeach ?>
44dd6b2bfcSGreg Roach
459e3c2cf9SGreg Roach    <div class="row mb-3">
46dd6b2bfcSGreg Roach        <div class="col-sm-9 offset-sm-3">
47dd6b2bfcSGreg Roach            <button class="btn btn-primary" type="submit">
48d993d560SGreg Roach                <?= view('icons/save') ?>
49dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */
50dd6b2bfcSGreg Roach                I18N::translate('save') ?>
51dd6b2bfcSGreg Roach            </button>
52efd4768bSGreg Roach            <a class="btn btn-secondary" href="<?= e($cancel_url) ?>">
53d993d560SGreg Roach                <?= view('icons/cancel') ?>
54dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */
55dd6b2bfcSGreg Roach                I18N::translate('cancel') ?>
56dd6b2bfcSGreg Roach            </a>
57dd6b2bfcSGreg Roach        </div>
58dd6b2bfcSGreg Roach    </div>
5981443e3cSGreg Roach
6081443e3cSGreg Roach    <?= csrf_field() ?>
61dd6b2bfcSGreg Roach</form>
62*2ec6adfbSGreg Roach
63*2ec6adfbSGreg Roach<?= view('modals/ajax') ?>
64