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 28 Jan 2009 19:24:25 -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/core/OJSApplication.inc.php =================================================================== RCS file: /cvs/ojs2/classes/core/OJSApplication.inc.php,v retrieving revision 1.11 diff -u -r1.11 OJSApplication.inc.php --- classes/core/OJSApplication.inc.php 5 Nov 2008 00:46:39 -0000 1.11 +++ classes/core/OJSApplication.inc.php 28 Jan 2009 19:24:25 -0000 @@ -145,7 +145,6 @@ 'JournalStatisticsDAO' => 'journal.JournalStatisticsDAO', 'LayoutAssignmentDAO' => 'submission.layoutAssignment.LayoutAssignmentDAO', 'LayoutEditorSubmissionDAO' => 'submission.layoutEditor.LayoutEditorSubmissionDAO', - 'NotificationStatusDAO' => 'journal.NotificationStatusDAO', 'OAIDAO' => 'oai.ojs.OAIDAO', 'OJSCompletedPaymentDAO' => 'payment.ojs.OJSCompletedPaymentDAO', 'PluginSettingsDAO' => 'plugins.PluginSettingsDAO', Index: classes/install/Upgrade.inc.php =================================================================== RCS file: /cvs/ojs2/classes/install/Upgrade.inc.php,v retrieving revision 1.36 diff -u -r1.36 Upgrade.inc.php --- classes/install/Upgrade.inc.php 9 Dec 2008 19:40:45 -0000 1.36 +++ classes/install/Upgrade.inc.php 28 Jan 2009 19:24:25 -0000 @@ -463,7 +463,7 @@ $tables = array( 'versions', 'site', 'site_settings', 'scheduled_tasks', 'sessions', 'journal_settings', - 'plugin_settings', 'roles', 'notification_status', + 'plugin_settings', 'roles', 'section_settings', 'section_editors', 'issue_settings', 'custom_issue_orders', 'custom_section_orders', 'article_settings', 'article_author_settings', 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 28 Jan 2009 19:24:25 -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/journal/JournalDAO.inc.php =================================================================== RCS file: /cvs/ojs2/classes/journal/JournalDAO.inc.php,v retrieving revision 1.34 diff -u -r1.34 JournalDAO.inc.php --- classes/journal/JournalDAO.inc.php 5 Nov 2008 00:46:40 -0000 1.34 +++ classes/journal/JournalDAO.inc.php 28 Jan 2009 19:24:25 -0000 @@ -142,9 +142,6 @@ $issueDao = &DAORegistry::getDAO('IssueDAO'); $issueDao->deleteIssuesByJournal($journalId); - $notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO'); - $notificationStatusDao->deleteNotificationStatusByJournal($journalId); - $emailTemplateDao = &DAORegistry::getDAO('EmailTemplateDAO'); $emailTemplateDao->deleteEmailTemplatesByJournal($journalId); Index: classes/manager/form/AnnouncementForm.inc.php =================================================================== RCS file: /cvs/ojs2/classes/manager/form/AnnouncementForm.inc.php,v retrieving revision 1.12 diff -u -r1.12 AnnouncementForm.inc.php --- classes/manager/form/AnnouncementForm.inc.php 5 Nov 2008 00:46:40 -0000 1.12 +++ classes/manager/form/AnnouncementForm.inc.php 28 Jan 2009 19:24:25 -0000 @@ -129,6 +129,7 @@ function execute() { $announcementDao = &DAORegistry::getDAO('AnnouncementDAO'); $journal = &Request::getJournal(); + $journalId = $journal->getJournalId(); if (isset($this->announcementId)) { $announcement = &$announcementDao->getAnnouncement($this->announcementId); @@ -138,7 +139,7 @@ $announcement = new Announcement(); } - $announcement->setJournalId($journal->getJournalId()); + $announcement->setJournalId($journalId); $announcement->setTitle($this->getData('title'), null); // Localized $announcement->setDescriptionShort($this->getData('descriptionShort'), null); // Localized $announcement->setDescription($this->getData('description'), null); // Localized @@ -162,6 +163,25 @@ $announcement->setDatetimePosted(Core::getCurrentDate()); $announcementDao->insertAnnouncement($announcement); } + + // 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->getUserId()); + unset($user); + } + $url = Request::url(null, 'announcement', 'view', array(1)); + foreach ($notificationUsers as $user) { + Notification::createNotification($user['id'], "notification.type.newAnnouncement", + null, $url, 1, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT); + } + $notificationDao = &DAORegistry::getDAO('NotificationDAO'); + $notificationDao->sendToMailingList(Notification::createNotification(0, "notification.type.newAnnouncement", + null, $url, 1, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT)); } } Index: classes/notification/Notification.inc.php =================================================================== RCS file: classes/notification/Notification.inc.php diff -N classes/notification/Notification.inc.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ classes/notification/Notification.inc.php 28 Jan 2009 19:24:25 -0000 @@ -0,0 +1,137 @@ +getAssocType()) { + case NOTIFICATION_TYPE_ARTICLE_SUBMITTED: + case NOTIFICATION_TYPE_GALLEY_ADDED: + case NOTIFICATION_TYPE_SUPP_FILE_ADDED: + return $baseUrl . 'page_new.gif'; + break; + case NOTIFICATION_TYPE_SUPP_FILE_MODIFIED: + case NOTIFICATION_TYPE_SUPP_FILE_ADDED: + return $baseUrl . 'page_attachment.gif'; + break; + + case NOTIFICATION_TYPE_METADATA_MODIFIED: + case NOTIFICATION_TYPE_GALLEY_MODIFIED: + return $baseUrl . 'edit.gif'; + break; + case NOTIFICATION_TYPE_SUBMISSION_COMMENT: + case NOTIFICATION_TYPE_LAYOUT_COMMENT: + case NOTIFICATION_TYPE_COPYEDIT_COMMENT: + case NOTIFICATION_TYPE_PROOFREAD_COMMENT: + case NOTIFICATION_TYPE_REVIEWER_COMMENT: + case NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT: + case NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT: + case NOTIFICATION_TYPE_USER_COMMENT: + return $baseUrl . 'comment_new.gif'; + break; + case NOTIFICATION_TYPE_PUBLISHED_ISSUE: + return $baseUrl . 'list_world.gif'; + break; + case NOTIFICATION_TYPE_NEW_ANNOUNCEMENT: + return $baseUrl . 'note_new.gif'; + break; + default: + return $baseUrl . 'page_alert.gif'; + } + } + + /** + * Static function to send an email to a mailing list user regarding signup or a lost password + * @param $email string + * @param $password string the user's password + * @param $template string The mail template to use + */ + function sendMailingListEmail($email, $password, $template) { + import('mail.MailTemplate'); + $journal = Request::getJournal(); + $site = Request::getSite(); + + $params = array( + 'password' => $password, + 'siteTitle' => $journal->getJournalTitle(), + 'unsubscribeLink' => Request::url(null, 'notification', 'unsubscribeMailList') + ); + + if ($template == 'NOTIFICATION_MAILLIST_WELCOME') { + $keyHash = md5($password); + $confirmLink = Request::url(null, 'notification', 'confirmMailListSubscription', array($keyHash, $email)); + $params["confirmLink"] = $confirmLink; + } + + $mail = new MailTemplate($template); + $mail->setFrom($site->getSiteContactEmail(), $site->getSiteContactName()); + $mail->assignParams($params); + $mail->addRecipient($email); + $mail->send(); + } + + /** + * Returns an array of information on the journal's subscription settings + * @return array + */ + function getSubscriptionSettings() { + $journal = Request::getJournal(); + import('payment.ojs.OJSPaymentManager'); + $paymentManager =& OJSPaymentManager::getManager(); + + $settings = array('subscriptionsEnabled' => $paymentManager->acceptSubscriptionPayments(), + 'allowRegReviewer' => $journal->getSetting('allowRegReviewer'), + 'allowRegAuthor' => $journal->getSetting('allowRegAuthor')); + + return $settings; + } + } + +?> Index: classes/notification/form/NotificationSettingsForm.inc.php =================================================================== RCS file: classes/notification/form/NotificationSettingsForm.inc.php diff -N classes/notification/form/NotificationSettingsForm.inc.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ classes/notification/form/NotificationSettingsForm.inc.php 28 Jan 2009 19:24:25 -0000 @@ -0,0 +1,152 @@ +readUserVars( + array('notificationArticleSubmitted', + 'notificationMetadataModified', + 'notificationSuppFileAdded', + 'notificationSuppFileModified', + 'notificationGalleyAdded', + 'notificationGalleyModified', + 'notificationSubmissionComment', + 'notificationLayoutComment', + 'notificationCopyeditComment', + 'notificationProofreadComment', + 'notificationReviewerComment', + 'notificationReviewerFormComment', + 'notificationEditorDecisionComment', + 'notificationPublishedIssue', + 'notificationUserComment', + 'notificationNewAnnouncement', + 'emailNotificationArticleSubmitted', + 'emailNotificationMetadataModified', + 'emailNotificationSuppFileAdded', + 'emailNotificationSuppFileModified', + 'emailNotificationGalleyAdded', + 'emailNotificationGalleyModified', + 'emailNotificationSubmissionComment', + 'emailNotificationLayoutComment', + 'emailNotificationCopyeditComment', + 'emailNotificationProofreadComment', + 'emailNotificationReviewerComment', + 'emailNotificationReviewerFormComment', + 'emailNotificationEditorDecisionComment', + 'emailNotificationPublishedIssue', + 'emailNotificationUserComment', + 'emailNotificationNewAnnouncement') + ); + } + + /** + * Display the form. + */ + function display() { + $journalDao = &DAORegistry::getDAO('JournalDAO'); + $journals = &$journalDao->getJournalTitles(); + + $canOnlyRead = true; + $canOnlyReview = false; + + if (Validation::isReviewer()) { + $canOnlyRead = false; + $canOnlyReview = true; + } + if (Validation::isSiteAdmin() || Validation::isJournalManager() || Validation::isEditor() || + Validation::isSectionEditor() || Validation::isLayoutEditor() || Validation::isCopyeditor() || Validation::isProofreader()) { + $canOnlyRead = false; + $canOnlyReview = false; + } + + $templateMgr = &TemplateManager::getManager(); + $templateMgr->assign('canOnlyRead', $canOnlyRead); + $templateMgr->assign('canOnlyReview', $canOnlyReview); + return parent::display(); + } + + /** + * Save site settings. + */ + function execute() { + $user = Request::getUser(); + $userId = $user->getUserId(); + + // Notification settings + $settings = array(); + if(!$this->getData('notificationArticleSubmitted')) $settings[] = NOTIFICATION_TYPE_ARTICLE_SUBMITTED; + if(!$this->getData('notificationMetadataModified')) $settings[] = NOTIFICATION_TYPE_METADATA_MODIFIED; + if(!$this->getData('notificationSuppFileAdded')) $settings[] = NOTIFICATION_TYPE_SUPP_FILE_ADDED; + if(!$this->getData('notificationSuppFileModified')) $settings[] = NOTIFICATION_TYPE_SUPP_FILE_MODIFIED; + if(!$this->getData('notificationGalleyAdded')) $settings[] = NOTIFICATION_TYPE_GALLEY_ADDED; + if(!$this->getData('notificationGalleyModified')) $settings[] = NOTIFICATION_TYPE_GALLEY_MODIFIED; + if(!$this->getData('notificationSubmissionComment')) $settings[] = NOTIFICATION_TYPE_SUBMISSION_COMMENT; + if(!$this->getData('notificationLayoutComment')) $settings[] = NOTIFICATION_TYPE_LAYOUT_COMMENT; + if(!$this->getData('notificationCopyeditComment')) $settings[] = NOTIFICATION_TYPE_COPYEDIT_COMMENT; + if(!$this->getData('notificationProofreadComment')) $settings[] = NOTIFICATION_TYPE_PROOFREAD_COMMENT; + if(!$this->getData('notificationReviewerComment')) $settings[] = NOTIFICATION_TYPE_REVIEWER_COMMENT; + if(!$this->getData('notificationReviewerFormComment')) $settings[] = NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT; + if(!$this->getData('notificationEditorDecisionComment')) $settings[] = NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT; + if(!$this->getData('notificationPublishedIssue')) $settings[] = NOTIFICATION_TYPE_PUBLISHED_ISSUE; + if(!$this->getData('notificationUserComment')) $settings[] = NOTIFICATION_TYPE_USER_COMMENT; + if(!$this->getData('notificationNewAnnouncement')) $settings[] = NOTIFICATION_TYPE_NEW_ANNOUNCEMENT; + + // Email settings + $emailSettings = array(); + if($this->getData('emailNotificationArticleSubmitted')) $emailSettings[] = NOTIFICATION_TYPE_ARTICLE_SUBMITTED; + if($this->getData('emailNotificationMetadataModified')) $emailSettings[] = NOTIFICATION_TYPE_METADATA_MODIFIED; + if($this->getData('emailNotificationSuppFileAdded')) $emailSettings[] = NOTIFICATION_TYPE_SUPP_FILE_ADDED; + if($this->getData('emailNotificationSuppFileModified')) $emailSettings[] = NOTIFICATION_TYPE_SUPP_FILE_MODIFIED; + if($this->getData('emailNotificationGalleyAdded')) $emailSettings[] = NOTIFICATION_TYPE_GALLEY_ADDED; + if($this->getData('emailNotificationGalleyModified')) $emailSettings[] = NOTIFICATION_TYPE_GALLEY_MODIFIED; + if($this->getData('emailNotificationSubmissionComment')) $emailSettings[] = NOTIFICATION_TYPE_SUBMISSION_COMMENT; + if($this->getData('emailNotificationLayoutComment')) $emailSettings[] = NOTIFICATION_TYPE_LAYOUT_COMMENT; + if($this->getData('emailNotificationCopyeditComment')) $emailSettings[] = NOTIFICATION_TYPE_COPYEDIT_COMMENT; + if($this->getData('emailNotificationProofreadComment')) $emailSettings[] = NOTIFICATION_TYPE_PROOFREAD_COMMENT; + if($this->getData('emailNotificationReviewerComment')) $emailSettings[] = NOTIFICATION_TYPE_REVIEWER_COMMENT; + if($this->getData('emailNotificationReviewerFormComment')) $emailSettings[] = NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT; + if($this->getData('emailNotificationEditorDecisionComment')) $emailSettings[] = NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT; + if($this->getData('emailNotificationPublishedIssue')) $emailSettings[] = NOTIFICATION_TYPE_PUBLISHED_ISSUE; + if($this->getData('emailNotificationUserComment')) $emailSettings[] = NOTIFICATION_TYPE_USER_COMMENT; + if($this->getData('emailNotificationNewAnnouncement')) $emailSettings[] = NOTIFICATION_TYPE_NEW_ANNOUNCEMENT; + + $notificationSettingsDao =& DAORegistry::getDAO('NotificationSettingsDAO'); + $notificationSettingsDao->updateNotificationSettings($settings, $userId); + $notificationSettingsDao->updateNotificationEmailSettings($emailSettings, $userId); + + return true; + } + + +} + +?> Index: classes/site/ImportOJS1.inc.php =================================================================== RCS file: /cvs/ojs2/classes/site/ImportOJS1.inc.php,v retrieving revision 1.59 diff -u -r1.59 ImportOJS1.inc.php --- classes/site/ImportOJS1.inc.php 2 Dec 2008 22:39:42 -0000 1.59 +++ classes/site/ImportOJS1.inc.php 28 Jan 2009 19:24:26 -0000 @@ -555,7 +555,6 @@ $userDao = &DAORegistry::getDAO('UserDAO'); $roleDao = &DAORegistry::getDAO('RoleDAO'); - $notifyDao = &DAORegistry::getDAO('NotificationStatusDAO'); $result = &$this->importDao->retrieve('SELECT *, DECODE(chPassword, ?) AS chPassword FROM tblusers ORDER BY nUserID', $this->journalConfigInfo['chPasswordSalt']); while (!$result->EOF) { @@ -625,14 +624,6 @@ } $userId = $user->getUserId(); - if ($row['bNotify']) { - if ($existingUser) { - // Just in case - $notifyDao->setJournalNotifications($this->journalId, $userId, 0); - } - $notifyDao->setJournalNotifications($this->journalId, $userId, 1); - } - if ($row['fkEditorID']) { $role = new Role(); $role->setJournalId($this->journalId); 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 28 Jan 2009 19:24:26 -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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT); + } + 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(), null, 'copyedit'); + Notification::createNotification($user['id'], "notification.type.copyeditComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT); + } + 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(), null, 'proofread'); + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT); + } + 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 28 Jan 2009 19:24:26 -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(), null, 'metadata'); + Notification::createNotification($user['id'], "notification.type.metadataModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED); + } + // 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(), null, 'editorDecision'); + Notification::createNotification($user['id'], "notification.type.submissionComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUBMISSION_COMMENT); + } + 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 28 Jan 2009 19:24:26 -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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT); + } + 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(), null, 'coypedit'); + Notification::createNotification($user['id'], "notification.type.copyeditComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT); + } + 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 28 Jan 2009 19:24:26 -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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT); + } + 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(), null, 'proofread'); + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT); + } + 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 28 Jan 2009 19:24:27 -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(), null, 'proofread'); + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT); + } + 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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT); + } + 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 28 Jan 2009 19:24:27 -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(), null, 'peerReview'); + Notification::createNotification($user['id'], "notification.type.reviewerComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); + } + 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(), null, 'peerReview'); + Notification::createNotification($user['id'], "notification.type.reviewerFormComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT); + } + } 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 28 Jan 2009 19:24:28 -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(), null, 'peerReview'); + Notification::createNotification($user['id'], "notification.type.reviewerComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); + } + 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(), null, 'editorDecision'); + Notification::createNotification($user['id'], "notification.type.editorDecisionComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT); + } + 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(), null, 'copyedit'); + Notification::createNotification($user['id'], "notification.type.copyeditComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT); + } + 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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.layoutComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT); + } + 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(), null, 'proofread'); + Notification::createNotification($user['id'], "notification.type.proofreadComment", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT); + } + if ($emailComment) { $commentForm->email(); } Index: classes/user/form/ProfileForm.inc.php =================================================================== RCS file: /cvs/ojs2/classes/user/form/ProfileForm.inc.php,v retrieving revision 1.35 diff -u -r1.35 ProfileForm.inc.php --- classes/user/form/ProfileForm.inc.php 5 Nov 2008 00:46:40 -0000 1.35 +++ classes/user/form/ProfileForm.inc.php 28 Jan 2009 19:24:28 -0000 @@ -108,7 +108,6 @@ $roleDao = &DAORegistry::getDAO('RoleDAO'); $journalDao = &DAORegistry::getDAO('JournalDAO'); - $notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO'); $userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO'); $journals = &$journalDao->getJournals(); @@ -124,7 +123,6 @@ $journals = &$journalDao->getJournals(); $journals = &$journals->toArray(); - $journalNotifications = &$notificationStatusDao->getJournalNotifications($user->getUserId()); $countryDao =& DAORegistry::getDAO('CountryDAO'); $countries =& $countryDao->getCountries(); @@ -257,7 +255,6 @@ $roleDao = &DAORegistry::getDAO('RoleDAO'); $journalDao = &DAORegistry::getDAO('JournalDAO'); - $notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO'); // Roles $journal =& Request::getJournal(); @@ -288,21 +285,6 @@ } } - $journals = &$journalDao->getJournals(); - $journals = &$journals->toArray(); - $journalNotifications = $notificationStatusDao->getJournalNotifications($user->getUserId()); - - $readerNotify = Request::getUserVar('journalNotify'); - - foreach ($journals as $thisJournal) { - $thisJournalId = $thisJournal->getJournalId(); - $currentlyReceives = !empty($journalNotifications[$thisJournalId]); - $shouldReceive = !empty($readerNotify) && in_array($thisJournal->getJournalId(), $readerNotify); - if ($currentlyReceives != $shouldReceive) { - $notificationStatusDao->setJournalNotifications($thisJournalId, $user->getUserId(), $shouldReceive); - } - } - $openAccessNotify = Request::getUserVar('openAccessNotify'); $userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO'); Index: classes/user/form/RegistrationForm.inc.php =================================================================== RCS file: /cvs/ojs2/classes/user/form/RegistrationForm.inc.php,v retrieving revision 1.51 diff -u -r1.51 RegistrationForm.inc.php --- classes/user/form/RegistrationForm.inc.php 5 Nov 2008 00:46:40 -0000 1.51 +++ classes/user/form/RegistrationForm.inc.php 28 Jan 2009 19:24:28 -0000 @@ -320,16 +320,6 @@ } } - // By default, self-registering readers will receive - // journal updates. (The double set is here to prevent a - // duplicate insert error msg if there was a notification entry - // left over from a previous role.) - if (isset($allowedRoles['reader']) && $this->getData($allowedRoles['reader'])) { - $notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO'); - $notificationStatusDao->setJournalNotifications($journal->getJournalId(), $userId, false); - $notificationStatusDao->setJournalNotifications($journal->getJournalId(), $userId, true); - } - if (isset($allowedRoles['reader']) && $this->getData('openAccessNotification')) { $userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO'); $userSettingsDao->updateSetting($userId, 'openAccessNotification', true, 'bool', $journal->getJournalId()); Index: dbscripts/xml/ojs_schema.xml =================================================================== RCS file: /cvs/ojs2/dbscripts/xml/ojs_schema.xml,v retrieving revision 1.172 diff -u -r1.172 ojs_schema.xml --- dbscripts/xml/ojs_schema.xml 27 Oct 2008 16:00:58 -0000 1.172 +++ dbscripts/xml/ojs_schema.xml 28 Jan 2009 19:24:28 -0000 @@ -306,22 +306,6 @@ - - - - - - - - - User "mail notifications to my account" flags - - journal_id - user_id - - -
- + 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 28 Jan 2009 19:24:29 -0000 @@ -22,6 +22,57 @@ * --> + NOTIFICATION + New notification from {$siteTitle} + 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 from {$siteTitle} + 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}. + +Please click on this link to confirm your request and add your email address to the mailing list: {$confirmLink} + +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 for {$siteTitle} + 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: dbscripts/xml/upgrade/2.3.0_update.xml =================================================================== RCS file: /cvs/ojs2/dbscripts/xml/upgrade/2.3.0_update.xml,v retrieving revision 1.1 diff -u -r1.1 2.3.0_update.xml --- dbscripts/xml/upgrade/2.3.0_update.xml 9 Dec 2008 17:44:03 -0000 1.1 +++ dbscripts/xml/upgrade/2.3.0_update.xml 28 Jan 2009 19:24:29 -0000 @@ -23,4 +23,8 @@ INSERT INTO email_templates_default_data (locale, email_key, subject, body, description) VALUES ('en_US', 'EDITOR_DECISION_RESUBMIT', 'Editor Decision', '{$authorName}:\n\nWe have reached a decision regarding your submission to {$journalTitle}, \"{$articleTitle}\".\n\nOur decision is to:\n\n{$editorialContactSignature}\n', 'This email from the Editor or Section Editor to an Author notifies them of a final decision regarding their submission.') INSERT INTO email_templates_default_data (locale, email_key, subject, body, description) VALUES ('en_US', 'EDITOR_DECISION_DECLINE', 'Editor Decision', '{$authorName}:\n\nWe have reached a decision regarding your submission to {$journalTitle}, \"{$articleTitle}\".\n\nOur decision is to:\n\n{$editorialContactSignature}\n', 'This email from the Editor or Section Editor to an Author notifies them of a final decision regarding their submission.') + + + + Index: pages/about/AboutHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/about/AboutHandler.inc.php,v retrieving revision 1.50 diff -u -r1.50 AboutHandler.inc.php --- pages/about/AboutHandler.inc.php 16 Oct 2008 18:02:28 -0000 1.50 +++ pages/about/AboutHandler.inc.php 28 Jan 2009 19:24:30 -0000 @@ -556,10 +556,6 @@ $templateMgr->assign('subscriptionStatistics', $subscriptionStatistics); } - $notificationStatusDao =& DAORegistry::getDAO('NotificationStatusDAO'); - $notifiableUsers = $notificationStatusDao->getNotifiableUsersCount($journal->getJournalId()); - $templateMgr->assign('notifiableUsers', $notifiableUsers); - $templateMgr->display('about/statistics.tpl'); } 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 28 Jan 2009 19:24:30 -0000 @@ -77,6 +77,7 @@ if ($settingsForm->validate()) { PluginRegistry::loadCategory('blocks'); $settingsForm->execute(); + Request::redirect(null, null, 'journals'); } else { Index: pages/admin/AdminPeopleHandler.inc.php =================================================================== RCS file: /cvs/ojs2/pages/admin/AdminPeopleHandler.inc.php,v retrieving revision 1.8 diff -u -r1.8 AdminPeopleHandler.inc.php --- pages/admin/AdminPeopleHandler.inc.php 16 Oct 2008 18:02:27 -0000 1.8 +++ pages/admin/AdminPeopleHandler.inc.php 28 Jan 2009 19:24:30 -0000 @@ -125,8 +125,6 @@ $subscriptionDao->deleteSubscriptionsByUserId($oldUserId); $temporaryFileDao =& DAORegistry::getDAO('TemporaryFileDAO'); $temporaryFileDao->deleteTemporaryFilesByUserId($oldUserId); - $notificationStatusDao =& DAORegistry::getDAO('NotificationStatusDAO'); - $notificationStatusDao->deleteNotificationStatusByUserId($oldUserId); $userSettingsDao =& DAORegistry::getDAO('UserSettingsDAO'); $userSettingsDao->deleteSettings($oldUserId); $groupMembershipDao =& DAORegistry::getDAO('GroupMembershipDAO'); 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 28 Jan 2009 19:24:30 -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 28 Jan 2009 19:24:30 -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); + } + $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 28 Jan 2009 19:24:30 -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); + } + 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 28 Jan 2009 19:24:30 -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->getUserId()); + 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); + } + $notificationDao = &DAORegistry::getDAO('NotificationDAO'); + $notificationDao->sendToMailingList(Notification::createNotification(0, "notification.type.issuePublished", + null, $url, 1, NOTIFICATION_TYPE_PUBLISHED_ISSUE)); + Request::redirect(null, null, 'issueToc', $issue->getIssueId()); } @@ -550,7 +568,6 @@ $userDao = &DAORegistry::getDAO('UserDAO'); $issueDao = &DAORegistry::getDAO('IssueDAO'); - $notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO'); $roleDao = &DAORegistry::getDAO('RoleDAO'); $journal = &Request::getJournal(); @@ -563,11 +580,8 @@ if (Request::getUserVar('send') && !$email->hasErrors()) { $email->addRecipient($user->getEmail(), $user->getFullName()); - if (Request::getUserVar('whichUsers') == 'allUsers') { - $recipients = $roleDao->getUsersByJournalId($journal->getJournalId()); - } else { - $recipients = $notificationStatusDao->getNotifiableUsersByJournalId($journal->getJournalId()); - } + $recipients = $roleDao->getUsersByJournalId($journal->getJournalId()); + while (!$recipients->eof()) { $recipient = &$recipients->next(); $email->addRecipient($recipient->getEmail(), $recipient->getFullName()); @@ -610,7 +624,6 @@ 'editorialContactSignature' => $user->getContactSignature() )); } - $notifiableCount = $notificationStatusDao->getNotifiableUsersCount($journal->getJournalId()); $allUsersCount = $roleDao->getJournalUsersCount($journal->getJournalId()); $issuesIterator = &$issueDao->getIssues($journal->getJournalId()); @@ -621,7 +634,6 @@ 'editor/notifyUsers.tpl', array( 'issues' => $issuesIterator, - 'notifiableCount' => $notifiableCount, 'allUsersCount' => $allUsersCount ) ); 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 28 Jan 2009 19:24:31 -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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.galleyModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_MODIFIED); + } + 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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.suppFileModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED); + } + 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 28 Jan 2009 19:24:31 -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 28 Jan 2009 19:24:32 -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 28 Jan 2009 19:24:32 -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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.suppFileModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED); + } + 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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.galleyAdded", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_ADDED); + } + 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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.galleyModified", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_GALLEY_MODIFIED); + } + 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(), null, 'layout'); + Notification::createNotification($user['id'], "notification.type.suppFileAdded", + $article->getArticleTitle(), $url, 1, NOTIFICATION_TYPE_SUPP_FILE_ADDED); + } + 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 28 Jan 2009 19:24:33 -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 28 Jan 2009 19:24:34 -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 28 Jan 2009 19:24:34 -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/editor/notifyUsers.tpl =================================================================== RCS file: /cvs/ojs2/templates/editor/notifyUsers.tpl,v retrieving revision 1.15 diff -u -r1.15 notifyUsers.tpl --- templates/editor/notifyUsers.tpl 11 Aug 2008 21:35:35 -0000 1.15 +++ templates/editor/notifyUsers.tpl 28 Jan 2009 19:24:34 -0000 @@ -41,28 +41,6 @@
{/if} -

{translate key="email.recipients"}

- - - - - - - - - -
- - - -
- - - -
- -
-

{translate key="issue.issue"}

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 28 Jan 2009 19:24:34 -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 28 Jan 2009 19:24:34 -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} Index: templates/notification/maillist.tpl =================================================================== RCS file: templates/notification/maillist.tpl diff -N templates/notification/maillist.tpl --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/notification/maillist.tpl 28 Jan 2009 19:24:34 -0000 @@ -0,0 +1,97 @@ +{** + * index.tpl + * + * Copyright (c) 2000-2008 John Willinsky + * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. + * + * Displays the notification settings page and unchecks + * + *} +{strip} +{assign var="pageTitle" value="notification.mailList"} +{include file="common/header.tpl"} +{/strip} + +{if $new} +

{translate key="notification.mailListDescription"}

+
+ + {if $error} +

{translate key="$error"}

+ {/if} + + {if $success} +

{translate key="$success"}

+ {/if} + +
+ +
+ + + + + + + + +
{translate key="email.email"}
 

+ +
{translate key="notification.mailList.register"}
+
    + {if $settings.allowRegReviewer} + {url|assign:"url" page="user" op="register"} +
  • » {translate key="notification.mailList.review" reviewUrl=$url}
  • + {/if} + {if $settings.allowRegAuthor} + {url|assign:"url" page="information" op="authors"} +
  • » {translate key="notification.mailList.submit" submitUrl=$url}
  • + {/if} + {if $settings.subscriptionsEnabled} + {url|assign:"url" page="user" op="register"} +
  • » {translate key="notification.mailList.protectedContent" subscribeUrl=$url} + {/if} +
  • » {translate key="about.privacyStatement"}
  • +
      +{elseif $remove} +

      {translate key="notification.unsubscribeDescription"}

      +
      + + {if $error} +

      {translate key="$error"}

      + {/if} + + {if $success} +

      {translate key="$success"}

      + {/if} + +
      + + + + + + + + + + + + + +
      {translate key="email.email"}
      {translate key="user.password"}
       

      + +
      +{elseif $confirm} + {if $error} +

      {translate key="$error"}

      + {/if} + + {if $success} +

      {translate key="$success"}

      + {/if} +{/if} + + + +{include file="common/footer.tpl"} Index: templates/notification/settings.tpl =================================================================== RCS file: templates/notification/settings.tpl diff -N templates/notification/settings.tpl --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/notification/settings.tpl 28 Jan 2009 19:24:34 -0000 @@ -0,0 +1,272 @@ +{** + * index.tpl + * + * Copyright (c) 2000-2008 John Willinsky + * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. + * + * Displays the notification settings page and unchecks + * + *} +{strip} +{assign var="pageTitle" value="notification.settings"} +{include file="common/header.tpl"} +{/strip} + +

      {translate key="notification.settingsDescription"}

      + +
      + + +{if !$canOnlyRead && !$canOnlyReview} +

      {translate key="notification.type.submissions"}

      + +
        +
      • {translate key="notification.type.articleSubmitted" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.metadataModified" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.suppFileAdded" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.suppFileModified" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
      + +{if !$canOnlyRead} + +

      {translate key="notification.type.reviewing"}

      + + +
        +
      • {translate key="notification.type.reviewerComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.reviewerFormComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.editorDecisionComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
      +{/if} + + +

      {translate key="notification.type.editing"}

      + +
        +
      • {translate key="notification.type.galleyAdded" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.galleyModified" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.submissionComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.layoutComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.copyeditComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.proofreadComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
      +{/if} + + +

      {translate key="notification.type.site"}

      + +
        +
      • {translate key="notification.type.userComment" param=$titleVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.issuePublished" param=$userVar}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
        +
      • {translate key="notification.type.newAnnouncement"}
      • +
          +
        • + + {translate key="notification.allow"} +
        • +
        • + + {translate key="notification.email"} +
        • +
        +
      + +
      + +

      + +
      + +{include file="common/footer.tpl"} Index: templates/user/profile.tpl =================================================================== RCS file: /cvs/ojs2/templates/user/profile.tpl,v retrieving revision 1.41 diff -u -r1.41 profile.tpl --- templates/user/profile.tpl 12 Aug 2008 22:19:24 -0000 1.41 +++ templates/user/profile.tpl 28 Jan 2009 19:24:34 -0000 @@ -139,24 +139,6 @@ {/if} -{foreach from=$journals name=journalNotifications key=thisJournalId item=thisJournal} - {assign var=thisJournalId value=$thisJournal->getJournalId()} - {assign var=notificationEnabled value=`$journalNotifications.$thisJournalId`} - {if !$notFirstJournal} - {assign var=notFirstJournal value=1} - - {translate key="user.profile.form.publishedNotifications"} - - {/if} - -
      - - {if $smarty.foreach.journalNotifications.last} - - - {/if} -{/foreach} - {if $displayOpenAccessNotification} {assign var=notFirstJournal value=0} {foreach from=$journals name=journalOpenAccessNotifications key=thisJournalId item=thisJournal}