/** * Startup activity */ public function __construct() { global $WT_TREE; $xref = Filter::get('pid', WT_REGEX_XREF); $this->record = Individual::getInstance($xref, $WT_TREE); if (!$this->record && $WT_TREE->getPreference('USE_RIN')) { $rin = FunctionsDb::findRin($xref); $this->record = Individual::getInstance($rin, $WT_TREE); } parent::__construct(); // 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()); $this->tabs = Module::getActiveTabs($this->record->getTree()); } }
/** * Defined in session.php * * @global Tree $WT_TREE */ global $WT_TREE; use Fisharebest\Webtrees\Controller\IndividualController; use Fisharebest\Webtrees\Functions\FunctionsDate; use Fisharebest\Webtrees\Functions\FunctionsDb; use Fisharebest\Webtrees\Functions\FunctionsPrint; define('WT_SCRIPT_NAME', 'individual.php'); require './includes/session.php'; $pid = Filter::get('pid', WT_REGEX_XREF); $record = Individual::getInstance($pid, $WT_TREE); if (!$record && $WT_TREE->getPreference('USE_RIN')) { $record = Individual::getInstance(FunctionsDb::findRin($pid), $WT_TREE); } $controller = new IndividualController($record); if ($controller->record && $controller->record->canShow()) { if (Filter::get('action') == 'ajax') { $controller->ajaxRequest(); return; } // Generate the sidebar content *before* we display the page header, // as the clippings cart needs to have write access to the session. $sidebar_html = $controller->getSideBarContent(); $controller->pageHeader(); if ($controller->record->isPendingDeletion()) { if (Auth::isModerator($controller->record->getTree())) { echo '<p class="ui-state-highlight">', I18N::translate('This individual has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>'; } elseif (Auth::isEditor($controller->record->getTree())) {