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 /gedrecord.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 'gedrecord.php')
| -rw-r--r-- | gedrecord.php | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/gedrecord.php b/gedrecord.php index 4522289619..c345b24700 100644 --- a/gedrecord.php +++ b/gedrecord.php @@ -16,9 +16,6 @@ namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\GedcomRecordController; -use Fisharebest\Webtrees\Functions\FunctionsPrint; -use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; -use Fisharebest\Webtrees\Functions\FunctionsPrintLists; /** @global Tree $WT_TREE */ global $WT_TREE; @@ -41,33 +38,15 @@ if ( $controller = new GedcomRecordController($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 record 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 record 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 record 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 record has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning'); - } - } $controller->pageHeader(); } else { - FlashMessages::addMessage(I18N::translate('This record 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 record does not exist or you do not have permission to view it.'), + ]); + return; } |
