summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controller/FamilyController.php113
-rw-r--r--app/Controller/IndividualController.php368
-rw-r--r--app/Controller/MediaController.php82
-rw-r--r--app/Controller/NoteController.php48
-rw-r--r--app/Controller/RepositoryController.php76
-rw-r--r--app/Controller/SourceController.php61
-rw-r--r--app/Http/Controllers/FamilyController.php27
-rw-r--r--app/Http/Controllers/IndividualController.php27
-rw-r--r--edit_interface.php80
-rw-r--r--resources/views/media-page-menu.php18
-rw-r--r--tests/app/Controller/AdvancedSearchControllerTest.php34
-rw-r--r--tests/app/Controller/AjaxControllerTest.php34
-rw-r--r--tests/app/Controller/AncestryControllerTest.php34
-rw-r--r--tests/app/Controller/BaseControllerTest.php34
-rw-r--r--tests/app/Controller/BranchesControllerTest.php33
-rw-r--r--tests/app/Controller/ChartControllerTest.php34
-rw-r--r--tests/app/Controller/DescendancyControllerTest.php34
-rw-r--r--tests/app/Controller/FamilyControllerTest.php35
-rw-r--r--tests/app/Controller/FamilybookControllerTest.php34
-rw-r--r--tests/app/Controller/FanchartControllerTest.php34
-rw-r--r--tests/app/Controller/GedcomRecordControllerTest.php34
-rw-r--r--tests/app/Controller/HourglassControllerTest.php34
-rw-r--r--tests/app/Controller/IndividualControllerTest.php35
-rw-r--r--tests/app/Controller/LifespanControllerTest.php34
-rw-r--r--tests/app/Controller/MediaControllerTest.php35
-rw-r--r--tests/app/Controller/NoteControllerTest.php35
-rw-r--r--tests/app/Controller/PageControllerTest.php34
-rw-r--r--tests/app/Controller/PedigreeControllerTest.php34
-rw-r--r--tests/app/Controller/RepositoryControllerTest.php35
-rw-r--r--tests/app/Controller/SearchControllerTest.php34
-rw-r--r--tests/app/Controller/SourceControllerTest.php35
-rw-r--r--tests/app/Controller/TimelineControllerTest.php34
32 files changed, 72 insertions, 1581 deletions
diff --git a/app/Controller/FamilyController.php b/app/Controller/FamilyController.php
deleted file mode 100644
index ce32db870d..0000000000
--- a/app/Controller/FamilyController.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace Fisharebest\Webtrees\Controller;
-
-use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Family;
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Individual;
-use Fisharebest\Webtrees\Menu;
-
-/**
- * Controller for the family page
- */
-class FamilyController extends GedcomRecordController {
- /**
- * Get significant information from this page, to allow other pages such as
- * charts and reports to initialise with the same records
- *
- * @return Individual
- */
- public function getSignificantIndividual() {
- if ($this->record) {
- foreach ($this->record->getSpouses() as $individual) {
- return $individual;
- }
- foreach ($this->record->getChildren() as $individual) {
- return $individual;
- }
- }
-
- return parent::getSignificantIndividual();
- }
-
- /**
- * Get significant information from this page, to allow other pages such as
- * charts and reports to initialise with the same records
- *
- * @return Family
- */
- public function getSignificantFamily() {
- if ($this->record) {
- return $this->record;
- }
-
- return parent::getSignificantFamily();
- }
-
- /**
- * get edit menu
- */
- public function getEditMenu() {
- if (!$this->record || $this->record->isPendingDeletion()) {
- return null;
- }
-
- // edit menu
- $menu = new Menu(I18N::translate('Edit'), '#', 'menu-fam');
-
- if (Auth::isEditor($this->record->getTree())) {
- // edit_fam / members
- $menu->addSubmenu(new Menu(I18N::translate('Change family members'), 'edit_interface.php?action=changefamily&ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-fam-change'));
-
- // edit_fam / add child
- $menu->addSubmenu(new Menu(I18N::translate('Add a child to this family'), 'edit_interface.php?action=add_child_to_family&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref() . '&amp;gender=U', 'menu-fam-addchil'));
-
- // edit_fam / reorder-children
- if ($this->record->getNumberOfChildren() > 1) {
- $menu->addSubmenu(new Menu(I18N::translate('Re-order children'), 'edit_interface.php?action=reorder-children&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-fam-orderchil'));
- }
-
- // delete
- $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-fam-del', [
- 'onclick' => 'return delete_record("' . I18N::translate('Deleting the family will unlink all of the individuals from each other but will leave the individuals in place. Are you sure you want to delete this family?') . '", "' . $this->record->getXref() . '");',
- ]));
- }
-
- // edit raw
- if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
- $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), 'edit_interface.php?action=editraw&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-fam-editraw'));
- }
-
- return $menu;
- }
-
- /**
- * Get significant information from this page, to allow other pages such as
- * charts and reports to initialise with the same records
- *
- * @return string
- */
- public function getSignificantSurname() {
- if ($this->record && $this->record->getHusband()) {
- list($surn) = explode(',', $this->record->getHusband()->getSortName());
-
- return $surn;
- } else {
- return '';
- }
- }
-}
diff --git a/app/Controller/IndividualController.php b/app/Controller/IndividualController.php
deleted file mode 100644
index 25410c9fac..0000000000
--- a/app/Controller/IndividualController.php
+++ /dev/null
@@ -1,368 +0,0 @@
-<?php
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace Fisharebest\Webtrees\Controller;
-
-use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Fact;
-use Fisharebest\Webtrees\Family;
-use Fisharebest\Webtrees\Filter;
-use Fisharebest\Webtrees\FontAwesome;
-use Fisharebest\Webtrees\Functions\FunctionsPrint;
-use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
-use Fisharebest\Webtrees\GedcomCode\GedcomCodeName;
-use Fisharebest\Webtrees\GedcomTag;
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Individual;
-use Fisharebest\Webtrees\Menu;
-use Fisharebest\Webtrees\Module;
-use Fisharebest\Webtrees\Module\ModuleTabInterface;
-
-/**
- * Controller for the individual page
- */
-class IndividualController extends GedcomRecordController {
- /** @var int Count of names */
- public $name_count = 0;
-
- /** @var int Count of names. */
- public $total_names = 0;
-
- /**
- * Startup activity
- *
- * @param Individual|null $record
- */
- public function __construct($record) {
- parent::__construct($record);
-
- // If we can display the details, add them to the page header
- if ($this->record && $this->record->canShow()) {
- $this->setPageTitle($this->record->getFullName() . ' ' . $this->record->getLifeSpan());
- }
- }
-
- /**
- * Get significant information from this page, to allow other pages such as
- * charts and reports to initialise with the same records
- *
- * @return Individual
- */
- public function getSignificantIndividual() {
- if ($this->record) {
- return $this->record;
- }
-
- return parent::getSignificantIndividual();
- }
-
- /**
- * Get significant information from this page, to allow other pages such as
- * charts and reports to initialise with the same records
- *
- * @return Family
- */
- public function getSignificantFamily() {
- if ($this->record) {
- foreach ($this->record->getChildFamilies() as $family) {
- return $family;
- }
- foreach ($this->record->getSpouseFamilies() as $family) {
- return $family;
- }
- }
-
- return parent::getSignificantFamily();
- }
-
- /**
- * Which tabs should we show on this individual's page.
- * We don't show empty tabs.
- *
- * @param Individual $individual
- *
- * @return ModuleTabInterface[]
- */
- public function getTabs(Individual $individual) {
- $active_tabs = Module::getActiveTabs($individual->getTree());
-
- return array_filter($active_tabs, function (ModuleTabInterface $tab) use ($individual) {
- return $tab->hasTabContent($individual);
- });
- }
-
- /**
- * Handle AJAX requests - to generate the tab content
- *
- * @param Individual $individual
- */
- public function ajaxRequest(Individual $individual) {
- header('Content-Type: text/html; charset=UTF-8');
-
- $tab = Filter::get('module');
- $tabs = $this->getTabs($individual);
-
- if (!array_key_exists($tab, $tabs)) {
- http_response_code(404);
- } else {
- echo $tabs[$tab]->getTabContent($individual);
- }
- }
-
- /**
- * Format a name record
- *
- * @param int $n
- * @param Fact $fact
- *
- * @return string
- */
- public function formatNameRecord($n, Fact $fact) {
- $individual = $fact->getParent();
-
- // Create a dummy record, so we can extract the formatted NAME value from it.
- $dummy = new Individual(
- 'xref',
- "0 @xref@ INDI\n1 DEAT Y\n" . $fact->getGedcom(),
- null,
- $individual->getTree()
- );
- $dummy->setPrimaryName(0); // Make sure we use the name from "1 NAME"
-
- $container_class = 'card';
- $content_class = 'collapse';
- $aria = 'false';
-
- if ($n === 0) {
- $content_class = 'collapse show';
- $aria = 'true';
- }
- if ($fact->isPendingDeletion()) {
- $container_class .= ' old';
- } elseif ($fact->isPendingAddition()) {
- $container_class .= ' new';
- }
-
- ob_start();
- echo '<dl><dt class="label">', I18N::translate('Name'), '</dt>';
- echo '<dd class="field">', $dummy->getFullName(), '</dd>';
- $ct = preg_match_all('/\n2 (\w+) (.*)/', $fact->getGedcom(), $nmatch, PREG_SET_ORDER);
- for ($i = 0; $i < $ct; $i++) {
- $tag = $nmatch[$i][1];
- if ($tag != 'SOUR' && $tag != 'NOTE' && $tag != 'SPFX') {
- echo '<dt class="label">', GedcomTag::getLabel($tag, $this->record), '</dt>';
- echo '<dd class="field">'; // Before using dir="auto" on this field, note that Gecko treats this as an inline element but WebKit treats it as a block element
- if (isset($nmatch[$i][2])) {
- $name = e($nmatch[$i][2]);
- $name = str_replace('/', '', $name);
- $name = preg_replace('/(\S*)\*/', '<span class="starredname">\\1</span>', $name);
- switch ($tag) {
- case 'TYPE':
- echo GedcomCodeName::getValue($name, $this->record);
- break;
- case 'SURN':
- // The SURN field is not necessarily the surname.
- // Where it is not a substring of the real surname, show it after the real surname.
- $surname = e($dummy->getAllNames()[0]['surname']);
- $surns = preg_replace('/, */', ' ', $nmatch[$i][2]);
- if (strpos($dummy->getAllNames()[0]['surname'], $surns) !== false) {
- echo '<span dir="auto">' . $surname . '</span>';
- } else {
- echo I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $surname . '</span>', '<span dir="auto">' . $name . '</span>');
- }
- break;
- default:
- echo '<span dir="auto">' . $name . '</span>';
- break;
- }
- }
- echo '</dd>';
- echo '</dl>';
- }
- }
- if (preg_match("/\n2 SOUR/", $fact->getGedcom())) {
- echo '<div id="indi_sour" class="clearfloat">', FunctionsPrintFacts::printFactSources($fact->getGedcom(), 2), '</div>';
- }
- if (preg_match("/\n2 NOTE/", $fact->getGedcom())) {
- echo '<div id="indi_note" class="clearfloat">', FunctionsPrint::printFactNotes($fact->getGedcom(), 2), '</div>';
- }
- $content = ob_get_clean();
-
- if ($this->record->canEdit() && !$fact->isPendingDeletion()) {
- $edit_links =
- FontAwesome::linkIcon('delete', I18N::translate('Delete this name'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . $this->record->getXref() . '", "' . $fact->getFactId() . '");']) .
- FontAwesome::linkIcon('edit', I18N::translate('Edit the name'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=editname&xref=' . $this->record->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . $this->record->getTree()->getNameHtml()]);
- } else {
- $edit_links = '';
- }
-
- return '
- <div class="' . $container_class . '">
- <div class="card-header" role="tab" id="name-header-' . $n . '">
- <a data-toggle="collapse" data-parent="#individual-names" href="#name-content-' . $n . '" aria-expanded="' . $aria . '" aria-controls="name-content-' . $n . '">' . $dummy->getFullName() . '</a>
- ' . $edit_links . '
- </div>
- <div id="name-content-' . $n . '" class="' . $content_class . '" role="tabpanel" aria-labelledby="name-header-' . $n . '">
- <div class="card-body">' . $content . '</div>
- </div>
- </div>';
- }
-
- /**
- * print information for a sex record
- *
- * @param Fact $fact
- *
- * @return string
- */
- public function formatSexRecord(Fact $fact) {
- $individual = $fact->getParent();
-
- switch ($fact->getValue()) {
- case 'M':
- $sex = I18N::translate('Male');
- break;
- case 'F':
- $sex = I18N::translate('Female');
- break;
- default:
- $sex = I18N::translateContext('unknown gender', 'Unknown');
- break;
- }
-
- $container_class = 'card';
- if ($fact->isPendingDeletion()) {
- $container_class .= ' old';
- } elseif ($fact->isPendingAddition()) {
- $container_class .= ' new';
- }
-
- if ($individual->canEdit() && !$fact->isPendingDeletion()) {
- $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $individual->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . $individual->getTree()->getNameHtml()]);
- } else {
- $edit_links = '';
- }
-
- return '
- <div class="' . $container_class . '">
- <div class="card-header" role="tab" id="name-header-add">
- <div class="card-title mb-0">
- <b>' . I18N::translate('Gender') . '</b> ' . $sex . $edit_links . '
- </div>
- </div>
- </div>';
- }
-
- /**
- * get edit menu
- */
- public function getEditMenu() {
- if (!$this->record || $this->record->isPendingDeletion()) {
- return null;
- }
- // edit menu
- $menu = new Menu(I18N::translate('Edit'), '#', 'menu-indi');
-
- if (Auth::isEditor($this->record->getTree())) {
- // delete
- $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-indi-del', [
- 'onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . '", "' . $this->record->getXref() . '");',
- ]));
- }
-
- // edit raw
- if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
- $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), 'edit_interface.php?action=editraw&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-indi-editraw'));
- }
-
- return $menu;
- }
-
- /**
- * get the person box stylesheet class for the given person
- *
- * @param Individual $person
- *
- * @return string returns 'person_box', 'person_boxF', or 'person_boxNN'
- */
- public function getPersonStyle($person) {
- switch ($person->getSex()) {
- case 'M':
- $class = 'person_box';
- break;
- case 'F':
- $class = 'person_boxF';
- break;
- default:
- $class = 'person_boxNN';
- break;
- }
- if ($person->isPendingDeletion()) {
- $class .= ' old';
- } elseif ($person->isPendingAddition()) {
- $class .= ' new';
- }
-
- return $class;
- }
-
- /**
- * Get significant information from this page, to allow other pages such as
- * charts and reports to initialise with the same records
- *
- * @return string
- */
- public function getSignificantSurname() {
- if ($this->record) {
- list($surn) = explode(',', $this->record->getSortName());
-
- return $surn;
- } else {
- return '';
- }
- }
-
- /**
- * Get the contents of sidebar.
- *
- * @return string
- */
- public function getSideBarContent() {
- $html = '';
- foreach (Module::getActiveSidebars($this->record->getTree()) as $module) {
- if ($module->hasSidebarContent($this->record)) {
- $class = $module->getName() === 'family_nav' ? 'collapse show' : 'collapse';
- $aria = $module->getName() === 'family_nav' ? 'true' : 'false';
- $html .= '
- <div class="card">
- <div class="card-header" role="tab" id="sidebar-header-' . $module->getName() . '">
- <div class="card-title mb-0">
- <a data-toggle="collapse" data-parent="#sidebar" href="#sidebar-content-' . $module->getName() . '" aria-expanded="' . $aria . '" aria-controls="sidebar-content-' . $module->getName() . '">' . $module->getTitle() . '</a>
- </div>
- </div>
- <div id="sidebar-content-' . $module->getName() . '" class="' . $class . '" role="tabpanel" aria-labelledby="sidebar-header-' . $module->getName() . '">
- <div class="card-body">' . $module->getSidebarContent() . '</div>
- </div>
- </div>';
- }
- }
-
- if ($html) {
- return '<div id="sidebar" role="tablist">' . $html . '</div>';
- } else {
- return '';
- }
- }
-}
diff --git a/app/Controller/MediaController.php b/app/Controller/MediaController.php
deleted file mode 100644
index 7ad4793d37..0000000000
--- a/app/Controller/MediaController.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace Fisharebest\Webtrees\Controller;
-
-use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Fact;
-use Fisharebest\Webtrees\Filter;
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Menu;
-use Fisharebest\Webtrees\Module;
-
-/**
- * Controller for the media page
- */
-class MediaController extends GedcomRecordController {
- /**
- * get edit menu
- */
- public function getEditMenu() {
- if (!$this->record || $this->record->isPendingDeletion()) {
- return null;
- }
-
- // edit menu
- $menu = new Menu(I18N::translate('Edit'), '#', 'menu-obje');
-
- if (Auth::isEditor($this->record->getTree())) {
- // main link displayed on page
- if (Module::getModuleByName('GEDFact_assistant')) {
- $menu->addSubmenu(new Menu(I18N::translate('Manage the links'), '#', 'menu-obje-link', [
- 'onclick' => 'return ilinkitem("' . $this->record->getXref() . '","manage");',
- ]));
- } else {
- $menu->addSubmenu(new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', [
- 'onclick' => 'return ilinkitem("' . $this->record->getXref() . '","person");',
- ]));
-
- $menu->addSubmenu(new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', [
- 'onclick' => 'return ilinkitem("' . $this->record->getXref() . '","family");',
- ]));
-
- $menu->addSubmenu(new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', [
- 'onclick' => 'return ilinkitem("' . $this->record->getXref() . '","source");',
- ]));
- }
-
- // delete
- $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-obje-del', [
- 'onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . '", "' . $this->record->getXref() . '");',
- ]));
- }
-
- // edit raw
- if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
- $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), 'edit_interface.php?action=editraw&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-obje-editraw'));
- }
-
- return $menu;
- }
-
- /**
- * Return a list of facts
- *
- * @return Fact[]
- */
- public function getFacts() {
- return $this->record->getFacts(null, true);
- }
-}
diff --git a/app/Controller/NoteController.php b/app/Controller/NoteController.php
deleted file mode 100644
index 01b95f9900..0000000000
--- a/app/Controller/NoteController.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace Fisharebest\Webtrees\Controller;
-
-use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Menu;
-
-/**
- * Controller for the shared note page
- */
-class NoteController extends GedcomRecordController {
- /**
- * get edit menu
- */
- public function getEditMenu() {
- if (!$this->record || $this->record->isPendingDeletion()) {
- return null;
- }
-
- // edit menu
- $menu = new Menu(I18N::translate('Edit'), '#', 'menu-note');
-
- if (Auth::isEditor($this->record->getTree())) {
- $menu->addSubmenu(new Menu(I18N::translate('Edit the note'), 'edit_interface.php?action=editnote&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-note-edit'));
-
- // delete
- $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-note-del', [
- 'onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . '", "' . $this->record->getXref() . '");',
- ]));
- }
-
- return $menu;
- }
-}
diff --git a/app/Controller/RepositoryController.php b/app/Controller/RepositoryController.php
deleted file mode 100644
index f3948aa497..0000000000
--- a/app/Controller/RepositoryController.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace Fisharebest\Webtrees\Controller;
-
-use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Filter;
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Menu;
-use Fisharebest\Webtrees\Module;
-
-/**
- * Controller for the repository page
- */
-class RepositoryController extends GedcomRecordController {
- /**
- * get edit menu
- */
- public function getEditMenu() {
- if (!$this->record || $this->record->isPendingDeletion()) {
- return null;
- }
-
- // edit menu
- $menu = new Menu(I18N::translate('Edit'), '#', 'menu-repo');
-
- if (Auth::isEditor($this->record->getTree())) {
- $fact = $this->record->getFirstFact('NAME');
- if ($fact) {
- // Edit existing name
- $menu->addSubmenu(new Menu(I18N::translate('Edit the repository'), 'edit_interface.php?action=edit&amp;xref=' . $this->record->getXref() . '&amp;fact_id=' . $fact->getFactId() . '&amp;ged=' . $this->record->getTree()->getNameHtml(), 'menu-repo-edit'));
- } else {
- // Add new name
- $menu->addSubmenu(new Menu(I18N::translate('Edit the repository'), 'edit_interface.php?action=add&amp;fact=NAME&amp;xref=' . $this->record->getXref() . '&amp;ged=' . $this->record->getTree()->getNameHtml(), 'menu-repo-edit'));
- }
- }
-
- // delete
- if (Auth::isEditor($this->record->getTree())) {
- $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-repo-del', [
- 'onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . '", "' . $this->record->getXref() . '");',
- ]));
- }
-
- // edit raw
- if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
- $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), 'edit_interface.php?action=editraw&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-repo-editraw'));
- }
-
- // add to favorites
- if (Module::getModuleByName('user_favorites')) {
- $menu->addSubmenu(new Menu(
- /* I18N: Menu option. Add [the current page] to the list of favorites */ I18N::translate('Add to favorites'),
- '#',
- 'menu-repo-addfav',
- [
- 'onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite" ,{xref:"' . $this->record->getXref() . '"},function(){location.reload();})',
- ]
- ));
- }
-
- return $menu;
- }
-}
diff --git a/app/Controller/SourceController.php b/app/Controller/SourceController.php
deleted file mode 100644
index 1f87536840..0000000000
--- a/app/Controller/SourceController.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace Fisharebest\Webtrees\Controller;
-
-use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Filter;
-use Fisharebest\Webtrees\I18N;
-use Fisharebest\Webtrees\Menu;
-
-/**
- * Controller for the source page
- */
-class SourceController extends GedcomRecordController {
- /**
- * get edit menu
- */
- public function getEditMenu() {
- if (!$this->record || $this->record->isPendingDeletion()) {
- return null;
- }
-
- // edit menu
- $menu = new Menu(I18N::translate('Edit'), '#', 'menu-sour');
-
- if (Auth::isEditor($this->record->getTree())) {
- $fact = $this->record->getFirstFact('TITL');
- if ($fact) {
- // Edit existing name
- $menu->addSubmenu(new Menu(I18N::translate('Edit the source'), 'edit_interface.php?action=edit&amp;xref=' . $this->record->getXref() . '&amp;fact_id=' . $fact->getFactId() . '&amp;ged=' . $this->record->getTree()->getNameHtml(), 'menu-sour-edit'));
- } else {
- // Add new name
- $menu->addSubmenu(new Menu(I18N::translate('Edit the source'), 'edit_interface.php?action=add&amp;fact=TITL&amp;xref=' . $this->record->getXref() . '&amp;ged=' . $this->record->getTree()->getNameHtml(), 'menu-sour-edit'));
- }
-
- // delete
- $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-sour-del', [
- 'onclick' => "return delete_record('" . I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $this->record->getXref() . "');",
- ]));
- }
-
- // edit raw
- if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
- $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), 'edit_interface.php?action=editraw&amp;ged=' . $this->record->getTree()->getNameHtml() . '&amp;xref=' . $this->record->getXref(), 'menu-sour-editraw'));
- }
-
- return $menu;
- }
-}
diff --git a/app/Http/Controllers/FamilyController.php b/app/Http/Controllers/FamilyController.php
index 62fd8e90a7..534a1520cf 100644
--- a/app/Http/Controllers/FamilyController.php
+++ b/app/Http/Controllers/FamilyController.php
@@ -18,7 +18,9 @@ declare(strict_types=1);
namespace Fisharebest\Webtrees\Http\Controllers;
use Fisharebest\Webtrees\Family;
+use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Tree;
+use stdClass;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -45,7 +47,32 @@ class FamilyController extends BaseController {
'facts' => $family->getFacts(null, true),
'meta_robots' => 'index,follow',
'record' => $family,
+ 'significant' => $this->significant($family),
'title' => $family->getFullName(),
]);
}
+
+ /**
+ * What are the significant elements of this page?
+ * The layout will need them to generate URLs for charts and reports.
+ *
+ * @param Family $family
+ *
+ * @return stdClass
+ */
+ private function significant(Family $family) {
+ $significant = (object) [
+ 'family' => $family,
+ 'individual' => null,
+ 'surname' => ''
+ ];
+
+ foreach ($family->getSpouses() + $family->getChildren() as $individual) {
+ $significant->individual = $individual;
+ list($significant->surname) = explode(',', $individual->getSortName());
+ break;
+ }
+
+ return $significant;
+ }
}
diff --git a/app/Http/Controllers/IndividualController.php b/app/Http/Controllers/IndividualController.php
index dc51630a80..57ffa09049 100644
--- a/app/Http/Controllers/IndividualController.php
+++ b/app/Http/Controllers/IndividualController.php
@@ -34,6 +34,7 @@ use Fisharebest\Webtrees\Module\ModuleSidebarInterface;
use Fisharebest\Webtrees\Module\ModuleTabInterface;
use Fisharebest\Webtrees\Tree;
use Fisharebest\Webtrees\User;
+use stdClass;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -110,6 +111,7 @@ class IndividualController extends BaseController {
'sex_records' => $sex_records,
'sidebars' => $this->getSidebars($individual),
'tabs' => $this->getTabs($individual),
+ 'significant' => $this->significant($individual),
'title' => $individual->getFullName() . ' ' . $individual->getLifeSpan(),
'user_link' => $user_link,
]);
@@ -338,4 +340,29 @@ class IndividualController extends BaseController {
return $tab->hasTabContent($individual);
});
}
+
+ /**
+ * What are the significant elements of this page?
+ * The layout will need them to generate URLs for charts and reports.
+ *
+ * @param Individual $individual
+ *
+ * @return stdClass
+ */
+ private function significant(Individual $individual) {
+ $significant = (object) [
+ 'family' => null,
+ 'individual' => $individual,
+ 'surname' => ''
+ ];
+
+ list($significant->surname) = explode(',', $individual->getSortName());
+
+ foreach ($individual->getChildFamilies() + $individual->getSpouseFamilies() as $family) {
+ $significant->family = $family;
+ break;
+ }
+
+ return $significant;
+ }
}
diff --git a/edit_interface.php b/edit_interface.php
index a3b16f99f9..c913ad5bd5 100644
--- a/edit_interface.php
+++ b/edit_interface.php
@@ -1231,86 +1231,6 @@ case 'addmedia_links':
<?php
break;
-case 'editnote':
- //////////////////////////////////////////////////////////////////////////////
- // Edit a note record
- //////////////////////////////////////////////////////////////////////////////
- $xref = Filter::get('xref', WT_REGEX_XREF);
-
- $note = Note::getInstance($xref, $controller->tree());
- check_record_access($note);
-
- $controller
- ->setPageTitle(I18N::translate('Edit the shared note'))
- ->pageHeader();
-
- ?>
- <h2><?= $controller->getPageTitle() ?></h2>
-
- <form method="post">
- <input type="hidden" name="ged" value="<?= $controller->tree()->getNameHtml() ?>">
- <input type="hidden" name="action" value="editnoteaction">
- <input type="hidden" name="xref" value="<?= $xref ?>">
- <?= Filter::getCsrf() ?>
- <table class="table wt-facts-table">
- <tr>
- <th scope="row"><?= I18N::translate('Shared note') ?></th>
- <td>
- <textarea name="NOTE" id="NOTE" rows="15" cols="90"><?= e($note->getNote()) ?></textarea>
- <br>
- <?= FunctionsPrint::printSpecialCharacterLink('NOTE') ?>
- </td>
- </tr>
- <?= keep_chan($note) ?>
- </table>
- <div class="row form-group">
- <div class="col-sm-9 offset-sm-3">
- <button class="btn btn-primary" type="submit">
- <?= FontAwesome::decorativeIcon('save') ?>
- <?= /* I18N: A button label. */
- I18N::translate('save') ?>
- </button>
- <a class="btn btn-secondary" href="<?= e($note->url()) ?>">
- <?= FontAwesome::decorativeIcon('cancel') ?>
- <?= /* I18N: A button label. */
- I18N::translate('cancel') ?>
- </a>
- </div>
- </div>
- </form>
- <?php
- break;
-
-case 'editnoteaction':
- //////////////////////////////////////////////////////////////////////////////
- // Edit a note record
- //////////////////////////////////////////////////////////////////////////////
- $xref = Filter::post('xref', WT_REGEX_XREF);
- $keep_chan = Filter::postBool('keep_chan');
- $note = Filter::post('NOTE');
-
- if (!Filter::checkCsrf()) {
- header('Location: edit_interface.php?action=editnote&xref=' . $xref);
- break;
- }
-
- $record = Note::getInstance($xref, $controller->tree());
- check_record_access($record);
-
- // We have user-supplied data in a replacement string - escape it against backreferences
- $note = str_replace(['\\', '$'], ['\\\\', '\\$'], $note);
-
- $gedrec = preg_replace(
- '/^0 @' . $record->getXref() . '@ NOTE.*(\n1 CONT.*)*/',
- '0 @' . $record->getXref() . '@ NOTE ' . preg_replace("/\r?\n/", "\n1 CONT ", $note),
- $record->getGedcom()
- );
-
- $record->updateRecord($gedrec, !$keep_chan);
-
- header('Location: ' . $record->url());
- break;
-
case 'add-media-link':
//////////////////////////////////////////////////////////////////////////////
// Link a media object to a record.
diff --git a/resources/views/media-page-menu.php b/resources/views/media-page-menu.php
index 5df7335dd6..a76159f552 100644
--- a/resources/views/media-page-menu.php
+++ b/resources/views/media-page-menu.php
@@ -2,6 +2,7 @@
<?php use Fisharebest\Webtrees\FontAwesome; ?>
<?php use Fisharebest\Webtrees\Html; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
+<?php use Fisharebest\Webtrees\Module; ?>
<div class="dropdown wt-page-menu">
<button class="btn btn-primary dropdown-toggle wt-page-menu-button" type="button" id="page-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@@ -9,6 +10,23 @@
<?= I18N::translate('edit') ?>
</button>
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
+
+ <?php if (Module::getModuleByName('GEDFact_assistant')): ?>
+ <a class="dropdown-item menu-obje-link" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','manage');">
+ <?= I18N::translate('Manage the links') ?>
+ </a>
+ <?php else: ?>
+ <a class=dropdown-item menu-obje-link-indi" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','person');">
+ <?= I18N::translate('Link this media object to an individual') ?>
+ </a>
+ <a class="dropdown-item menu-obje-link-fam" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','family');">
+ <?= I18N::translate('Link this media object to a family') ?>
+ </a>
+ <a class="dropdown-item menu-obje-link-sour" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','source');">
+ <?= I18N::translate('Link this media object to a source') ?>
+ </a>
+ <?php endif ?>
+
<a class="dropdown-item menu-obje-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/tests/app/Controller/AdvancedSearchControllerTest.php b/tests/app/Controller/AdvancedSearchControllerTest.php
deleted file mode 100644
index df7e9682e5..0000000000
--- a/tests/app/Controller/AdvancedSearchControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class AdvancedSearchController
- */
-class AdvancedSearchControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\AdvancedSearchController'));
- }
-}
diff --git a/tests/app/Controller/AjaxControllerTest.php b/tests/app/Controller/AjaxControllerTest.php
deleted file mode 100644
index 7e39aaeb05..0000000000
--- a/tests/app/Controller/AjaxControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class AjaxController
- */
-class AjaxControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\AjaxController'));
- }
-}
diff --git a/tests/app/Controller/AncestryControllerTest.php b/tests/app/Controller/AncestryControllerTest.php
deleted file mode 100644
index fa6053a850..0000000000
--- a/tests/app/Controller/AncestryControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class AncestryController
- */
-class AncestryControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\AncestryController'));
- }
-}
diff --git a/tests/app/Controller/BaseControllerTest.php b/tests/app/Controller/BaseControllerTest.php
deleted file mode 100644
index 67f211211e..0000000000
--- a/tests/app/Controller/BaseControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class BaseController
- */
-class BaseControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\BaseController'));
- }
-}
diff --git a/tests/app/Controller/BranchesControllerTest.php b/tests/app/Controller/BranchesControllerTest.php
deleted file mode 100644
index 7b9b8e6c27..0000000000
--- a/tests/app/Controller/BranchesControllerTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class BranchesController
- */
-class BranchesControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\BranchesController'));
- }
-}
diff --git a/tests/app/Controller/ChartControllerTest.php b/tests/app/Controller/ChartControllerTest.php
deleted file mode 100644
index f50b790835..0000000000
--- a/tests/app/Controller/ChartControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class ChartController
- */
-class ChartControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\ChartController'));
- }
-}
diff --git a/tests/app/Controller/DescendancyControllerTest.php b/tests/app/Controller/DescendancyControllerTest.php
deleted file mode 100644
index 282d490d01..0000000000
--- a/tests/app/Controller/DescendancyControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class DescendancyController
- */
-class DescendancyControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\DescendancyController'));
- }
-}
diff --git a/tests/app/Controller/FamilyControllerTest.php b/tests/app/Controller/FamilyControllerTest.php
deleted file mode 100644
index f15c7bd824..0000000000
--- a/tests/app/Controller/FamilyControllerTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class FamilyController
- */
-class FamilyControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- defined('WT_ROOT') || define('WT_ROOT', '');
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\FamilyController'));
- }
-}
diff --git a/tests/app/Controller/FamilybookControllerTest.php b/tests/app/Controller/FamilybookControllerTest.php
deleted file mode 100644
index 21b9d8c6c4..0000000000
--- a/tests/app/Controller/FamilybookControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class FamilyBookController
- */
-class FamilybookControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\FamilyBookController'));
- }
-}
diff --git a/tests/app/Controller/FanchartControllerTest.php b/tests/app/Controller/FanchartControllerTest.php
deleted file mode 100644
index dc2bf0279c..0000000000
--- a/tests/app/Controller/FanchartControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class FanchartController
- */
-class FanchartControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\FanchartController'));
- }
-}
diff --git a/tests/app/Controller/GedcomRecordControllerTest.php b/tests/app/Controller/GedcomRecordControllerTest.php
deleted file mode 100644
index 12014afe3c..0000000000
--- a/tests/app/Controller/GedcomRecordControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class GedcomRecordController
- */
-class GedcomRecordControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\GedcomRecordController'));
- }
-}
diff --git a/tests/app/Controller/HourglassControllerTest.php b/tests/app/Controller/HourglassControllerTest.php
deleted file mode 100644
index 5bad9df25e..0000000000
--- a/tests/app/Controller/HourglassControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class HourglassController
- */
-class HourglassControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\HourglassController'));
- }
-}
diff --git a/tests/app/Controller/IndividualControllerTest.php b/tests/app/Controller/IndividualControllerTest.php
deleted file mode 100644
index 92bb84abc2..0000000000
--- a/tests/app/Controller/IndividualControllerTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class IndividualController
- */
-class IndividualControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- defined('WT_ROOT') || define('WT_ROOT', '');
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\IndividualController'));
- }
-}
diff --git a/tests/app/Controller/LifespanControllerTest.php b/tests/app/Controller/LifespanControllerTest.php
deleted file mode 100644
index 66de8a20d7..0000000000
--- a/tests/app/Controller/LifespanControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class LifespanController
- */
-class LifespanControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\LifespanController'));
- }
-}
diff --git a/tests/app/Controller/MediaControllerTest.php b/tests/app/Controller/MediaControllerTest.php
deleted file mode 100644
index daacfe6360..0000000000
--- a/tests/app/Controller/MediaControllerTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class MediaController
- */
-class MediaControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- defined('WT_ROOT') || define('WT_ROOT', '');
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\MediaController'));
- }
-}
diff --git a/tests/app/Controller/NoteControllerTest.php b/tests/app/Controller/NoteControllerTest.php
deleted file mode 100644
index 0ab5436256..0000000000
--- a/tests/app/Controller/NoteControllerTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class NoteController
- */
-class NoteControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- defined('WT_ROOT') || define('WT_ROOT', '');
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\NoteController'));
- }
-}
diff --git a/tests/app/Controller/PageControllerTest.php b/tests/app/Controller/PageControllerTest.php
deleted file mode 100644
index a588801cb8..0000000000
--- a/tests/app/Controller/PageControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class PageController
- */
-class PageControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\PageController'));
- }
-}
diff --git a/tests/app/Controller/PedigreeControllerTest.php b/tests/app/Controller/PedigreeControllerTest.php
deleted file mode 100644
index 9f04fde7bb..0000000000
--- a/tests/app/Controller/PedigreeControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class PedigreeController
- */
-class PedigreeControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\PedigreeController'));
- }
-}
diff --git a/tests/app/Controller/RepositoryControllerTest.php b/tests/app/Controller/RepositoryControllerTest.php
deleted file mode 100644
index bb96829eb7..0000000000
--- a/tests/app/Controller/RepositoryControllerTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class RepositoryController
- */
-class RepositoryControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- defined('WT_ROOT') || define('WT_ROOT', '');
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\RepositoryController'));
- }
-}
diff --git a/tests/app/Controller/SearchControllerTest.php b/tests/app/Controller/SearchControllerTest.php
deleted file mode 100644
index be22fb5103..0000000000
--- a/tests/app/Controller/SearchControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class SearchController
- */
-class SearchControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\SearchController'));
- }
-}
diff --git a/tests/app/Controller/SourceControllerTest.php b/tests/app/Controller/SourceControllerTest.php
deleted file mode 100644
index 402405cc69..0000000000
--- a/tests/app/Controller/SourceControllerTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class SourceController
- */
-class SourceControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- defined('WT_ROOT') || define('WT_ROOT', '');
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\SourceController'));
- }
-}
diff --git a/tests/app/Controller/TimelineControllerTest.php b/tests/app/Controller/TimelineControllerTest.php
deleted file mode 100644
index 5d7f8e2ad9..0000000000
--- a/tests/app/Controller/TimelineControllerTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * webtrees: online genealogy
- * Copyright (C) 2018 webtrees development team
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Test harness for the class TimelineController
- */
-class TimelineControllerTest extends \PHPUnit\Framework\TestCase {
- /**
- * Prepare the environment for these tests
- */
- public function setUp() {
- }
-
- /**
- * Test that the class exists
- */
- public function testClassExists() {
- $this->assertTrue(class_exists('\Fisharebest\Webtrees\Controller\TimelineController'));
- }
-}