Пример #1
0
 /**
  * Construct a URL for the notification based on its type and associated object
  * @param $request PKPRequest
  * @param $notification Notification
  * @return string
  */
 function getNotificationUrl($request, $notification)
 {
     $router = $request->getRouter();
     $dispatcher = $router->getDispatcher();
     $context = $request->getContext();
     switch ($notification->getType()) {
         case NOTIFICATION_TYPE_PUBLISHED_ISSUE:
             return $dispatcher->url($request, ROUTE_PAGE, null, 'issue', 'current');
         default:
             return parent::getNotificationUrl($request, $notification);
     }
 }
Пример #2
0
 /**
  * @copydoc PKPNotificationManager::getNotificationUrl()
  */
 public function getNotificationUrl($request, $notification)
 {
     $router = $request->getRouter();
     $dispatcher = $router->getDispatcher();
     $contextDao = Application::getContextDAO();
     $context = $contextDao->getById($notification->getContextId());
     switch ($notification->getType()) {
         case NOTIFICATION_TYPE_VISIT_CATALOG:
             return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(), 'manageCatalog');
     }
     return parent::getNotificationUrl($request, $notification);
 }
Пример #3
0
 /**
  * Construct a URL for the notification based on its type and associated object
  * @param $request PKPRequest
  * @param $notification Notification
  * @return string
  */
 function getNotificationUrl(&$request, &$notification)
 {
     $router =& $request->getRouter();
     $dispatcher =& $router->getDispatcher();
     $type = $notification->getType();
     switch ($type) {
         case NOTIFICATION_TYPE_ARTICLE_SUBMITTED:
             $role = $this->_getCachedRole($request, $notification);
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submission', $notification->getAssocId());
         case NOTIFICATION_TYPE_SUPP_FILE_MODIFIED:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionEditing', $notification->getAssocId());
         case NOTIFICATION_TYPE_METADATA_MODIFIED:
             $role = $this->_getCachedRole($request, $notification);
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submission', $notification->getAssocId(), null, 'metadata');
         case NOTIFICATION_TYPE_GALLEY_MODIFIED:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionEditing', $notification->getAssocId(), null, 'layout');
         case NOTIFICATION_TYPE_SUBMISSION_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionReview', $notification->getAssocId(), null, 'editorDecision');
         case NOTIFICATION_TYPE_LAYOUT_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionEditing', $notification->getAssocId(), null, 'layout');
         case NOTIFICATION_TYPE_COPYEDIT_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionEditing', $notification->getAssocId(), null, 'coypedit');
         case NOTIFICATION_TYPE_PROOFREAD_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionEditing', $notification->getAssocId(), null, 'proofread');
         case NOTIFICATION_TYPE_REVIEWER_COMMENT:
         case NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionReview', $notification->getAssocId(), null, 'peerReview');
         case NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR, ROLE_ID_AUTHOR));
             return $dispatcher->url($request, ROUTE_PAGE, null, $role, 'submissionReview', $notification->getAssocId(), null, 'editorDecision');
         case NOTIFICATION_TYPE_USER_COMMENT:
             return $dispatcher->url($request, ROUTE_PAGE, null, 'comment', 'view', $notification->getAssocId());
         case NOTIFICATION_TYPE_PUBLISHED_ISSUE:
             return $dispatcher->url($request, ROUTE_PAGE, null, 'issue', 'current');
         case NOTIFICATION_TYPE_NEW_ANNOUNCEMENT:
             assert($notification->getAssocType() == ASSOC_TYPE_ANNOUNCEMENT);
             return $dispatcher->url($request, ROUTE_PAGE, null, 'announcement', 'view', array($notification->getAssocId()));
         default:
             return parent::getNotificationUrl($request, $notification);
     }
 }
Пример #4
0
 /**
  * Construct a URL for the notification based on its type and associated object
  * @param $request PKPRequest
  * @param $notification Notification
  * @return string
  */
 function getNotificationUrl(&$request, &$notification)
 {
     $router =& $request->getRouter();
     $type = $notification->getType();
     switch ($type) {
         case NOTIFICATION_TYPE_PAPER_SUBMITTED:
             $role = $this->_getCachedRole($request, $notification);
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submission', $notification->getAssocId());
         case NOTIFICATION_TYPE_SUPP_FILE_MODIFIED:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_DIRECTOR, ROLE_ID_TRACK_DIRECTOR, ROLE_ID_AUTHOR));
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submissionReview', $notification->getAssocId(), null, 'layout');
         case NOTIFICATION_TYPE_METADATA_MODIFIED:
             $role = $this->_getCachedRole($request, $notification);
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submission', $notification->getAssocId(), null, 'metadata');
         case NOTIFICATION_TYPE_GALLEY_MODIFIED:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_DIRECTOR, ROLE_ID_TRACK_DIRECTOR, ROLE_ID_AUTHOR));
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submissionEditing', $notification->getAssocId(), null, 'layout');
         case NOTIFICATION_TYPE_SUBMISSION_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_DIRECTOR, ROLE_ID_TRACK_DIRECTOR, ROLE_ID_AUTHOR));
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submissionReview', $notification->getAssocId(), null, 'editorDecision');
         case NOTIFICATION_TYPE_DIRECTOR_DECISION_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_DIRECTOR, ROLE_ID_TRACK_DIRECTOR, ROLE_ID_AUTHOR));
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submissionEditing', $notification->getAssocId(), null, 'directorDecision');
         case NOTIFICATION_TYPE_REVIEWER_COMMENT:
         case NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT:
             $role = $this->_getCachedRole($request, $notification, array(ROLE_ID_DIRECTOR, ROLE_ID_TRACK_DIRECTOR, ROLE_ID_AUTHOR));
             return $router->url($request, array($this->_getConfPathFromPaperNotification($notification), $this->_getSchedConfPathFromPaperNotification($notification)), $role, 'submissionReview', $notification->getAssocId(), null, 'peerReview');
         case NOTIFICATION_TYPE_USER_COMMENT:
             return $router->url($request, null, 'comment', 'view', $notification->getAssocId());
         case NOTIFICATION_TYPE_NEW_ANNOUNCEMENT:
             assert($notification->getAssocType() == ASSOC_TYPE_ANNOUNCEMENT);
             return $router->url($request, null, 'announcement', 'view', array($notification->getAssocId()));
         default:
             return parent::getNotificationUrl($request, $notification);
     }
 }