17 import(
'lib.pkp.classes.notification.PKPNotificationManager');
31 $router = $request->getRouter();
32 $dispatcher = $router->getDispatcher();
34 $context = $contextDao->getById($notification->getContextId());
36 switch ($notification->getType()) {
37 case NOTIFICATION_TYPE_PUBLISHED_ISSUE:
38 return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(),
'issue',
'current');
40 return parent::getNotificationUrl($request, $notification);
53 HookRegistry::call(
'NotificationManager::getNotificationMessage', array(&$notification, &$message));
54 if($message)
return $message;
56 switch ($notification->getType()) {
57 case NOTIFICATION_TYPE_PUBLISHED_ISSUE:
58 return __(
'notification.type.issuePublished');
59 case NOTIFICATION_TYPE_BOOK_REQUESTED:
60 return __(
'plugins.generic.booksForReview.notification.bookRequested');
61 case NOTIFICATION_TYPE_BOOK_CREATED:
62 return __(
'plugins.generic.booksForReview.notification.bookCreated');
63 case NOTIFICATION_TYPE_BOOK_UPDATED:
64 return __(
'plugins.generic.booksForReview.notification.bookUpdated');
65 case NOTIFICATION_TYPE_BOOK_DELETED:
66 return __(
'plugins.generic.booksForReview.notification.bookDeleted');
67 case NOTIFICATION_TYPE_BOOK_MAILED:
68 return __(
'plugins.generic.booksForReview.notification.bookMailed');
69 case NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED:
70 return __(
'plugins.generic.booksForReview.notification.settingsSaved');
71 case NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED:
72 return __(
'plugins.generic.booksForReview.notification.submissionAssigned');
73 case NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED:
74 return __(
'plugins.generic.booksForReview.notification.authorAssigned');
75 case NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED:
76 return __(
'plugins.generic.booksForReview.notification.authorDenied');
77 case NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED:
78 return __(
'plugins.generic.booksForReview.notification.authorRemoved');
80 return parent::getNotificationMessage($request, $notification);
90 assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION);
91 assert(is_numeric($notification->getAssocId()));
93 $article = $submissionDao->getById($notification->getAssocId());
94 if (!$article)
return null;
95 return $article->getLocalizedTitle();
104 switch ($notification->getType()) {
105 case NOTIFICATION_TYPE_BOOK_REQUESTED:
106 case NOTIFICATION_TYPE_BOOK_CREATED:
107 case NOTIFICATION_TYPE_BOOK_UPDATED:
108 case NOTIFICATION_TYPE_BOOK_DELETED:
109 case NOTIFICATION_TYPE_BOOK_MAILED:
110 case NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED:
111 case NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED:
112 case NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED:
113 case NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED:
114 case NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED:
115 return 'notifySuccess';
116 default:
return parent::getStyleClass($notification);
126 switch ($notification->getType()) {
127 case NOTIFICATION_TYPE_PUBLISHED_ISSUE:
128 return 'notifyIconPublished';
129 case NOTIFICATION_TYPE_NEW_ANNOUNCEMENT:
130 return 'notifyIconNewAnnouncement';
131 case NOTIFICATION_TYPE_BOOK_REQUESTED:
132 case NOTIFICATION_TYPE_BOOK_CREATED:
133 case NOTIFICATION_TYPE_BOOK_UPDATED:
134 case NOTIFICATION_TYPE_BOOK_DELETED:
135 case NOTIFICATION_TYPE_BOOK_MAILED:
136 case NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED:
137 case NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED:
138 case NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED:
139 case NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED:
140 case NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED:
141 return 'notifyIconSuccess';
142 default:
return parent::getIconClass($notification);
149 protected function getMgrDelegate($notificationType, $assocType, $assocId) {
150 switch ($notificationType) {
151 case NOTIFICATION_TYPE_APPROVE_SUBMISSION:
152 case NOTIFICATION_TYPE_VISIT_CATALOG:
153 assert($assocType == ASSOC_TYPE_SUBMISSION && is_numeric($assocId));
154 import(
'classes.notification.managerDelegate.ApproveSubmissionNotificationManager');
158 return parent::getMgrDelegate($notificationType, $assocType, $assocId);