diff options
| -rw-r--r-- | app/Fact.php | 20 | ||||
| -rw-r--r-- | app/Functions/FunctionsPrintFacts.php | 32 | ||||
| -rw-r--r-- | app/GedcomRecord.php | 6 | ||||
| -rw-r--r-- | app/Http/Controllers/AdminController.php | 14 | ||||
| -rw-r--r-- | app/Http/Controllers/AdminTreesController.php | 4 | ||||
| -rw-r--r-- | app/Http/Controllers/EditFamilyController.php | 16 | ||||
| -rw-r--r-- | app/Http/Controllers/EditGedcomRecordController.php | 12 | ||||
| -rw-r--r-- | app/Http/Controllers/EditIndividualController.php | 10 | ||||
| -rw-r--r-- | app/Http/Controllers/IndividualController.php | 6 | ||||
| -rw-r--r-- | app/MediaFile.php | 4 | ||||
| -rw-r--r-- | resources/views/admin/merge-records-step-2.phtml | 6 | ||||
| -rw-r--r-- | resources/views/edit/edit-fact.phtml | 4 | ||||
| -rw-r--r-- | resources/views/edit/new-individual.phtml | 4 | ||||
| -rw-r--r-- | resources/views/edit/reorder-children.phtml | 2 | ||||
| -rw-r--r-- | resources/views/edit/reorder-media.phtml | 2 | ||||
| -rw-r--r-- | resources/views/edit/reorder-names.phtml | 2 | ||||
| -rw-r--r-- | resources/views/edit/reorder-spouses.phtml | 2 |
17 files changed, 73 insertions, 73 deletions
diff --git a/app/Fact.php b/app/Fact.php index a7f70cd030..0c73158c34 100644 --- a/app/Fact.php +++ b/app/Fact.php @@ -132,7 +132,7 @@ class Fact ]; /** @var string Unique identifier for this fact (currently implemented as a hash of the raw data). */ - private $fact_id; + private $id; /** @var GedcomRecord The GEDCOM record from which this fact is taken */ private $record; @@ -165,17 +165,17 @@ class Fact * * @param string $gedcom * @param GedcomRecord $parent - * @param string $fact_id + * @param string $id * * @throws InvalidArgumentException */ - public function __construct($gedcom, GedcomRecord $parent, $fact_id) + public function __construct($gedcom, GedcomRecord $parent, $id) { if (preg_match('/^1 (' . WT_REGEX_TAG . ')/', $gedcom, $match)) { - $this->gedcom = $gedcom; - $this->record = $parent; - $this->fact_id = $fact_id; - $this->tag = $match[1]; + $this->gedcom = $gedcom; + $this->record = $parent; + $this->id = $id; + $this->tag = $match[1]; } else { throw new InvalidArgumentException('Invalid GEDCOM data passed to Fact::_construct(' . $gedcom . ')'); } @@ -341,9 +341,9 @@ class Fact * * @return string */ - public function getFactId(): string + public function id(): string { - return $this->fact_id; + return $this->id; } /** @@ -655,6 +655,6 @@ class Fact */ public function __toString() { - return $this->fact_id . '@' . $this->record->getXref(); + return $this->id . '@' . $this->record->getXref(); } } diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index ea13dae8e1..823c8a7a38 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -123,12 +123,12 @@ class FunctionsPrintFacts } // Event of close associates - if ($fact->getFactId() == 'asso') { + if ($fact->id() == 'asso') { $styleadd = trim($styleadd . ' wt-relation-fact collapse'); } // historical facts - if ($fact->getFactId() == 'histo') { + if ($fact->id() == 'histo') { $styleadd = trim($styleadd . ' wt-historic-fact collapse'); } @@ -193,7 +193,7 @@ class FunctionsPrintFacts break; } - if ($fact->getFactId() != 'histo' && $fact->canEdit()) { + if ($fact->id() != 'histo' && $fact->canEdit()) { ?> <?= $label ?> <div class="editfacts"> @@ -201,20 +201,20 @@ class FunctionsPrintFacts 'class' => 'btn btn-link', 'href' => route('edit-fact', [ 'xref' => $parent->getXref(), - 'fact_id' => $fact->getFactId(), + 'fact_id' => $fact->id(), 'ged' => $tree->getName(), ]), ]) ?> <?= FontAwesome::linkIcon('copy', I18N::translate('Copy'), [ 'class' => 'btn btn-link', 'href' => '#', - 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]) ?> <?= FontAwesome::linkIcon('delete', I18N::translate('Delete'), [ 'class' => 'btn btn-link', 'data-confirm' => I18N::translate('Are you sure you want to delete this fact?'), 'href' => '#', - 'onclick' => 'return delete_fact(this.dataset.confirm, "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return delete_fact(this.dataset.confirm, "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]) ?> </div> <?php @@ -354,7 +354,7 @@ class FunctionsPrintFacts } // Print the associates of this fact/event - if ($fact->getFactId() !== 'asso') { + if ($fact->id() !== 'asso') { echo self::formatAssociateRelationship($fact); } @@ -784,7 +784,7 @@ class FunctionsPrintFacts } elseif ($can_edit) { echo '<a href="' . e(route('edit-fact', [ 'xref' => $parent->getXref(), - 'fact_id' => $fact->getFactId(), + 'fact_id' => $fact->id(), 'ged' => $tree->getName(), ])) . '" title="', I18N::translate('Edit'), '">'; if ($tree->getPreference('SHOW_FACT_ICONS')) { @@ -802,21 +802,21 @@ class FunctionsPrintFacts 'class' => 'btn btn-link', 'href' => route('edit-fact', [ 'xref' => $parent->getXref(), - 'fact_id' => $fact->getFactId(), + 'fact_id' => $fact->id(), 'ged' => $tree->getName(), ]), ]); echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), [ 'class' => 'btn btn-link', 'href' => '#', - 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]); } echo FontAwesome::linkIcon('delete', I18N::translate('Delete'), [ 'class' => 'btn btn-link', 'data-confirm' => I18N::translate('Are you sure you want to delete this fact?'), 'href' => '#', - 'onclick' => 'return delete_fact(this.dataset.confirm, "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return delete_fact(this.dataset.confirm, "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]); } else { echo GedcomTag::getLabel($factname, $parent); @@ -1027,20 +1027,20 @@ class FunctionsPrintFacts 'class' => 'btn btn-link', 'href' => route('edit-fact', [ 'xref' => $parent->getXref(), - 'fact_id' => $fact->getFactId(), + 'fact_id' => $fact->id(), 'ged' => $tree->getName(), ]), ]); echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), [ 'class' => 'btn btn-link', 'href' => '#', - 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]); echo FontAwesome::linkIcon('delete', I18N::translate('Delete'), [ 'class' => 'btn btn-link', 'data-confirm' => I18N::translate('Are you sure you want to delete this fact?'), 'href' => '#', - 'onclick' => 'return delete_fact(this.dataset.confirm, "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return delete_fact(this.dataset.confirm, "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]); echo '</div>'; } @@ -1178,13 +1178,13 @@ class FunctionsPrintFacts echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), [ 'class' => 'btn btn-link', 'href' => '#', - 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]); echo FontAwesome::linkIcon('delete', I18N::translate('Delete'), [ 'class' => 'btn btn-link', 'data-confirm' => I18N::translate('Are you sure you want to delete this fact?'), 'href' => '#', - 'onclick' => 'return delete_fact(this.dataset.confirm", "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return delete_fact(this.dataset.confirm", "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->id() . '");', ]); echo '</div>'; } else { diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php index 4df2d092ea..3af4bfe555 100644 --- a/app/GedcomRecord.php +++ b/app/GedcomRecord.php @@ -1268,7 +1268,7 @@ class GedcomRecord // Replacing (or deleting) an existing fact foreach ($this->getFacts('', false, Auth::PRIV_HIDE) as $fact) { if (!$fact->isPendingDeletion()) { - if ($fact->getFactId() === $fact_id) { + if ($fact->id() === $fact_id) { if ($gedcom !== '') { $new_gedcom .= "\n" . $gedcom; } @@ -1401,7 +1401,7 @@ class GedcomRecord foreach ($this->getFacts() as $fact) { if ($fact->value() === $value) { - $this->deleteFact($fact->getFactId(), $update_chan); + $this->deleteFact($fact->id(), $update_chan); } elseif (preg_match_all('/\n(\d) ' . WT_REGEX_TAG . ' ' . $value . '/', $fact->getGedcom(), $matches, PREG_SET_ORDER)) { $gedcom = $fact->getGedcom(); foreach ($matches as $match) { @@ -1409,7 +1409,7 @@ class GedcomRecord $next_levels = '[' . $next_level . '-9]'; $gedcom = preg_replace('/' . $match[0] . '(\n' . $next_levels . '.*)*/', '', $gedcom); } - $this->updateFact($fact->getFactId(), $gedcom, $update_chan); + $this->updateFact($fact->id(), $gedcom, $update_chan); } } } diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 96a8e0a6d8..c12456161a 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -410,11 +410,11 @@ class AdminController extends AbstractBaseController if ($individual !== null && $media !== null) { foreach ($individual->getFacts() as $fact1) { - if ($fact1->getFactId() === $fact_id) { + if ($fact1->id() === $fact_id) { $individual->updateFact($fact_id, $fact1->getGedcom() . "\n2 OBJE @" . $obje_xref . '@', false); foreach ($individual->getFacts('OBJE') as $fact2) { if ($fact2->target() === $media) { - $individual->deleteFact($fact2->getFactId(), false); + $individual->deleteFact($fact2->id(), false); } } break; @@ -760,19 +760,19 @@ class AdminController extends AbstractBaseController foreach ($record1->getFacts() as $fact) { if (!$fact->isPendingDeletion() && $fact->getTag() !== 'CHAN') { - $facts1[$fact->getFactId()] = $fact; + $facts1[$fact->id()] = $fact; } } foreach ($record2->getFacts() as $fact) { if (!$fact->isPendingDeletion() && $fact->getTag() !== 'CHAN') { - $facts2[$fact->getFactId()] = $fact; + $facts2[$fact->id()] = $fact; } } foreach ($facts1 as $id1 => $fact1) { foreach ($facts2 as $id2 => $fact2) { - if ($fact1->getFactId() === $fact2->getFactId()) { + if ($fact1->id() === $fact2->getFactId()) { $facts[] = $fact1; unset($facts1[$id1]); unset($facts2[$id2]); @@ -814,13 +814,13 @@ class AdminController extends AbstractBaseController foreach ($record1->getFacts() as $fact) { if (!$fact->isPendingDeletion() && $fact->getTag() !== 'CHAN') { - $facts1[$fact->getFactId()] = $fact; + $facts1[$fact->id()] = $fact; } } foreach ($record2->getFacts() as $fact) { if (!$fact->isPendingDeletion() && $fact->getTag() !== 'CHAN') { - $facts2[$fact->getFactId()] = $fact; + $facts2[$fact->id()] = $fact; } } diff --git a/app/Http/Controllers/AdminTreesController.php b/app/Http/Controllers/AdminTreesController.php index cb3497a175..bcf096c211 100644 --- a/app/Http/Controllers/AdminTreesController.php +++ b/app/Http/Controllers/AdminTreesController.php @@ -1750,7 +1750,7 @@ class AdminTreesController extends AbstractBaseController $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place); $changes[$old_place] = $new_place; $gedcom = preg_replace('/(\n2 PLAC (?:.*, )*)' . preg_quote($search, '/') . '(\n|$)/i', '$1' . $replace . '$2', $fact->getGedcom()); - $record->updateFact($fact->getFactId(), $gedcom, false); + $record->updateFact($fact->id(), $gedcom, false); } } } @@ -1772,7 +1772,7 @@ class AdminTreesController extends AbstractBaseController $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place); $changes[$old_place] = $new_place; $gedcom = preg_replace('/(\n2 PLAC (?:.*, )*)' . preg_quote($search, '/') . '(\n|$)/i', '$1' . $replace . '$2', $fact->getGedcom()); - $record->updateFact($fact->getFactId(), $gedcom, false); + $record->updateFact($fact->id(), $gedcom, false); } } } diff --git a/app/Http/Controllers/EditFamilyController.php b/app/Http/Controllers/EditFamilyController.php index f704b40d24..50ad0b1a8e 100644 --- a/app/Http/Controllers/EditFamilyController.php +++ b/app/Http/Controllers/EditFamilyController.php @@ -74,7 +74,7 @@ class EditFamilyController extends AbstractEditController // Split facts into FAMS and other foreach ($family->getFacts() as $fact) { if ($fact->getTag() === 'CHIL') { - $sort_facts[$fact->getFactId()] = $fact->getGedcom(); + $sort_facts[$fact->id()] = $fact->getGedcom(); } else { $keep_facts[] = $fact->getGedcom(); } @@ -170,7 +170,7 @@ class EditFamilyController extends AbstractEditController $old_child = $fact->target(); if ($old_child instanceof Individual && Date::compare($new_child->getEstimatedBirthDate(), $old_child->getEstimatedBirthDate()) < 0) { // Insert before this child - $family->updateFact($fact->getFactId(), '1 CHIL @' . $new_child->getXref() . "@\n" . $fact->getGedcom(), !$keep_chan); + $family->updateFact($fact->id(), '1 CHIL @' . $new_child->getXref() . "@\n" . $fact->getGedcom(), !$keep_chan); $done = true; break; } @@ -345,13 +345,13 @@ class EditFamilyController extends AbstractEditController // Remove old FAMS link foreach ($old_father->getFacts('FAMS') as $fact) { if ($fact->target() === $family) { - $old_father->deleteFact($fact->getFactId(), true); + $old_father->deleteFact($fact->id(), true); } } // Remove old HUSB link foreach ($family->getFacts('HUSB|WIFE') as $fact) { if ($fact->target() === $old_father) { - $family->deleteFact($fact->getFactId(), true); + $family->deleteFact($fact->id(), true); } } } @@ -368,13 +368,13 @@ class EditFamilyController extends AbstractEditController // Remove old FAMS link foreach ($old_mother->getFacts('FAMS') as $fact) { if ($fact->target() === $family) { - $old_mother->deleteFact($fact->getFactId(), true); + $old_mother->deleteFact($fact->id(), true); } } // Remove old WIFE link foreach ($family->getFacts('HUSB|WIFE') as $fact) { if ($fact->target() === $old_mother) { - $family->deleteFact($fact->getFactId(), true); + $family->deleteFact($fact->id(), true); } } } @@ -391,13 +391,13 @@ class EditFamilyController extends AbstractEditController // Remove old FAMC link foreach ($old_child->getFacts('FAMC') as $fact) { if ($fact->target() === $family) { - $old_child->deleteFact($fact->getFactId(), true); + $old_child->deleteFact($fact->id(), true); } } // Remove old CHIL link foreach ($family->getFacts('CHIL') as $fact) { if ($fact->target() === $old_child) { - $family->deleteFact($fact->getFactId(), true); + $family->deleteFact($fact->id(), true); } } } diff --git a/app/Http/Controllers/EditGedcomRecordController.php b/app/Http/Controllers/EditGedcomRecordController.php index b47ba73215..5661751c4c 100644 --- a/app/Http/Controllers/EditGedcomRecordController.php +++ b/app/Http/Controllers/EditGedcomRecordController.php @@ -58,7 +58,7 @@ class EditGedcomRecordController extends AbstractEditController $this->checkRecordAccess($record, true); foreach ($record->getFacts() as $fact) { - if ($fact->getFactId() == $fact_id) { + if ($fact->id() == $fact_id) { switch ($fact->getTag()) { case 'NOTE': case 'SOUR': @@ -109,7 +109,7 @@ class EditGedcomRecordController extends AbstractEditController $this->checkRecordAccess($record, true); foreach ($record->getFacts() as $fact) { - if ($fact->getFactId() == $fact_id && $fact->canShow() && $fact->canEdit()) { + if ($fact->id() == $fact_id && $fact->canShow() && $fact->canEdit()) { $record->deleteFact($fact_id, true); break; } @@ -217,7 +217,7 @@ class EditGedcomRecordController extends AbstractEditController $title = I18N::translate('Edit the raw GEDCOM') . ' - ' . $record->getFullName(); foreach ($record->getFacts() as $fact) { - if (!$fact->isPendingDeletion() && $fact->getFactId() === $fact_id) { + if (!$fact->isPendingDeletion() && $fact->id() === $fact_id) { return $this->viewResponse('edit/raw-gedcom-fact', [ 'pattern' => self::GEDCOM_FACT_REGEX, 'fact' => $fact, @@ -250,7 +250,7 @@ class EditGedcomRecordController extends AbstractEditController $this->checkRecordAccess($record, true); foreach ($record->getFacts() as $fact) { - if (!$fact->isPendingDeletion() && $fact->getFactId() === $fact_id && $fact->canEdit()) { + if (!$fact->isPendingDeletion() && $fact->id() === $fact_id && $fact->canEdit()) { $record->updateFact($fact_id, $gedcom, false); break; } @@ -300,7 +300,7 @@ class EditGedcomRecordController extends AbstractEditController // Retain any private facts foreach ($record->getFacts('', false, Auth::PRIV_HIDE) as $fact) { - if (!in_array($fact->getFactId(), $fact_ids) && !$fact->isPendingDeletion()) { + if (!in_array($fact->id(), $fact_ids) && !$fact->isPendingDeletion()) { $gedcom .= "\n" . $fact->getGedcom(); } } @@ -359,7 +359,7 @@ class EditGedcomRecordController extends AbstractEditController // Find the fact to edit $edit_fact = null; foreach ($record->getFacts() as $fact) { - if ($fact->getFactId() === $fact_id && $fact->canEdit()) { + if ($fact->id() === $fact_id && $fact->canEdit()) { $edit_fact = $fact; break; } diff --git a/app/Http/Controllers/EditIndividualController.php b/app/Http/Controllers/EditIndividualController.php index 293abd9cec..288605be96 100644 --- a/app/Http/Controllers/EditIndividualController.php +++ b/app/Http/Controllers/EditIndividualController.php @@ -74,7 +74,7 @@ class EditIndividualController extends AbstractEditController // Split facts into OBJE and other foreach ($individual->getFacts() as $fact) { if ($fact->getTag() === 'OBJE') { - $sort_facts[$fact->getFactId()] = $fact->getGedcom(); + $sort_facts[$fact->id()] = $fact->getGedcom(); } else { $keep_facts[] = $fact->getGedcom(); } @@ -135,7 +135,7 @@ class EditIndividualController extends AbstractEditController // Split facts into NAME and other foreach ($individual->getFacts() as $fact) { if ($fact->getTag() === 'NAME') { - $sort_facts[$fact->getFactId()] = $fact->getGedcom(); + $sort_facts[$fact->id()] = $fact->getGedcom(); } else { $keep_facts[] = $fact->getGedcom(); } @@ -196,7 +196,7 @@ class EditIndividualController extends AbstractEditController // Split facts into FAMS and other foreach ($individual->getFacts() as $fact) { if ($fact->getTag() === 'FAMS') { - $sort_facts[$fact->getFactId()] = $fact->getGedcom(); + $sort_facts[$fact->id()] = $fact->getGedcom(); } else { $keep_facts[] = $fact->getGedcom(); } @@ -587,7 +587,7 @@ class EditIndividualController extends AbstractEditController // Find the fact to edit foreach ($individual->getFacts() as $fact) { - if ($fact->getFactId() === $fact_id && $fact->canEdit()) { + if ($fact->id() === $fact_id && $fact->canEdit()) { return $this->viewResponse('edit/new-individual', [ 'tree' => $tree, 'title' => I18N::translate('Edit the name'), @@ -715,7 +715,7 @@ class EditIndividualController extends AbstractEditController $fact_id = ''; foreach ($individual->getFacts('FAMC') as $fact) { if ($family === $fact->target()) { - $fact_id = $fact->getFactId(); + $fact_id = $fact->id(); break; } } diff --git a/app/Http/Controllers/IndividualController.php b/app/Http/Controllers/IndividualController.php index 4aed7fe6f1..ce59a7bd04 100644 --- a/app/Http/Controllers/IndividualController.php +++ b/app/Http/Controllers/IndividualController.php @@ -322,11 +322,11 @@ class IndividualController extends AbstractBaseController 'class' => 'btn btn-link', 'data-confirm' => I18N::translate('Are you sure you want to delete this fact?'), 'href' => '#', - 'onclick' => 'return delete_fact(this.dataset.confirm", "' . e($individual->getTree()->getName()) . '", "' . e($individual->getXref()) . '", "' . $fact->getFactId() . '");', + 'onclick' => 'return delete_fact(this.dataset.confirm", "' . e($individual->getTree()->getName()) . '", "' . e($individual->getXref()) . '", "' . $fact->id() . '");', ]) . FontAwesome::linkIcon('edit', I18N::translate('Edit the name'), [ 'class' => 'btn btn-link', - 'href' => route('edit-name', ['xref' => $individual->getXref(), 'fact_id' => $fact->getFactId(), 'ged' => $individual->getTree()->getName()]), + 'href' => route('edit-name', ['xref' => $individual->getXref(), 'fact_id' => $fact->id(), 'ged' => $individual->getTree()->getName()]), ]); } else { $edit_links = ''; @@ -378,7 +378,7 @@ class IndividualController extends AbstractBaseController $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), [ 'class' => 'btn btn-link', 'href' => route('edit-fact', ['xref' => $individual->getXref(), - 'fact_id' => $fact->getFactId(), + 'fact_id' => $fact->id(), 'ged' => $individual->getTree()->getName(), ]), ]); diff --git a/app/MediaFile.php b/app/MediaFile.php index fce70ee89f..9c342816b3 100644 --- a/app/MediaFile.php +++ b/app/MediaFile.php @@ -184,7 +184,7 @@ class MediaFile public function isPendingAddition(): bool { foreach ($this->media->getFacts() as $fact) { - if ($fact->getFactId() === $this->fact_id) { + if ($fact->id() === $this->fact_id) { return $fact->isPendingAddition(); } } @@ -198,7 +198,7 @@ class MediaFile public function isPendingDeletion(): bool { foreach ($this->media->getFacts() as $fact) { - if ($fact->getFactId() === $this->fact_id) { + if ($fact->id() === $this->fact_id) { return $fact->isPendingDeletion(); } } diff --git a/resources/views/admin/merge-records-step-2.phtml b/resources/views/admin/merge-records-step-2.phtml index ccf82dbedb..b456ef435b 100644 --- a/resources/views/admin/merge-records-step-2.phtml +++ b/resources/views/admin/merge-records-step-2.phtml @@ -33,7 +33,7 @@ <?php foreach ($facts as $fact_id => $fact) : ?> <tr> <td> - <input type="checkbox" name="keep1[]" value="<?= $fact->getFactId() ?>" checked> + <input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked> </td> <td> <div class="gedcom-data" dir="ltr"><?= e($fact->getGedcom()) ?></div> @@ -80,7 +80,7 @@ <?php foreach ($facts1 as $fact_id => $fact) : ?> <tr> <td> - <input type="checkbox" name="keep1[]" value="<?= $fact->getFactId() ?>" checked> + <input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked> </td> <td> <div class="gedcom-data" dir="ltr"><?= e($fact->getGedcom()) ?></div> @@ -126,7 +126,7 @@ <?php foreach ($facts2 as $fact_id => $fact) : ?> <tr> <td> - <input type="checkbox" name="keep2[]" value="<?= $fact->getFactId() ?>" checked> + <input type="checkbox" name="keep2[]" value="<?= $fact->id() ?>" checked> </td> <td> <div class="gedcom-data" dir="ltr"><?= e($fact->getGedcom()) ?></div> diff --git a/resources/views/edit/edit-fact.phtml b/resources/views/edit/edit-fact.phtml index 0ca408d291..7e858c7083 100644 --- a/resources/views/edit/edit-fact.phtml +++ b/resources/views/edit/edit-fact.phtml @@ -9,7 +9,7 @@ <h2 class="wt-page-title"><?= $title ?></h2> -<form class="wt-page-content" action="<?= e(route('update-fact', ['ged' => $tree->getName(), 'xref' => $record->getXref(), 'fact_id' => $edit_fact->getFactId()])) ?>" method="post"> <?= csrf_field() ?> +<form class="wt-page-content" action="<?= e(route('update-fact', ['ged' => $tree->getName(), 'xref' => $record->getXref(), 'fact_id' => $edit_fact->id()])) ?>" method="post"> <?= csrf_field() ?> <?php FunctionsEdit::createEditForm($edit_fact) ?> @@ -112,7 +112,7 @@ I18N::translate('cancel') ?> </a> <?php if ($can_edit_raw) : ?> - <a class="btn btn-link" href="<?= e(route('edit-raw-fact', ['xref' => $record->getXref(), 'fact_id' => $edit_fact->getFactId(), 'ged' => $tree->getName()])) ?>"> + <a class="btn btn-link" href="<?= e(route('edit-raw-fact', ['xref' => $record->getXref(), 'fact_id' => $edit_fact->id(), 'ged' => $tree->getName()])) ?>"> <?= I18N::translate('Edit the raw GEDCOM') ?> </a> <?php endif; ?> diff --git a/resources/views/edit/new-individual.phtml b/resources/views/edit/new-individual.phtml index 83acc446af..7b4a4965ef 100644 --- a/resources/views/edit/new-individual.phtml +++ b/resources/views/edit/new-individual.phtml @@ -25,7 +25,7 @@ $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRAD if ($name_fact !== null) { // Editing an existing name - $name_fact_id = $name_fact->getFactId(); + $name_fact_id = $name_fact->id(); $namerec = $name_fact->getGedcom(); $name_fields = [ 'NAME' => $name_fact->value(), @@ -333,7 +333,7 @@ $bdm = ''; // used to copy '1 SOUR' to '2 SOUR' for BIRT DEAT MARR </a> <?php if ($name_fact instanceof Fact && (Auth::isAdmin() || $tree->getPreference('SHOW_GEDCOM_RECORD'))) : ?> - <a class="btn btn-link" href="<?= e(route('edit-raw-fact', ['xref' => $xref, 'fact_id' => $name_fact->getFactId(), 'ged' => $tree->getName()])) ?>"> + <a class="btn btn-link" href="<?= e(route('edit-raw-fact', ['xref' => $xref, 'fact_id' => $name_fact->id(), 'ged' => $tree->getName()])) ?>"> <?= I18N::translate('Edit the raw GEDCOM') ?> </a> <?php endif ?> diff --git a/resources/views/edit/reorder-children.phtml b/resources/views/edit/reorder-children.phtml index 173554c80e..dfc118c11b 100644 --- a/resources/views/edit/reorder-children.phtml +++ b/resources/views/edit/reorder-children.phtml @@ -9,7 +9,7 @@ <div class="wt-sortable-list"> <?php foreach ($family->getFacts('CHIL') as $fact) : ?> <div class="card mb-2 wt-sortable-item" data-sortbydate="<?= $fact->target()->getBirthDate()->julianDay() ?>"> - <input type="hidden" name="order[]" value="<?= $fact->getFactId() ?>"> + <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> <?= FontAwesome::semanticIcon('drag-handle', '') ?> <?= $fact->target()->getFullName() ?> diff --git a/resources/views/edit/reorder-media.phtml b/resources/views/edit/reorder-media.phtml index d60c785968..cf8e5e68b3 100644 --- a/resources/views/edit/reorder-media.phtml +++ b/resources/views/edit/reorder-media.phtml @@ -9,7 +9,7 @@ <div class="wt-sortable-list"> <?php foreach ($individual->getFacts('OBJE') as $fact) : ?> <div class="card mb-2 wt-sortable-item"> - <input type="hidden" name="order[]" value="<?= $fact->getFactId() ?>"> + <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> <?= FontAwesome::semanticIcon('drag-handle', '') ?> <?= $fact->target()->getFullName() ?> diff --git a/resources/views/edit/reorder-names.phtml b/resources/views/edit/reorder-names.phtml index 743cc27ef2..9c63595c06 100644 --- a/resources/views/edit/reorder-names.phtml +++ b/resources/views/edit/reorder-names.phtml @@ -11,7 +11,7 @@ <div class="wt-sortable-list"> <?php foreach ($individual->getFacts('NAME') as $fact) : ?> <div class="card mb-2 wt-sortable-item"> - <input type="hidden" name="order[]" value="<?= $fact->getFactId() ?>"> + <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> <?= FontAwesome::semanticIcon('drag-handle', '') ?> <?= $fact->value() ?> diff --git a/resources/views/edit/reorder-spouses.phtml b/resources/views/edit/reorder-spouses.phtml index c81f9ffc4f..103cab0a6b 100644 --- a/resources/views/edit/reorder-spouses.phtml +++ b/resources/views/edit/reorder-spouses.phtml @@ -9,7 +9,7 @@ <div class="wt-sortable-list"> <?php foreach ($individual->getFacts('FAMS') as $fact) : ?> <div class="card mb-2 wt-sortable-item" data-sortbydate="<?= $fact->target()->getMarriageDate()->julianDay() ?>"> - <input type="hidden" name="order[]" value="<?= $fact->getFactId() ?>"> + <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> <?= FontAwesome::semanticIcon('drag-handle', '') ?> <?= $fact->target()->getFullName() ?> |
