xref: /webtrees/resources/views/edit/edit-record.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1c2ed51d1SGreg Roach<?php
2c2ed51d1SGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5c2ed51d1SGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
6c2ed51d1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
7c2ed51d1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRecordAction;
8c2ed51d1SGreg Roachuse Fisharebest\Webtrees\I18N;
9c2ed51d1SGreg Roachuse Fisharebest\Webtrees\Tree;
10c2ed51d1SGreg Roach
11c2ed51d1SGreg Roach/**
12c2ed51d1SGreg Roach * @var bool         $can_edit_raw
13f8505e4aSGreg Roach * @var string       $gedcom
147c2c99faSGreg Roach * @var bool         $has_chan
15f8505e4aSGreg Roach * @var string       $hidden_url
16c2ed51d1SGreg Roach * @var GedcomRecord $record
17c2ed51d1SGreg Roach * @var string       $title
18c2ed51d1SGreg Roach * @var Tree         $tree
19c2ed51d1SGreg Roach */
20c2ed51d1SGreg Roach
21c2ed51d1SGreg Roach?>
22c2ed51d1SGreg Roach
23c2ed51d1SGreg Roach<h2 class="wt-page-title"><?= $title ?></h2>
24c2ed51d1SGreg Roach
25c2ed51d1SGreg Roach<form method="post" action="<?= e(route(EditRecordAction::class, ['tree' => $tree->name(), 'xref' => $record->xref()])) ?>" class="wt-page-content">
26f8505e4aSGreg Roach    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom, 'hierarchy' => [$record->tag()], 'tree' => $tree, 'prefix' => '']) ?>
27c2ed51d1SGreg Roach
289e3c2cf9SGreg Roach    <div class="row mb-3">
29c2ed51d1SGreg Roach        <div class="col-sm-3 wt-page-options-label">
30c2ed51d1SGreg Roach        </div>
31c2ed51d1SGreg Roach        <div class="col-sm-9 wt-page-options-value">
324da96842SGreg Roach            <?php if ($has_chan) : ?>
339e3c2cf9SGreg Roach                <div class="mb-3">
344da96842SGreg Roach                    <?= view('components/checkbox', ['label' => I18N::translate('Keep the existing “last change” information'), 'name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
354da96842SGreg Roach                </div>
364da96842SGreg Roach            <?php endif ?>
374da96842SGreg Roach
38c2ed51d1SGreg Roach            <button class="btn btn-primary" type="submit">
39c2ed51d1SGreg Roach                <?= view('icons/save') ?>
40c2ed51d1SGreg Roach                <?= /* I18N: A button label. */
41c2ed51d1SGreg Roach                I18N::translate('save') ?>
42c2ed51d1SGreg Roach            </button>
4319ec0b5bSGreg Roach
44c2ed51d1SGreg Roach            <a class="btn btn-secondary" href="<?= e($record->url()) ?>">
45c2ed51d1SGreg Roach                <?= view('icons/cancel') ?>
46c2ed51d1SGreg Roach                <?= /* I18N: A button label. */
47c2ed51d1SGreg Roach                I18N::translate('cancel') ?>
48c2ed51d1SGreg Roach            </a>
4919ec0b5bSGreg Roach
50f8505e4aSGreg Roach            <?php if ($hidden_url !== '') : ?>
51f8505e4aSGreg Roach                <a class="btn btn-link" href="<?= e($hidden_url) ?>">
52f8505e4aSGreg Roach                    <?= I18N::translate('Edit with all GEDCOM tags') ?>
53f8505e4aSGreg Roach                </a>
54f8505e4aSGreg Roach            <?php endif; ?>
55f8505e4aSGreg Roach
56c2ed51d1SGreg Roach            <?php if ($can_edit_raw) : ?>
57c2ed51d1SGreg Roach                <a class="btn btn-link" href="<?= e(route(EditRawRecordPage::class, ['xref' => $record->xref(), 'tree' => $tree->name()])) ?>">
58c2ed51d1SGreg Roach                    <?= I18N::translate('Edit the raw GEDCOM') ?>
59c2ed51d1SGreg Roach                </a>
60c2ed51d1SGreg Roach            <?php endif; ?>
61c2ed51d1SGreg Roach        </div>
62c2ed51d1SGreg Roach    </div>
6381443e3cSGreg Roach
6481443e3cSGreg Roach    <?= csrf_field() ?>
65c2ed51d1SGreg Roach</form>
66c2ed51d1SGreg Roach
67c2ed51d1SGreg Roach<?= view('modals/on-screen-keyboard') ?>
68c2ed51d1SGreg Roach<?= view('modals/ajax') ?>
69c2ed51d1SGreg Roach<?= view('edit/initialize-calendar-popup') ?>
70