16 import(
'lib.pkp.classes.notification.NotificationManagerDelegate');
25 parent::__construct($notificationType);
32 switch ($notification->getType()) {
33 case NOTIFICATION_TYPE_NEW_QUERY:
36 case NOTIFICATION_TYPE_QUERY_ACTIVITY:
39 default: assert(
false);
47 assert($notification->getAssocType() == ASSOC_TYPE_QUERY);
49 $query = $queryDao->getById($notification->getAssocId());
51 $headNote = $query->getHeadNote();
52 assert(isset($headNote));
54 switch($notification->getType()) {
55 case NOTIFICATION_TYPE_NEW_QUERY:
56 $user = $headNote->getUser();
57 return __(
'submission.query.new', array(
58 'creatorName' => $user->getFullName(),
60 'noteTitle' => substr($headNote->getTitle(), 0, 200),
62 case NOTIFICATION_TYPE_QUERY_ACTIVITY:
63 $notes = $query->getReplies(
null, NOTE_ORDER_ID, SORT_DIRECTION_DESC);
64 $latestNote = $notes->next();
65 $user = $latestNote->getUser();
67 return __(
'submission.query.activity', array(
68 'responderName' => $user->getFullName(),
70 'noteTitle' => substr($headNote->getTitle(), 0, 200),
72 default: assert(
false);
83 switch ($query->getAssocType()) {
84 case ASSOC_TYPE_SUBMISSION:
85 return $submissionDao->getById($query->getAssocId());
86 case ASSOC_TYPE_REPRESENTATION:
88 $representation = $representationDao->getById($query->getAssocId());
89 $publication =
Services::get(
'publication')->get($representation->getData(
'publicationId'));
90 return Services::get(
'submission')->get($publication->getData(
'submissionId'));
99 assert($notification->getAssocType() == ASSOC_TYPE_QUERY);
101 $query = $queryDao->getById($notification->getAssocId());
102 assert(is_a($query,
'Query'));
105 import(
'classes.core.Services');
106 return Services::get(
'submission')->getWorkflowUrlByUserRoles($submission, $notification->getUserId());
113 assert($notification->getAssocType() == ASSOC_TYPE_QUERY);
115 $query = $queryDao->getById($notification->getAssocId());
116 assert(is_a($query,
'Query'));
119 assert(is_a($submission,
'Submission'));
121 switch($notification->getType()) {
122 case NOTIFICATION_TYPE_NEW_QUERY:
124 'submission.query.new.contents',
126 'queryTitle' => $query->getHeadNote()->getTitle(),
127 'submissionTitle' => $submission->getLocalizedTitle(),
130 case NOTIFICATION_TYPE_QUERY_ACTIVITY:
132 'submission.query.activity.contents',
134 'queryTitle' => $query->getHeadNote()->getTitle(),
135 'submissionTitle' => $submission->getLocalizedTitle(),
138 default: assert(
false);
146 return NOTIFICATION_STYLE_CLASS_WARNING;