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