16 import(
'lib.pkp.classes.notification.NotificationManagerDelegate');
25 parent::__construct($notificationType);
33 $context = $request->getContext();
34 return $dispatcher->url($request, ROUTE_PAGE, $context->getPath(),
'workflow',
'access', $notification->getAssocId());
41 return NOTIFICATION_STYLE_CLASS_INFORMATION;
55 $submissionId = $assocId;
57 $submission = $submissionDao->getById($submissionId);
61 $notificationTypes = array(
62 NOTIFICATION_TYPE_APPROVE_SUBMISSION =>
false,
63 NOTIFICATION_TYPE_FORMAT_NEEDS_APPROVED_SUBMISSION =>
false,
64 NOTIFICATION_TYPE_VISIT_CATALOG =>
true,
67 $isPublished = (boolean) $submission->getDatePublished();
69 foreach ($notificationTypes as $type => $forPublicationState) {
70 $notificationFactory = $notificationDao->getByAssoc(
71 ASSOC_TYPE_SUBMISSION,
75 $submission->getData(
'contextId')
77 $notification = $notificationFactory->next();
79 if (!$notification && $isPublished == $forPublicationState) {
85 $submission->getData(
'contextId'),
86 ASSOC_TYPE_SUBMISSION,
88 NOTIFICATION_LEVEL_NORMAL
90 } elseif ($notification && $isPublished != $forPublicationState) {
92 $notificationDao->deleteObject($notification);