Index: classes/article/Article.inc.php =================================================================== RCS file: /cvs/ojs2/classes/article/Article.inc.php,v retrieving revision 1.39 diff -u -r1.39 Article.inc.php --- classes/article/Article.inc.php 13 Nov 2008 00:27:03 -0000 1.39 +++ classes/article/Article.inc.php 21 Jan 2009 01:59:08 -0000 @@ -423,6 +423,74 @@ ); return $commentsStatusOptions; } + + /** + * Get an array of user IDs associated with this article + * @param $authors boolean + * @param $reviewers boolean + * @param $editors boolean + * @param $proofreaders boolean + * @param $copyeditors boolean + * @param $layoutEditors boolean + * @return array User IDs + */ + function getAssociatedUserIds($authors = true, $reviewers = true, $editors = true, $proofreaders = true, $copyeditors = true, $layoutEditors = true) { + $articleId = $this->getArticleId(); + + $userIds = array(); + + if($authors) { + $authorDao = &DAORegistry::getDAO('AuthorDAO'); + $authors = $authorDao->getAuthorsByArticle($articleId); + foreach ($authors as $author) { + $userIds[] = array('id' => $author->getAuthorId(), 'role' => 'author'); + } + } + + if($editors) { + $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); + $editAssignments =& $editAssignmentDao->getEditorAssignmentsByArticleId($articleId); + while ($editAssignment =& $editAssignments->next()) { + $userIds[] = array('id' => $editAssignment->getEditorId(), 'role' => 'editor'); + unset($editAssignment); + } + } + + if($copyeditors) { + $copyAssignmentDao = &DAORegistry::getDAO('CopyAssignmentDAO'); + $copyAssignment =& $copyAssignmentDao->getCopyAssignmentByArticleId($articleId); + if ($copyAssignment != null && $copyAssignment->getCopyeditorId() > 0) { + $userIds[] =array('id' => $copyAssignment->getCopyeditorId(), 'role' => 'copyeditor'); + } + } + + if($layoutEditors) { + $layoutAssignmentDao = &DAORegistry::getDAO('LayoutAssignmentDAO'); + $layoutEditorId = $layoutAssignmentDao->getLayoutEditorIdByArticleId($articleId); + if ($layoutEditorId != null && $layoutEditorId > 0) { + $userIds[] = array('id' => $layoutEditorId, 'role' => 'layoutEditor'); + } + } + + if($proofreaders) { + $proofAssignmentDao = &DAORegistry::getDAO('ProofAssignmentDAO'); + $proofAssignment =& $proofAssignmentDao->getProofAssignmentByArticleId($articleId); + if ($proofAssignment != null && $proofAssignment->getProofreaderId() > 0) { + $userIds[] = array('id' => $proofAssignment->getProofreaderId(), 'role' => 'proofreader'); + } + } + + if($reviewers) { + $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); + $reviewAssignments =& $reviewAssignmentDao->getReviewAssignmentsByArticleId($articleId); + foreach ($reviewAssignments as $reviewAssignment) { + $userIds[] = array('id' => $reviewAssignment->getReviewerId(), 'role' => 'reviewer'); + unset($reviewAssignment); + } + } + + return $userIds; + } } ?> Index: classes/journal/Journal.inc.php =================================================================== RCS file: /cvs/ojs2/classes/journal/Journal.inc.php,v retrieving revision 1.24 diff -u -r1.24 Journal.inc.php --- classes/journal/Journal.inc.php 1 Jul 2008 01:16:10 -0000 1.24 +++ classes/journal/Journal.inc.php 21 Jan 2009 01:59:08 -0000 @@ -175,6 +175,14 @@ function getJournalId() { return $this->getData('journalId'); } + + /** + * Get ID of journal (for generic calls in PKP WAL). + * @return int + */ + function getId() { + return $this->getData('journalId'); + } /** * Set ID of journal. Index: classes/submission/author/AuthorAction.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/author/AuthorAction.inc.php,v retrieving revision 1.70 diff -u -r1.70 AuthorAction.inc.php --- classes/submission/author/AuthorAction.inc.php 10 Dec 2008 23:37:27 -0000 1.70 +++ classes/submission/author/AuthorAction.inc.php 21 Jan 2009 01:59:08 -0000 @@ -277,6 +277,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -389,6 +398,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#copyedit"; + Notification::createNotification($user['id'], "notification.type.copyeditComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -432,6 +450,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#proofread"; + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } Index: classes/submission/common/Action.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/common/Action.inc.php,v retrieving revision 1.38 diff -u -r1.38 Action.inc.php --- classes/submission/common/Action.inc.php 10 Dec 2008 23:37:27 -0000 1.38 +++ classes/submission/common/Action.inc.php 21 Jan 2009 01:59:09 -0000 @@ -149,7 +149,16 @@ } else { $metadataForm->execute(); - + + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submission', $article->getArticleId()) . "#metadata"; + Notification::createNotification($user['id'], "notification.type.metadataModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED, 1); + } + // Add log entry $user = &Request::getUser(); import('article.log.ArticleLog'); @@ -257,6 +266,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionReview', $article->getArticleId()) . "#editorDecision"; + Notification::createNotification($user['id'], "notification.type.submissionComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUBMISSION_COMMENT, 1); + } + if ($emailComment) { $commentForm->email($commentForm->emailHelper()); } Index: classes/submission/copyeditor/CopyeditorAction.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/copyeditor/CopyeditorAction.inc.php,v retrieving revision 1.55 diff -u -r1.55 CopyeditorAction.inc.php --- classes/submission/copyeditor/CopyeditorAction.inc.php 10 Dec 2008 23:37:27 -0000 1.55 +++ classes/submission/copyeditor/CopyeditorAction.inc.php 21 Jan 2009 01:59:09 -0000 @@ -286,6 +286,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -328,6 +337,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#coypedit"; + Notification::createNotification($user['id'], "notification.type.copyeditComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } Index: classes/submission/layoutEditor/LayoutEditorAction.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/layoutEditor/LayoutEditorAction.inc.php,v retrieving revision 1.40 diff -u -r1.40 LayoutEditorAction.inc.php --- classes/submission/layoutEditor/LayoutEditorAction.inc.php 10 Dec 2008 23:37:27 -0000 1.40 +++ classes/submission/layoutEditor/LayoutEditorAction.inc.php 21 Jan 2009 01:59:09 -0000 @@ -252,7 +252,16 @@ if ($commentForm->validate()) { $commentForm->execute(); - + + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -294,7 +303,16 @@ if ($commentForm->validate()) { $commentForm->execute(); - + + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#proofread"; + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } Index: classes/submission/proofreader/ProofreaderAction.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/proofreader/ProofreaderAction.inc.php,v retrieving revision 1.52 diff -u -r1.52 ProofreaderAction.inc.php --- classes/submission/proofreader/ProofreaderAction.inc.php 10 Dec 2008 23:37:27 -0000 1.52 +++ classes/submission/proofreader/ProofreaderAction.inc.php 21 Jan 2009 01:59:09 -0000 @@ -474,6 +474,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#proofread"; + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -516,7 +525,16 @@ if ($commentForm->validate()) { $commentForm->execute(); - + + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } Index: classes/submission/reviewer/ReviewerAction.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/reviewer/ReviewerAction.inc.php,v retrieving revision 1.62 diff -u -r1.62 ReviewerAction.inc.php --- classes/submission/reviewer/ReviewerAction.inc.php 10 Dec 2008 23:37:27 -0000 1.62 +++ classes/submission/reviewer/ReviewerAction.inc.php 21 Jan 2009 01:59:10 -0000 @@ -305,6 +305,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionReview', $article->getArticleId()) . "#peerReview"; + Notification::createNotification($user['id'], "notification.type.reviewerComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -347,6 +356,21 @@ $reviewForm->readInputData(); if ($reviewForm->validate()) { $reviewForm->execute(); + + // Send a notification to associated users + import('notification.Notification'); + $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); + $reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($reviewId); + $articleId = $reviewAssignment->getArticleId(); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionReview', $article->getArticleId()) . "#peerReview"; + Notification::createNotification($user['id'], "notification.type.reviewerFormComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT, 1); + } + } else { $reviewForm->display(); return false; Index: classes/submission/sectionEditor/SectionEditorAction.inc.php =================================================================== RCS file: /cvs/ojs2/classes/submission/sectionEditor/SectionEditorAction.inc.php,v retrieving revision 1.173 diff -u -r1.173 SectionEditorAction.inc.php --- classes/submission/sectionEditor/SectionEditorAction.inc.php 10 Dec 2008 23:37:27 -0000 1.173 +++ classes/submission/sectionEditor/SectionEditorAction.inc.php 21 Jan 2009 01:59:11 -0000 @@ -1758,6 +1758,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionReview', $article->getArticleId()) . "#peerReview"; + Notification::createNotification($user['id'], "notification.type.reviewerComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -1801,6 +1810,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionReview', $article->getArticleId()) . "#editorDecision"; + Notification::createNotification($user['id'], "notification.type.editorDecisionComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -2044,6 +2062,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#copyedit"; + Notification::createNotification($user['id'], "notification.type.copyeditComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -2087,6 +2114,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } @@ -2130,6 +2166,15 @@ if ($commentForm->validate()) { $commentForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#proofread"; + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT, 1); + } + if ($emailComment) { $commentForm->email(); } Index: dbscripts/xml/data/email_templates.xml =================================================================== RCS file: /cvs/ojs2/dbscripts/xml/data/email_templates.xml,v retrieving revision 1.33 diff -u -r1.33 email_templates.xml --- dbscripts/xml/data/email_templates.xml 9 Dec 2008 17:44:03 -0000 1.33 +++ dbscripts/xml/data/email_templates.xml 21 Jan 2009 01:59:11 -0000 @@ -21,6 +21,21 @@ * --> + NOTIFICATION + 1 + 0 + + + NOTIFICATION_MAILLIST + 1 + 0 + + + NOTIFICATION_MAILLIST_PASSWORD + 1 + 0 + + PASSWORD_RESET_CONFIRM 1 0 Index: dbscripts/xml/data/locale/en_US/email_templates_data.xml =================================================================== RCS file: /cvs/ojs2/dbscripts/xml/data/locale/en_US/email_templates_data.xml,v retrieving revision 1.56 diff -u -r1.56 email_templates_data.xml --- dbscripts/xml/data/locale/en_US/email_templates_data.xml 9 Dec 2008 17:44:03 -0000 1.56 +++ dbscripts/xml/data/locale/en_US/email_templates_data.xml 21 Jan 2009 01:59:12 -0000 @@ -22,6 +22,55 @@ * --> + NOTIFICATION + New notification + You have a new notification from {$siteTitle}: + +{$notificationContents} + +Link: {$url} + +{$principalContactSignature} + The email is sent to registered users that have selected to have this type of notification emailed to them. + + + NOTIFICATION_MAILLIST + New notification + You have a new notification from {$siteTitle}: +-- +{$notificationContents} + +Link: {$url} +-- + +If you wish to stop receiving notification emails, please go to {$unsubscribeLink} and enter your email address and password. + +{$principalContactSignature} + This email is sent to unregistered users on the notification mailing list. + + + NOTIFICATION_MAILLIST_WELCOME + Welcome to the the {$siteTitle} mailing list! + You have signed up to receive notifications from {$siteTitle}. + +If you wish to stop receiving notification emails, please go to {$unsubscribeLink} and enter your email address and password. + +Your password for disabling notification emails is: {$password} + +{$principalContactSignature} + This email is sent to an unregistered user who just registered with the notification mailing list. + + + NOTIFICATION_MAILLIST_PASSWORD + Your notification mailing list information + Your new password for disabling notification emails is: {$password} + +If you wish to stop receiving notification emails, please go to {$unsubscribeLink} and enter your email address and password. + +{$principalContactSignature} + This email is sent to an unregistered user on the notification mailing list when they indicate that they have forgotten their password or are unable to login. It provides a URL they can follow to reset their password. + + PASSWORD_RESET_CONFIRM Password Reset Confirmation We have received a request to reset your password for the {$siteTitle} web site. Index: pages/admin/AdminJournalHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/admin/AdminJournalHandler.inc.php,v retrieving revision 1.24 diff -u -r1.24 AdminJournalHandler.inc.php --- pages/admin/AdminJournalHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.24 +++ pages/admin/AdminJournalHandler.inc.php 21 Jan 2009 01:59:14 -0000 @@ -77,6 +77,7 @@ if ($settingsForm->validate()) { PluginRegistry::loadCategory('blocks'); $settingsForm->execute(); + Request::redirect(null, null, 'journals'); } else { Index: pages/admin/AdminSettingsHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/admin/AdminSettingsHandler.inc.php,v retrieving revision 1.18 diff -u -r1.18 AdminSettingsHandler.inc.php --- pages/admin/AdminSettingsHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.18 +++ pages/admin/AdminSettingsHandler.inc.php 21 Jan 2009 01:59:14 -0000 @@ -77,7 +77,6 @@ } } elseif ($settingsForm->validate()) { $settingsForm->execute(); - $templateMgr = &TemplateManager::getManager(); $templateMgr->assign(array( 'currentUrl' => Request::url(null, null, 'settings'), Index: pages/author/SubmitHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/author/SubmitHandler.inc.php,v retrieving revision 1.30 diff -u -r1.30 SubmitHandler.inc.php --- pages/author/SubmitHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.30 +++ pages/author/SubmitHandler.inc.php 21 Jan 2009 01:59:14 -0000 @@ -144,6 +144,25 @@ $articleId = $submitForm->execute(); if ($step == 5) { + // Send a notification to associated users + import('notification.Notification'); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $roleDao = &DAORegistry::getDAO('RoleDAO'); + $notificationUsers = array(); + $journalManagers = $roleDao->getUsersByRoleId(ROLE_ID_JOURNAL_MANAGER); + $allUsers = $journalManagers->toArray(); + $editors = $roleDao->getUsersByRoleId(ROLE_ID_EDITOR); + array_merge($allUsers, $editors->toArray()); + foreach ($allUsers as $user) { + $notificationUsers[] = array('id' => $user->getUserId()); + } + foreach ($notificationUsers as $user) { + $url = Request::url(null, 'editor', 'submission', $articleId); + Notification::createNotification($user['id'], "notification.type.articleSubmitted", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_ARTICLE_SUBMITTED, 1); + } + $journal = &Request::getJournal(); $templateMgr = &TemplateManager::getManager(); $templateMgr->assign_by_ref('journal', $journal); Index: pages/comment/CommentHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/comment/CommentHandler.inc.php,v retrieving revision 1.34 diff -u -r1.34 CommentHandler.inc.php --- pages/comment/CommentHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.34 +++ pages/comment/CommentHandler.inc.php 21 Jan 2009 01:59:15 -0000 @@ -97,6 +97,18 @@ $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); + + // Send a notification to associated users + import('notification.Notification'); + $articleDAO =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDAO->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(); + foreach ($notificationUsers as $user) { + $url = Request::url(null, null, 'view', array($articleId, $galleyId, $parentId)); + Notification::createNotification($user['id'], "notification.type.userComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_USER_COMMENT, 1); + } + Request::redirect(null, null, 'view', array($articleId, $galleyId, $parentId), array('refresh' => 1)); } } Index: pages/editor/IssueManagementHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/editor/IssueManagementHandler.inc.php,v retrieving revision 1.83 diff -u -r1.83 IssueManagementHandler.inc.php --- pages/editor/IssueManagementHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.83 +++ pages/editor/IssueManagementHandler.inc.php 21 Jan 2009 01:59:15 -0000 @@ -94,7 +94,6 @@ $issueDao->updateIssue($issue); } } - Request::redirect(null, null, 'backIssues'); } @@ -537,7 +536,26 @@ $issueDao = &DAORegistry::getDAO('IssueDAO'); $issueDao->updateCurrentIssue($journalId,$issue); - + + // Send a notification to associated users + import('notification.Notification'); + $roleDao = &DAORegistry::getDAO('RoleDAO'); + $notificationUsers = array(); + $allUsers = $roleDao->getUsersByJournalId($journalId); + while (!$allUsers->eof()) { + $user = &$allUsers->next(); + $notificationUsers[] = array('id' => $user->geUserId()); + unset($user); + } + $url = Request::url(null, 'issue', 'current'); + foreach ($notificationUsers as $user) { + Notification::createNotification($user['id'], "notification.type.issuePublished", + null, $url, 1, NOTIFICATION_TYPE_PUBLISHED_ISSUE, 1); + } + $notificationDao = &DAORegistry::getDAO('NotificationDAO'); + $notificationDao->sendToMailingList(Notification::createNotification(0, "notification.type.issuePublished", + null, $url, 1, NOTIFICATION_TYPE_PUBLISHED_ISSUE, 1)); + Request::redirect(null, null, 'issueToc', $issue->getIssueId()); } Index: pages/layoutEditor/SubmissionLayoutHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/layoutEditor/SubmissionLayoutHandler.inc.php,v retrieving revision 1.43 diff -u -r1.43 SubmissionLayoutHandler.inc.php --- pages/layoutEditor/SubmissionLayoutHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.43 +++ pages/layoutEditor/SubmissionLayoutHandler.inc.php 21 Jan 2009 01:59:15 -0000 @@ -184,6 +184,17 @@ if ($submitForm->validate()) { $submitForm->execute(); + // Send a notification to associated users + import('notification.Notification'); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.galleyModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_MODIFIED, 1); + } + if (Request::getUserVar('uploadImage')) { $submitForm->uploadImage(); Request::redirect(null, null, 'editGalley', array($articleId, $galleyId)); @@ -368,6 +379,18 @@ if ($submitForm->validate()) { $submitForm->execute(); + + // Send a notification to associated users + import('notification.Notification'); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.suppFileModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED, 1); + } + Request::redirect(null, null, 'submission', $articleId); } else { Index: pages/manager/ManagerPaymentHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/manager/ManagerPaymentHandler.inc.php,v retrieving revision 1.10 diff -u -r1.10 ManagerPaymentHandler.inc.php --- pages/manager/ManagerPaymentHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.10 +++ pages/manager/ManagerPaymentHandler.inc.php 21 Jan 2009 01:59:16 -0000 @@ -152,7 +152,6 @@ if ($settingsForm->validate()) { $settingsForm->execute(); - $templateMgr->assign(array( 'currentUrl' => Request::url(null, null, 'payMethodSettings'), 'pageTitle' => 'manager.payment.paymentMethods', Index: pages/manager/SubscriptionHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/manager/SubscriptionHandler.inc.php,v retrieving revision 1.27 diff -u -r1.27 SubscriptionHandler.inc.php --- pages/manager/SubscriptionHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.27 +++ pages/manager/SubscriptionHandler.inc.php 21 Jan 2009 01:59:17 -0000 @@ -230,7 +230,6 @@ if ($subscriptionForm->validate()) { $subscriptionForm->execute(); - if (Request::getUserVar('createAnother')) { Request::redirect(null, null, 'selectSubscriber', null, array('subscriptionCreated', 1)); } else { @@ -465,7 +464,6 @@ if ($subscriptionPolicyForm->validate()) { $subscriptionPolicyForm->execute(); - SubscriptionHandler::setupTemplate(true); $templateMgr = &TemplateManager::getManager(); Index: pages/sectionEditor/SubmissionEditHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/sectionEditor/SubmissionEditHandler.inc.php,v retrieving revision 1.81 diff -u -r1.81 SubmissionEditHandler.inc.php --- pages/sectionEditor/SubmissionEditHandler.inc.php 10 Dec 2008 23:37:28 -0000 1.81 +++ pages/sectionEditor/SubmissionEditHandler.inc.php 21 Jan 2009 01:59:19 -0000 @@ -1214,6 +1214,18 @@ if ($submitForm->validate()) { $submitForm->execute(); + + // Send a notification to associated users + import('notification.Notification'); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.suppFileModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED, 1); + } + Request::redirect(null, null, SubmissionEditHandler::getFrom(), $articleId); } else { parent::setupTemplate(true, $articleId, 'summary'); @@ -1463,6 +1475,17 @@ $galleyForm =& new ArticleGalleyForm($articleId); $galleyId = $galleyForm->execute($fileName); + // Send a notification to associated users + import('notification.Notification'); + $articleDao = &DAORegistry::getDAO('ArticleDAO'); + $article = &$articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.galleyAdded", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_ADDED, 1); + } + Request::redirect(null, null, 'editGalley', array($articleId, $galleyId)); } @@ -1507,7 +1530,18 @@ $submitForm->readInputData(); if ($submitForm->validate()) { $submitForm->execute(); - + + // Send a notification to associated users + import('notification.Notification'); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.galleyModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_MODIFIED, 1); + } + if (Request::getUserVar('uploadImage')) { $submitForm->uploadImage(); Request::redirect(null, null, 'editGalley', array($articleId, $galleyId)); @@ -1626,6 +1660,17 @@ $suppFileForm->setData('title', Locale::translate('common.untitled')); $suppFileId = $suppFileForm->execute($fileName); + // Send a notification to associated users + import('notification.Notification'); + $articleDao =& DAORegistry::getDAO('ArticleDAO'); + $article =& $articleDao->getArticle($articleId); + $notificationUsers = $article->getAssociatedUserIds(true, false); + foreach ($notificationUsers as $user) { + $url = Request::url(null, $user['role'], 'submissionEditing', $article->getArticleId()) . "#layout"; + Notification::createNotification($user['id'], "notification.type.suppFileAdded", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_ADDED, 1); + } + Request::redirect(null, null, 'editSuppFile', array($articleId, $suppFileId)); } Index: plugins/blocks/fontSize/FontSizeBlockPlugin.inc.php =================================================================== RCS file: /cvs/ojs2/plugins/blocks/fontSize/FontSizeBlockPlugin.inc.php,v retrieving revision 1.9 diff -u -r1.9 FontSizeBlockPlugin.inc.php --- plugins/blocks/fontSize/FontSizeBlockPlugin.inc.php 1 Jul 2008 19:44:47 -0000 1.9 +++ plugins/blocks/fontSize/FontSizeBlockPlugin.inc.php 21 Jan 2009 01:59:20 -0000 @@ -23,7 +23,7 @@ if ($success) { $this->addLocaleData(); $templateMgr =& TemplateManager::getManager(); - $templateMgr->assign('fontIconPath', 'templates/images/icons'); + $templateMgr->assign('fontIconPath', 'lib/pkp/templates/images/icons'); $additionalHeadData = $templateMgr->get_template_vars('additionalHeadData'); // Add font sizer js and css if not already in header Index: styles/common.css =================================================================== RCS file: /cvs/ojs2/styles/common.css,v retrieving revision 1.74 diff -u -r1.74 common.css --- styles/common.css 14 Jan 2009 19:15:15 -0000 1.74 +++ styles/common.css 21 Jan 2009 01:59:23 -0000 @@ -651,7 +651,13 @@ font-size: 1em; } -ul.formErrorList a { +span.formSuccess { + color: #090; + font-weight: bold; + font-size: 1em; +} + +ul.formErrorList { color: #900; } @@ -742,3 +748,14 @@ width: 505px; z-index:1; } + +td.notificationContent { + padding-left: 5px; + padding-right: 5px; +} + +td.notificationFunction { + padding-left: 5px; + padding-right: 5px; + text-align: right; +} Index: templates/article/article.tpl =================================================================== RCS file: /cvs/ojs2/templates/article/article.tpl,v retrieving revision 1.63 diff -u -r1.63 article.tpl --- templates/article/article.tpl 26 Nov 2008 00:24:57 -0000 1.63 +++ templates/article/article.tpl 21 Jan 2009 01:59:23 -0000 @@ -15,9 +15,9 @@ {$galley->getHTMLContents()} @@ -27,9 +27,9 @@ {assign var=galleys value=$article->getLocalizedGalleys()} {if $galleys && $subscriptionRequired && $showGalleyLinks} {if $coverPagePath} @@ -71,17 +71,17 @@ getBestArticleId($currentJournal)|to_array:$galley->getBestGalleyId($currentJournal)}" class="file" target="_parent">{$galley->getGalleyLabel()|escape} {if $subscriptionRequired && $showGalleyLinks && $restrictOnlyPdf} {if $article->getAccessStatus() || !$galley->isPdfGalley()} - + {else} - + {/if} {/if} {/foreach} {if $subscriptionRequired && $showGalleyLinks && !$restrictOnlyPdf} {if $article->getAccessStatus()} - + {else} - + {/if} {/if} {else} Index: templates/common/navbar.tpl =================================================================== RCS file: /cvs/ojs2/templates/common/navbar.tpl,v retrieving revision 1.1 diff -u -r1.1 navbar.tpl --- templates/common/navbar.tpl 16 Oct 2008 18:02:27 -0000 1.1 +++ templates/common/navbar.tpl 21 Jan 2009 01:59:23 -0000 @@ -22,6 +22,7 @@
  • {translate key="navigation.search"}
  • {if $currentJournal} +
  • {translate key="notification.notifications"}
  • {translate key="navigation.current"}
  • {translate key="navigation.archives"}
  • {/if}{* $currentJournal *} Index: templates/issue/issue.tpl =================================================================== RCS file: /cvs/ojs2/templates/issue/issue.tpl,v retrieving revision 1.42 diff -u -r1.42 issue.tpl --- templates/issue/issue.tpl 20 Jun 2008 08:08:34 -0000 1.42 +++ templates/issue/issue.tpl 21 Jan 2009 01:59:23 -0000 @@ -44,17 +44,17 @@ getBestArticleId($currentJournal)|to_array:$galley->getBestGalleyId($currentJournal)}" class="file">{$galley->getGalleyLabel()|escape} {if $subscriptionRequired && $showGalleyLinks && $restrictOnlyPdf} {if $article->getAccessStatus() || !$galley->isPdfGalley()} - + {else} - + {/if} {/if} {/foreach} {if $subscriptionRequired && $showGalleyLinks && !$restrictOnlyPdf} {if $article->getAccessStatus()} - + {else} - + {/if} {/if} {/if} Index: templates/issue/view.tpl =================================================================== RCS file: /cvs/ojs2/templates/issue/view.tpl,v retrieving revision 1.32 diff -u -r1.32 view.tpl --- templates/issue/view.tpl 19 Jun 2008 15:59:43 -0000 1.32 +++ templates/issue/view.tpl 21 Jan 2009 01:59:23 -0000 @@ -11,9 +11,9 @@ *} {if $subscriptionRequired && $showGalleyLinks && $showToc}
    - {translate key= + {translate key= {translate key="reader.openAccess"}  - {translate key= + {translate key= {if $purchaseArticleEnabled} {translate key="reader.subscriptionOrFeeAccess"} {else}