diff options
| author | Greg Roach <fisharebest@gmail.com> | 2018-01-07 18:09:05 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2018-01-07 18:12:36 +0000 |
| commit | aea34fd8765f05ee00af827fe7354da7f7a2ff29 (patch) | |
| tree | 8106c788eee2757797ebd6f495e9ff569967dbe6 /family.php | |
| parent | cc89228d549ad0e772367e5c941c0327c07db8ea (diff) | |
| download | webtrees-aea34fd8765f05ee00af827fe7354da7f7a2ff29.tar.gz webtrees-aea34fd8765f05ee00af827fe7354da7f7a2ff29.tar.bz2 webtrees-aea34fd8765f05ee00af827fe7354da7f7a2ff29.zip | |
Move pending messages to the views
Diffstat (limited to 'family.php')
| -rw-r--r-- | family.php | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/family.php b/family.php index d6c610573c..950cdcb69e 100644 --- a/family.php +++ b/family.php @@ -16,7 +16,6 @@ namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\FamilyController; -use Fisharebest\Webtrees\Functions\FunctionsPrint; /** @global Tree $WT_TREE */ global $WT_TREE; @@ -27,37 +26,19 @@ $record = Family::getInstance(Filter::get('famid', WT_REGEX_XREF), $WT_TREE) $controller = new FamilyController($record); if ($controller->record && $controller->record->canShow()) { - if ($controller->record->isPendingDeletion()) { - if (Auth::isModerator($controller->record->getTree())) { - FlashMessages::addMessage(/* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( - 'This family has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="#" class="alert-link" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="#" class="alert-link" 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'), 'warning'); - } elseif (Auth::isEditor($controller->record->getTree())) { - FlashMessages::addMessage(I18N::translate('This family has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning'); - } - } elseif ($controller->record->isPendingAddition()) { - if (Auth::isModerator($controller->record->getTree())) { - FlashMessages::addMessage(/* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( - 'This family has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="#" class="alert-link" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="#" class="alert-link" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' - ) . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning'); - } elseif (Auth::isEditor($controller->record->getTree())) { - FlashMessages::addMessage(I18N::translate('This family has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning'); - } - } $controller->pageHeader(); } elseif ($controller->record && $controller->record->getTree()->getPreference('SHOW_PRIVATE_RELATIONSHIPS')) { $controller->pageHeader(); // Continue - to display the children/parents/grandparents. // We'll check for showing the details again later } else { - FlashMessages::addMessage(I18N::translate('This family does not exist or you do not have permission to view it.'), 'danger'); http_response_code(404); $controller->pageHeader(); + echo View::make('alerts/error', [ + 'alert' => I18N::translate('This family does not exist or you do not have permission to view it.'), + ]); + return; } |
