xref: /webtrees/resources/views/edit/edit-record.phtml (revision 99125a335d0be11b975e213c69fc4ede0c5303f1)
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 bool         $has_chan
12 * @var GedcomRecord $record
13 * @var string       $title
14 * @var Tree         $tree
15 */
16
17?>
18
19<h2 class="wt-page-title"><?= $title ?></h2>
20
21<form method="post" action="<?= e(route(EditRecordAction::class, ['tree' => $tree->name(), 'xref' => $record->xref()])) ?>" class="wt-page-content">
22    <?= csrf_field() ?>
23
24    <?= view('edit/edit-gedcom-fields', ['gedcom' => $record->insertMissingSubtags(), 'hierarchy' => [$record->tag()], 'tree' => $tree, 'prefix' => '']) ?>
25
26    <div class="form-group row">
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="form-group">
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            <a class="btn btn-secondary" href="<?= e($record->url()) ?>">
42                <?= view('icons/cancel') ?>
43                <?= /* I18N: A button label. */
44                I18N::translate('cancel') ?>
45            </a>
46            <?php if ($can_edit_raw) : ?>
47                <a class="btn btn-link" href="<?= e(route(EditRawRecordPage::class, ['xref' => $record->xref(), 'tree' => $tree->name()])) ?>">
48                    <?= I18N::translate('Edit the raw GEDCOM') ?>
49                </a>
50            <?php endif; ?>
51        </div>
52    </div>
53</form>
54
55<?= view('modals/on-screen-keyboard') ?>
56<?= view('modals/ajax') ?>
57<?= view('edit/initialize-calendar-popup') ?>
58