/**
* Construct a URL for the notification based on its type and associated object
* @copydoc PKPNotificationOperationManager::getNotificationContents()
*/
public function getNotificationUrl($request, $notification)
{
$url = parent::getNotificationUrl($request, $notification);
$dispatcher = Application::getDispatcher();
$contextDao = Application::getContextDAO();
$context = $contextDao->getById($notification->getContextId());
switch ($notification->getType()) {
case NOTIFICATION_TYPE_COPYEDIT_ASSIGNMENT:
case NOTIFICATION_TYPE_LAYOUT_ASSIGNMENT:
case NOTIFICATION_TYPE_INDEX_ASSIGNMENT:
assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId()));
return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(), 'workflow', 'access', $notification->getAssocId());
case NOTIFICATION_TYPE_REVIEWER_COMMENT:
assert($notification->getAssocType() == ASSOC_TYPE_REVIEW_ASSIGNMENT && is_numeric($notification->getAssocId()));
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
/* @var $reviewAssignmentDao ReviewAssignmentDAO */
$reviewAssignment = $reviewAssignmentDao->getById($notification->getAssocId());
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
$operation = $reviewAssignment->getStageId() == WORKFLOW_STAGE_ID_INTERNAL_REVIEW ? WORKFLOW_STAGE_PATH_INTERNAL_REVIEW : WORKFLOW_STAGE_PATH_EXTERNAL_REVIEW;
return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(), 'workflow', $operation, $reviewAssignment->getSubmissionId());
case NOTIFICATION_TYPE_REVIEW_ASSIGNMENT:
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
/* @var $reviewAssignmentDao ReviewAssignmentDAO */
$reviewAssignment = $reviewAssignmentDao->getById($notification->getAssocId());
return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(), 'reviewer', 'submission', $reviewAssignment->getSubmissionId());
case NOTIFICATION_TYPE_NEW_ANNOUNCEMENT:
assert($notification->getAssocType() == ASSOC_TYPE_ANNOUNCEMENT);
$announcementDao = DAORegistry::getDAO('AnnouncementDAO');
/* @var $announcementDao AnnouncementDAO */
$announcement = $announcementDao->getById($notification->getAssocId());
/* @var $announcement Announcement */
$context = $contextDao->getById($announcement->getAssocId());
return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(), 'announcement', 'view', array($notification->getAssocId()));
case NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD:
return __('notification.type.configurePaymentMethod');
default:
$delegateResult = $this->getByDelegate($notification->getType(), $notification->getAssocType(), $notification->getAssocId(), __FUNCTION__, array($request, $notification));
if ($delegateResult) {
$url = $delegateResult;
}
return $url;
}
}