1dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Auth; ?> 2dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Config; ?> 3dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?> 4dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\GedcomTag; ?> 5dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?> 6dd6b2bfcSGreg Roach<?php use Ramsey\Uuid\Uuid; ?> 7dd6b2bfcSGreg Roach 8dd6b2bfcSGreg Roach<h2 class="wt-page-title"><?= $title ?></h2> 9dd6b2bfcSGreg Roach 10c0935879SGreg Roach<form class="wt-page-content" action="<?= e(route('update-fact', ['ged' => $tree->name(), 'xref' => $record->xref(), 'fact_id' => $edit_fact->id()])) ?>" method="post"> <?= csrf_field() ?> 11dd6b2bfcSGreg Roach 12dd6b2bfcSGreg Roach <?php FunctionsEdit::createEditForm($edit_fact) ?> 13dd6b2bfcSGreg Roach 14dd6b2bfcSGreg Roach <?php 15dd6b2bfcSGreg Roach $level1type = $edit_fact->getTag(); 16dd6b2bfcSGreg Roach switch ($record::RECORD_TYPE) { 17dd6b2bfcSGreg Roach case 'FAM': 18dd6b2bfcSGreg Roach case 'INDI': 19dd6b2bfcSGreg Roach // FAM and INDI records have real facts. They can take NOTE/SOUR/OBJE/etc. 20dd6b2bfcSGreg Roach if ($level1type !== 'SEX' && $level1type !== 'NOTE' && $level1type !== 'ALIA') { 21dd6b2bfcSGreg Roach if ($level1type !== 'SOUR') { 22dd6b2bfcSGreg Roach echo view('cards/add-source-citation', [ 23dd6b2bfcSGreg Roach 'level' => 2, 24dd6b2bfcSGreg Roach 'full_citations' => $tree->getPreference('FULL_SOURCES'), 25dd6b2bfcSGreg Roach 'tree' => $tree, 26dd6b2bfcSGreg Roach ]); 27dd6b2bfcSGreg Roach } 28dd6b2bfcSGreg Roach if ($level1type !== 'OBJE') { 29dd6b2bfcSGreg Roach if ($tree->getPreference('MEDIA_UPLOAD') >= Auth::accessLevel($tree)) { 30dd6b2bfcSGreg Roach echo view('cards/add-media-object', [ 31dd6b2bfcSGreg Roach 'level' => 2, 32dd6b2bfcSGreg Roach 'tree' => $tree, 33dd6b2bfcSGreg Roach ]); 34dd6b2bfcSGreg Roach } 35dd6b2bfcSGreg Roach } 36dd6b2bfcSGreg Roach echo view('cards/add-note', [ 37dd6b2bfcSGreg Roach 'level' => 2, 38dd6b2bfcSGreg Roach 'tree' => $tree, 39dd6b2bfcSGreg Roach ]); 40dd6b2bfcSGreg Roach echo view('cards/add-shared-note', [ 41dd6b2bfcSGreg Roach 'level' => 2, 42dd6b2bfcSGreg Roach 'tree' => $tree, 43dd6b2bfcSGreg Roach ]); 44dd6b2bfcSGreg Roach if ($level1type !== 'ASSO' && $level1type !== 'NOTE' && $level1type !== 'SOUR') { 45dd6b2bfcSGreg Roach echo view('cards/add-associate', [ 46dd6b2bfcSGreg Roach 'id' => Uuid::uuid4()->toString(), 47dd6b2bfcSGreg Roach 'level' => 2, 48dd6b2bfcSGreg Roach 'tree' => $tree, 49dd6b2bfcSGreg Roach ]); 50dd6b2bfcSGreg Roach } 51dd6b2bfcSGreg Roach // allow to add godfather and godmother for CHR fact or best man and bridesmaid for MARR fact in one window 52*22d65e5aSGreg Roach if (in_array($level1type, Config::twoAssociates(), true)) { 53dd6b2bfcSGreg Roach echo view('cards/add-associate', [ 54dd6b2bfcSGreg Roach 'id' => Uuid::uuid4()->toString(), 55dd6b2bfcSGreg Roach 'level' => 2, 56dd6b2bfcSGreg Roach 'tree' => $tree, 57dd6b2bfcSGreg Roach ]); 58dd6b2bfcSGreg Roach } 59dd6b2bfcSGreg Roach if ($level1type !== 'SOUR') { 60dd6b2bfcSGreg Roach echo view('cards/add-restriction', [ 61dd6b2bfcSGreg Roach 'level' => 2, 62dd6b2bfcSGreg Roach 'tree' => $tree, 63dd6b2bfcSGreg Roach ]); 64dd6b2bfcSGreg Roach } 65dd6b2bfcSGreg Roach } 66dd6b2bfcSGreg Roach break; 67dd6b2bfcSGreg Roach default: 68dd6b2bfcSGreg Roach // Other types of record do not have these lower-level records 69dd6b2bfcSGreg Roach break; 70dd6b2bfcSGreg Roach } 71dd6b2bfcSGreg Roach 72dd6b2bfcSGreg Roach ?> 73dd6b2bfcSGreg Roach 74dd6b2bfcSGreg Roach <div class="form-group row"> 75dd6b2bfcSGreg Roach <label class="col-sm-3 col-form-label" for="keep_chan"> 76dd6b2bfcSGreg Roach <?= I18N::translate('Last change') ?> 77dd6b2bfcSGreg Roach </label> 78dd6b2bfcSGreg Roach <div class="col-sm-9"> 79b6c326d8SGreg Roach <?= view('components/checkbox-inline', ['label' => I18N::translate('Keep the existing “last change” information'), 'name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?> 804459dc9aSGreg Roach <?= GedcomTag::getLabelValue('DATE', view('components/datetime', ['timestamp' => $record->lastChangeTimestamp()])) ?> 81dd6b2bfcSGreg Roach <?= GedcomTag::getLabelValue('_WT_USER', e($record->lastChangeUser())) ?> 82dd6b2bfcSGreg Roach </div> 83dd6b2bfcSGreg Roach </div> 84dd6b2bfcSGreg Roach 85dd6b2bfcSGreg Roach <div class="form-group row"> 86dd6b2bfcSGreg Roach <div class="col-sm-3 wt-page-options-label"> 87dd6b2bfcSGreg Roach </div> 88dd6b2bfcSGreg Roach <div class="col-sm-9 wt-page-options-value"> 89dd6b2bfcSGreg Roach <button class="btn btn-primary" type="submit"> 90d993d560SGreg Roach <?= view('icons/save') ?> 91dd6b2bfcSGreg Roach <?= /* I18N: A button label. */ 92dd6b2bfcSGreg Roach I18N::translate('save') ?> 93dd6b2bfcSGreg Roach </button> 94dd6b2bfcSGreg Roach <a class="btn btn-secondary" href="<?= e($record->url()) ?>"> 95d993d560SGreg Roach <?= view('icons/cancel') ?> 96dd6b2bfcSGreg Roach <?= /* I18N: A button label. */ 97dd6b2bfcSGreg Roach I18N::translate('cancel') ?> 98dd6b2bfcSGreg Roach </a> 99dd6b2bfcSGreg Roach <?php if ($can_edit_raw) : ?> 100c0935879SGreg Roach <a class="btn btn-link" href="<?= e(route('edit-raw-fact', ['xref' => $record->xref(), 'fact_id' => $edit_fact->id(), 'ged' => $tree->name()])) ?>"> 101dd6b2bfcSGreg Roach <?= I18N::translate('Edit the raw GEDCOM') ?> 102dd6b2bfcSGreg Roach </a> 103dd6b2bfcSGreg Roach <?php endif; ?> 104dd6b2bfcSGreg Roach </div> 105dd6b2bfcSGreg Roach </div> 106dd6b2bfcSGreg Roach</form> 107dd6b2bfcSGreg Roach 108dd6b2bfcSGreg Roach<?= view('modals/on-screen-keyboard') ?> 109dd6b2bfcSGreg Roach<?= view('modals/ajax') ?> 110dd6b2bfcSGreg Roach<?= view('edit/initialize-calendar-popup') ?> 111