From 1c87d5856aa6eb7c6cae97d412f09338d8ffe995 Mon Sep 17 00:00:00 2001 From: Matthew Crider Date: Fri, 3 Sep 2010 10:22:57 -0700 Subject: [PATCH] *5557* Cleaned up getAssociatedUserIds() function --- classes/monograph/Monograph.inc.php | 87 ++++++------------- classes/submission/common/Action.inc.php | 2 +- .../copyeditor/CopyeditorAction.inc.php | 64 +++++++------- .../designer/DesignerAction.inc.php | 16 ++-- .../form/comment/EditCommentForm.inc.php | 2 +- .../comment/EditorDecisionCommentForm.inc.php | 2 +- .../form/comment/LayoutCommentForm.inc.php | 2 +- .../form/comment/ProofreadCommentForm.inc.php | 2 +- .../proofreader/ProofreaderAction.inc.php | 28 +++--- .../seriesEditor/SeriesEditorAction.inc.php | 8 +- .../NotifyUsersListbuilderHandler.inc.php | 2 +- .../SubmissionEditHandler.inc.php | 2 +- 12 files changed, 92 insertions(+), 125 deletions(-) diff --git a/classes/monograph/Monograph.inc.php b/classes/monograph/Monograph.inc.php index dead8eb3d25..12b4d36e041 100755 --- a/classes/monograph/Monograph.inc.php +++ b/classes/monograph/Monograph.inc.php @@ -275,83 +275,50 @@ function getSignoff($signoffType) { /** * Get an array of user IDs associated with this monograph - * @param $authors boolean - * @param $reviewers boolean - * @param $editors boolean - * @param $proofreader boolean - * @param $copyeditor boolean - * @param $layoutEditor boolean + * @param $includeReviewers boolean Include reviewers in the array + * @param $userGroupIds array Only look up the user group IDs in the array * @return array User IDs */ - function getAssociatedUserIds($authors = true, $reviewers = true, $editors = true, $seriesEditors = true, $proofreader = true, $copyeditor = true, $layoutEditor = true) { - // FIXME #5557: We should just use an array for the third parameter containing all editor role IDs, then iterate over them + function getAssociatedUserIds($includeReviewers = false, $userGroupIds = null) { $monographId = $this->getId(); $signoffDao =& DAORegistry::getDAO('SignoffDAO'); + $userGroupDao =& DAORegistry::getDAO('UserGroupDAO'); $userIds = array(); - if($authors) { - $userId = $this->getUserId(); - if ($userId) $userIds[] = array('id' => $userId, 'role' => 'author'); + // If $userGroupIds is set, iterate through them, adding getUsers to array (with keys as userId) + if (is_array($userGroupIds)) { + foreach($userGroupIds as $userGroupId) { + $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $userGroupId); + while ($user =& $users->next()) { + $userId = $user->getUserId(); + if ($userId) $userIds[$userId] = array('id' => $userId); + unset($user); + } + unset($users); + } + } else { + $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId); + + while ($user =& $users->next()) { + $userId = $user->getUserId(); + if ($userId) $userIds[$userId] = array('id' => $userId); + unset($user); + } + } - if($reviewers) { + // Get reviewers if necessary + if($includeReviewers) { $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignments =& $reviewAssignmentDao->getBySubmissionId($monographId); foreach ($reviewAssignments as $reviewAssignment) { $userId = $reviewAssignment->getReviewerId(); - if ($userId) $userIds[] = array('id' => $userId, 'role' => 'reviewer'); + if ($userId) $userIds[$userId] = array('id' => $userId, 'role' => 'reviewer'); unset($reviewAssignment); } } - $userGroupDao =& DAORegistry::getDAO('UserGroupDAO'); - - if($editors) { - $signoffDao =& DAORegistry::getDAO('SignoffDAO'); - $userGroupId = $userGroupDao->getByRoleId($this->getPressId(), ROLE_ID_EDITOR); - $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $userGroupId); - while ($user =& $users->next()) { - $userId = $user->getUserId(); - if ($userId) $userIds[] = array('id' => $userId, 'role' => 'editor'); - unset($user); - } - } - - if($seriesEditor) { - $signoffDao =& DAORegistry::getDAO('SignoffDAO'); - $userGroupId = $userGroupDao->getByRoleId($this->getPressId(), ROLE_ID_SERIES_EDITOR); - $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $userGroupId); - while ($user =& $users->next()) { - $userId = $user->getUserId(); - if ($userId) $userIds[] = array('id' => $userId, 'role' => 'editor'); - unset($user); - } - } - - if($copyeditor) { - $signoffDao =& DAORegistry::getDAO('SignoffDAO'); - $userGroupId = $userGroupDao->getByRoleId($this->getPressId(), ROLE_ID_COPYEDITOR); - $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $userGroupId); - while ($user =& $users->next()) { - $userId = $user->getUserId(); - if ($userId) $userIds[] = array('id' => $userId, 'role' => 'editor'); - unset($user); - } - } - - - if($proofreader) { - $signoffDao =& DAORegistry::getDAO('SignoffDAO'); - $userGroupId = $userGroupDao->getByRoleId($this->getPressId(), ROLE_ID_PROOFREADER); - $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $userGroupId); - while ($user =& $users->next()) { - $userId = $user->getUserId(); - if ($userId) $userIds[] = array('id' => $userId, 'role' => 'editor'); - unset($user); - } - } - return $userIds; } diff --git a/classes/submission/common/Action.inc.php b/classes/submission/common/Action.inc.php index 32b74a61aff..ce8579085c8 100644 --- a/classes/submission/common/Action.inc.php +++ b/classes/submission/common/Action.inc.php @@ -210,7 +210,7 @@ function saveComment($monograph, &$comment, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionReview', $monograph->getId(), null, 'editorDecision'); diff --git a/classes/submission/copyeditor/CopyeditorAction.inc.php b/classes/submission/copyeditor/CopyeditorAction.inc.php index 7bf9f603f3a..69d8fccc239 100755 --- a/classes/submission/copyeditor/CopyeditorAction.inc.php +++ b/classes/submission/copyeditor/CopyeditorAction.inc.php @@ -54,25 +54,25 @@ function completeCopyedit($copyeditorSubmission, $send = false) { } $initialSignoff->setDateCompleted(Core::getCurrentDate()); - + $authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_MONOGRAPH, $copyeditorSubmission->getId()); $authorSignoff->setUserId($author->getId()); $authorSignoff->setDateNotified(Core::getCurrentDate()); $signoffDao->updateObject($initialSignoff); $signoffDao->updateObject($authorSignoff); - + // Add log entry import('classes.monograph.log.MonographLog'); import('classes.monograph.log.MonographEventLogEntry'); MonographLog::logEvent( - $copyeditorSubmission->getId(), - MONOGRAPH_LOG_COPYEDIT_INITIAL, - MONOGRAPH_LOG_TYPE_COPYEDIT, $user->getId(), - 'log.copyedit.initialEditComplete', + $copyeditorSubmission->getId(), + MONOGRAPH_LOG_COPYEDIT_INITIAL, + MONOGRAPH_LOG_TYPE_COPYEDIT, $user->getId(), + 'log.copyedit.initialEditComplete', Array( - 'copyeditorName' => $user->getFullName(), + 'copyeditorName' => $user->getFullName(), 'monographId' => $copyeditorSubmission->getId() ) ); @@ -184,9 +184,9 @@ function completeFinalCopyedit($copyeditorSubmission, $send = false) { */ function copyeditUnderway(&$copyeditorSubmission) { if (!HookRegistry::call('CopyeditorAction::copyeditUnderway', array(&$copyeditorSubmission))) { - $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO'); + $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO'); $signoffDao =& DAORegistry::getDAO('SignoffDAO'); - + $initialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_MONOGRAPH, $copyeditorSubmission->getId()); $finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_MONOGRAPH, $copyeditorSubmission->getId()); @@ -208,18 +208,18 @@ function copyeditUnderway(&$copyeditorSubmission) { import('classes.monograph.log.MonographEventLogEntry'); MonographLog::logEvent( - $copyeditorSubmission->getId(), - MONOGRAPH_LOG_COPYEDIT_INITIATE, - MONOGRAPH_LOG_TYPE_COPYEDIT, - $user->getId(), 'log.copyedit.initiate', + $copyeditorSubmission->getId(), + MONOGRAPH_LOG_COPYEDIT_INITIATE, + MONOGRAPH_LOG_TYPE_COPYEDIT, + $user->getId(), 'log.copyedit.initiate', Array( - 'copyeditorName' => $user->getFullName(), + 'copyeditorName' => $user->getFullName(), 'monographId' => $copyeditorSubmission->getId() ) ); } } - } + } /** * Upload the copyedited version of a monograph. @@ -228,7 +228,7 @@ function copyeditUnderway(&$copyeditorSubmission) { function uploadCopyeditVersion($copyeditorSubmission, $copyeditStage) { import('classes.file.MonographFileManager'); $monographFileDao =& DAORegistry::getDAO('MonographFileDAO'); - $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO'); + $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO'); $signoffDao =& DAORegistry::getDAO('SignoffDAO'); if($copyeditStage == 'initial') { @@ -276,8 +276,8 @@ function uploadCopyeditVersion($copyeditorSubmission, $copyeditStage) { MonographLog::logEventEntry($copyeditorSubmission->getId(), $entry); } - - + + } // @@ -314,17 +314,17 @@ function postLayoutComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'layout'); $notificationManager->createNotification( - $userRole['id'], "notification.type.layoutComment", - $monograph->getLocalizedTitle(), $url, 1, + $userRole['id'], "notification.type.layoutComment", + $monograph->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT ); } - + if ($emailComment) { $commentForm->email(); } @@ -352,7 +352,7 @@ function viewCopyeditComments($monograph) { } /** - * Post copyedit comment. + * Post copyedit comment. * @param $monograph object */ function postCopyeditComment($monograph, $emailComment) { @@ -367,18 +367,18 @@ function postCopyeditComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'coypedit'); $notificationManager->createNotification( - $userRole['id'], - 'notification.type.copyeditComment', - $monograph->getLocalizedTitle(), + $userRole['id'], + 'notification.type.copyeditComment', + $monograph->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT ); } - + if ($emailComment) { $commentForm->email(); } @@ -402,7 +402,7 @@ function postCopyeditComment($monograph, $emailComment) { * @param $revision int */ function downloadCopyeditorFile($submission, $fileId, $revision = null) { - $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO'); + $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO'); $canDownload = false; @@ -413,17 +413,17 @@ function downloadCopyeditorFile($submission, $fileId, $revision = null) { // 4) The final copyedit revision // 5) Layout galleys if ($submission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true) == $fileId) { - $monographFileDao =& DAORegistry::getDAO('MonographFileDAO'); + $monographFileDao =& DAORegistry::getDAO('MonographFileDAO'); $currentRevision =& $monographFileDao->getRevisionNumber($fileId); if ($revision == null) { $revision = $currentRevision; } - + $initialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_MONOGRAPH, $authorSubmission->getMonographId()); $authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_MONOGRAPH, $authorSubmission->getMonographId()); $finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_MONOGRAPH, $authorSubmission->getMonographId()); - + if ($revision == 1) { $canDownload = true; } else if ($initialSignoff->getFileRevision() == $revision) { diff --git a/classes/submission/designer/DesignerAction.inc.php b/classes/submission/designer/DesignerAction.inc.php index 093d66fed7b..b1805f4f8fc 100644 --- a/classes/submission/designer/DesignerAction.inc.php +++ b/classes/submission/designer/DesignerAction.inc.php @@ -3,7 +3,7 @@ /** * @defgroup submission_designer_DesignerAction */ - + /** * @file classes/submission/designer/DesignerAction.inc.php * @@ -44,7 +44,7 @@ function selectDesigner($userId, $assignmentId, $submission) { $designer =& $userDao->getUser($designSignoff->getUserId()); MonographLog::logEvent($submission->getId(), MONOGRAPH_LOG_LAYOUT_UNASSIGN, MONOGRAPH_LOG_TYPE_LAYOUT, $designSignoff->getId(), 'log.layout.layoutEditorUnassigned', array('editorName' => $designer->getFullName(), 'monographId' => $submission->getId())); } - + $designSignoff->setUserId($userId); $signoffDao->updateObject($designSignoff); @@ -213,10 +213,10 @@ function postLayoutComment($monograph, $emailComment) { if ($commentForm->validate()) { $commentForm->execute(); - + // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'layout'); @@ -225,7 +225,7 @@ function postLayoutComment($monograph, $emailComment) { $monograph->getMonographTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT ); } - + if ($emailComment) { $commentForm->email(); } @@ -265,10 +265,10 @@ function postProofreadComment($monograph, $emailComment) { if ($commentForm->validate()) { $commentForm->execute(); - + // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'proofread'); @@ -277,7 +277,7 @@ function postProofreadComment($monograph, $emailComment) { $monograph->getMonographTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT ); } - + if ($emailComment) { $commentForm->email(); } diff --git a/classes/submission/form/comment/EditCommentForm.inc.php b/classes/submission/form/comment/EditCommentForm.inc.php index 668932eaf1a..d7f11325030 100644 --- a/classes/submission/form/comment/EditCommentForm.inc.php +++ b/classes/submission/form/comment/EditCommentForm.inc.php @@ -123,7 +123,7 @@ function emailHelper() { $recipients = array(); // Get editors for monograph - // FIXME #5557: Get IDs from Monograph->getAssociatedUserIds + // FIXME #5880: Get IDs from Monograph->getAssociatedUserIds, or remove this class if not needed $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); $editAssignments =& $editAssignmentDao->getByIdsByMonographId($this->monograph->getId()); $editAssignments =& $editAssignments->toArray(); diff --git a/classes/submission/form/comment/EditorDecisionCommentForm.inc.php b/classes/submission/form/comment/EditorDecisionCommentForm.inc.php index 0bd26583c45..b54730120e7 100644 --- a/classes/submission/form/comment/EditorDecisionCommentForm.inc.php +++ b/classes/submission/form/comment/EditorDecisionCommentForm.inc.php @@ -87,7 +87,7 @@ function email() { if ($user) $recipients = array_merge($recipients, array($user->getEmail() => $user->getFullName())); } else { // Then add editor - // FIXME #5557: Get IDs from Monograph->getAssociatedUserIds + // FIXME #5880: Get IDs from Monograph->getAssociatedUserIds, or remove this class if not needed $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); $editAssignments =& $editAssignmentDao->getByIdsByMonographId($this->monograph->getMonographId()); $editorAddresses = array(); diff --git a/classes/submission/form/comment/LayoutCommentForm.inc.php b/classes/submission/form/comment/LayoutCommentForm.inc.php index f46f54e3b2a..024562367e5 100644 --- a/classes/submission/form/comment/LayoutCommentForm.inc.php +++ b/classes/submission/form/comment/LayoutCommentForm.inc.php @@ -85,7 +85,7 @@ function email() { } } else { // Then add editor - // FIXME #5557: Get IDs from Monograph->getAssociatedUserIds + // FIXME #5880: Get IDs from Monograph->getAssociatedUserIds, or remove this class if not needed $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); $editAssignments =& $editAssignmentDao->getByIdsByMonographId($this->monograph->getId()); $editorAddresses = array(); diff --git a/classes/submission/form/comment/ProofreadCommentForm.inc.php b/classes/submission/form/comment/ProofreadCommentForm.inc.php index 57016e08d70..fc836ee3c46 100644 --- a/classes/submission/form/comment/ProofreadCommentForm.inc.php +++ b/classes/submission/form/comment/ProofreadCommentForm.inc.php @@ -73,7 +73,7 @@ function email() { // excluding whomever posted the comment. // Get editors - // FIXME #5557: Get IDs from Monograph->getAssociatedUserIds + // FIXME #5880: Get IDs from Monograph->getAssociatedUserIds, or remove this class if not needed $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); $editAssignments =& $editAssignmentDao->getByIdsByMonographId($this->monograph->getId()); $editorAddresses = array(); diff --git a/classes/submission/proofreader/ProofreaderAction.inc.php b/classes/submission/proofreader/ProofreaderAction.inc.php index e9b727fee9e..f699d1f5a02 100644 --- a/classes/submission/proofreader/ProofreaderAction.inc.php +++ b/classes/submission/proofreader/ProofreaderAction.inc.php @@ -3,7 +3,7 @@ /** * @defgroup submission_proofreader_ProofreaderAction */ - + /** * @file classes/submission/proofreader/ProofreaderAction.inc.php * @@ -162,7 +162,7 @@ function proofreadEmail($monographId, $assignmentId, $mailType, $actionPath = '' $signoffType = 'SIGNOFF_PROOFREADING_PROOFREADER'; $setDateField = 'setDateNotified'; $nullifyDateFields = array('setDateUnderway', 'setDateCompleted', 'setDateAcknowledged'); - + $receiver = $submission->getUserBySignoffType($signoffType); if (!isset($receiver)) return true; $receiverName = $receiver->getFullName(); @@ -183,7 +183,7 @@ function proofreadEmail($monographId, $assignmentId, $mailType, $actionPath = '' $assocType = MONOGRAPH_EMAIL_TYPE_PROOFREAD; $signoffType = 'SIGNOFF_PROOFREADING_PROOFREADER'; $setDateField = 'setDateAcknowledged'; - + $receiver = $submission->getUserBySignoffType($signoffType); if (!isset($receiver)) return true; $receiverName = $receiver->getFullName(); @@ -202,7 +202,7 @@ function proofreadEmail($monographId, $assignmentId, $mailType, $actionPath = '' $signoffType = 'SIGNOFF_PROOFREADING_PROOFREADER'; $setDateField = 'setDateCompleted'; $getDateField = 'getDateCompleted'; - + $setNextDateField = 'setDateNotified'; $nextSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_MONOGRAPH, $monographId); @@ -278,7 +278,7 @@ function proofreadEmail($monographId, $assignmentId, $mailType, $actionPath = '' $addParamArray = array( 'layoutEditorName' => $receiverName, - 'editorialContactSignature' => $user->getContactSignature() + 'editorialContactSignature' => $user->getContactSignature() ); break; @@ -315,13 +315,13 @@ function proofreadEmail($monographId, $assignmentId, $mailType, $actionPath = '' break; default: - return true; + return true; } $signoff = $signoffDao->build($signoffType, ASSOC_TYPE_PRODUCTION_ASSIGNMENT, $assignmentId); if (isset($getDateField)) { - $date = $signoff->$getDateField(); + $date = $signoff->$getDateField(); if (isset($date)) { Request::redirect(null, null, 'submission', $monographId); } @@ -357,10 +357,10 @@ function proofreadEmail($monographId, $assignmentId, $mailType, $actionPath = '' if (isset($nullifyDateFields)) foreach ($nullifyDateFields as $fieldSetter) { $signoff->$fieldSetter(null); } - + $signoffDao->updateObject($signoff); if(isset($nextSignoff)) $signoffDao->updateObject($nextSignoff); - + return true; } @@ -446,7 +446,7 @@ function postProofreadComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'proofread'); @@ -455,7 +455,7 @@ function postProofreadComment($monograph, $emailComment) { $monograph->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT ); } - + if ($emailComment) { $commentForm->email(); } @@ -496,10 +496,10 @@ function postLayoutComment($monograph, $emailComment) { if ($commentForm->validate()) { $commentForm->execute(); - + // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); $notificationManager = new NotificationManager(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'layout'); @@ -508,7 +508,7 @@ function postLayoutComment($monograph, $emailComment) { $monograph->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT ); } - + if ($emailComment) { $commentForm->email(); } diff --git a/classes/submission/seriesEditor/SeriesEditorAction.inc.php b/classes/submission/seriesEditor/SeriesEditorAction.inc.php index 71955168033..c61bade952b 100644 --- a/classes/submission/seriesEditor/SeriesEditorAction.inc.php +++ b/classes/submission/seriesEditor/SeriesEditorAction.inc.php @@ -1818,7 +1818,7 @@ function postEditorDecisionComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionReview', $monograph->getId(), null, 'editorDecision'); $notificationManager->createNotification( @@ -2085,7 +2085,7 @@ function postCopyeditComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'copyedit'); $notificationManager->createNotification( @@ -2138,7 +2138,7 @@ function postLayoutComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'layout'); $notificationManager->createNotification( @@ -2191,7 +2191,7 @@ function postProofreadComment($monograph, $emailComment) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'proofread'); $notificationManager->createNotification( diff --git a/controllers/listbuilder/users/NotifyUsersListbuilderHandler.inc.php b/controllers/listbuilder/users/NotifyUsersListbuilderHandler.inc.php index 407a36932ec..b82c8ed8599 100644 --- a/controllers/listbuilder/users/NotifyUsersListbuilderHandler.inc.php +++ b/controllers/listbuilder/users/NotifyUsersListbuilderHandler.inc.php @@ -127,7 +127,7 @@ function loadPossibleItemList(&$request) { // Retrieve all users associated with the monograph to populate the drop-down list with $monographDao =& DAORegistry::getDAO('MonographDAO'); $monograph =& $monographDao->getMonograph($monographId); - $associatedUsers = $monograph->getAssociatedUserIds(true, false); + $associatedUsers = $monograph->getAssociatedUserIds(); $userDao =& DAORegistry::getDAO('UserDAO'); $itemList = array(); diff --git a/pages/seriesEditor/SubmissionEditHandler.inc.php b/pages/seriesEditor/SubmissionEditHandler.inc.php index 6641c425a83..2d1e4be38f0 100644 --- a/pages/seriesEditor/SubmissionEditHandler.inc.php +++ b/pages/seriesEditor/SubmissionEditHandler.inc.php @@ -1502,7 +1502,7 @@ function saveGalley($args) { $notificationManager =& new NotificationManager(); $monographDao =& DAORegistry::getDAO('MonographDAO'); $monograph =& $monographDao->getMonograph($monographId); - $notificationUsers = $monograph->getAssociatedUserIds(true, false); + $notificationUsers = $monograph->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionEditing', $monograph->getId(), null, 'layout'); $notificationManager->createNotification(