本文整理汇总了PHP中ArticleMailTemplate::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::isEnabled方法的具体用法?PHP ArticleMailTemplate::isEnabled怎么用?PHP ArticleMailTemplate::isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleMailTemplate
的用法示例。
在下文中一共展示了ArticleMailTemplate::isEnabled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignEditor
/**
* Assigns a section editor to a submission.
* @param $articleId int
* @param $sectionEditorId int
* @param $isEditor boolean
* @param $send boolean
* @param $request object
* @return boolean true iff ready for redirect
*/
function assignEditor($articleId, $sectionEditorId, $isEditor, $send, $request)
{
$editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');
$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
/* @var $editAssignmentDao EditAssignmentDAO */
$userDao =& DAORegistry::getDAO('UserDAO');
$user =& $request->getUser();
$journal =& $request->getJournal();
$editorSubmission =& $editorSubmissionDao->getEditorSubmission($articleId);
$sectionEditor =& $userDao->getById($sectionEditorId);
if (!isset($sectionEditor)) {
return true;
}
foreach ($editorSubmission->getEditAssignments() as $assignment) {
if ($assignment->getEditorId() == $sectionEditorId) {
return true;
}
}
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($editorSubmission, 'EDITOR_ASSIGN');
if ($user->getId() === $sectionEditorId || !$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('EditorAction::assignEditor', array(&$editorSubmission, &$sectionEditor, &$isEditor, &$email));
if ($email->isEnabled() && $user->getId() !== $sectionEditorId) {
$email->send($request);
}
$editAssignment = $editAssignmentDao->newDataObject();
$editAssignment->setArticleId($articleId);
$editAssignment->setCanEdit(1);
$editAssignment->setCanReview(1);
// Make the selected editor the new editor
$editAssignment->setEditorId($sectionEditorId);
$editAssignment->setDateAssigned(Core::getCurrentDate());
$editAssignment->setDateNotified(is_array($send) && isset($send['skip']) ? null : Core::getCurrentDate());
$editAssignment->setDateUnderway(null);
$editAssignments =& $editorSubmission->getEditAssignments();
array_push($editAssignments, $editAssignment);
$editorSubmission->setEditAssignments($editAssignments);
$editorSubmissionDao->updateEditorSubmission($editorSubmission);
// Add log
import('classes.article.log.ArticleLog');
ArticleLog::logEvent($request, $editorSubmission, ARTICLE_LOG_EDITOR_ASSIGN, 'log.editor.editorAssigned', array('editorName' => $sectionEditor->getFullName(), 'editorId' => $sectionEditorId));
return true;
} else {
if (!$request->getUserVar('continued')) {
$email->addRecipient($sectionEditor->getEmail(), $sectionEditor->getFullName());
$paramArray = array('editorialContactName' => $sectionEditor->getFullName(), 'editorUsername' => $sectionEditor->getUsername(), 'editorPassword' => $sectionEditor->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => $request->url(null, $isEditor ? 'editor' : 'sectionEditor', 'submissionReview', $articleId), 'submissionEditingUrl' => $request->url(null, $isEditor ? 'editor' : 'sectionEditor', 'submissionReview', $articleId));
$email->assignParams($paramArray);
}
$email->displayEditForm($request->url(null, null, 'assignEditor', 'send'), array('articleId' => $articleId, 'editorId' => $sectionEditorId));
return false;
}
}
示例2: execute
/**
* Save changes to submission.
* @param $args array
* @param $request PKPRequest
* @return int the submission ID
*/
function execute($args, $request)
{
parent::execute($args, $request);
$submission = $this->submission;
// Send author notification email
import('classes.mail.ArticleMailTemplate');
$mail = new ArticleMailTemplate($submission, 'SUBMISSION_ACK');
$authorMail = new ArticleMailTemplate($submission, 'SUBMISSION_ACK_NOT_USER');
$context = $request->getContext();
$router = $request->getRouter();
if ($mail->isEnabled()) {
// submission ack emails should be from the contact.
$mail->setFrom($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
$authorMail->setFrom($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
$user = $request->getUser();
$primaryAuthor = $submission->getPrimaryAuthor();
if (!isset($primaryAuthor)) {
$authors = $submission->getAuthors();
$primaryAuthor = $authors[0];
}
$mail->addRecipient($user->getEmail(), $user->getFullName());
// Add primary contact and e-mail address as specified in the journal submission settings
if ($context->getSetting('copySubmissionAckPrimaryContact')) {
$mail->addBcc($context->getSetting('contactEmail'), $context->getSetting('contactName'));
}
if ($copyAddress = $context->getSetting('copySubmissionAckAddress')) {
$mail->addBcc($copyAddress);
}
if ($user->getEmail() != $primaryAuthor->getEmail()) {
$authorMail->addRecipient($primaryAuthor->getEmail(), $primaryAuthor->getFullName());
}
$assignedAuthors = $submission->getAuthors();
foreach ($assignedAuthors as $author) {
$authorEmail = $author->getEmail();
// only add the author email if they have not already been added as the primary author
// or user creating the submission.
if ($authorEmail != $primaryAuthor->getEmail() && $authorEmail != $user->getEmail()) {
$authorMail->addRecipient($author->getEmail(), $author->getFullName());
}
}
$mail->bccAssignedSubEditors($submission->getId(), WORKFLOW_STAGE_ID_SUBMISSION);
$mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $context->getSetting('contactName'), 'submissionUrl' => $router->url($request, null, 'authorDashboard', 'submission', $submission->getId())));
$authorMail->assignParams(array('submitterName' => $user->getFullName(), 'editorialContactSignature' => $context->getSetting('contactName')));
$mail->send($request);
$recipients = $authorMail->getRecipients();
if (!empty($recipients)) {
$authorMail->send($request);
}
}
// Log submission.
import('classes.log.SubmissionEventLogEntry');
// Constants
import('lib.pkp.classes.log.SubmissionLog');
SubmissionLog::logEvent($request, $submission, SUBMISSION_LOG_SUBMISSION_SUBMIT, 'submission.event.submissionSubmitted');
return $this->submissionId;
}
示例3: execute
/**
* Save changes to article.
*/
function execute()
{
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$journal = Request::getJournal();
$user = Request::getUser();
// Update article
$article =& $this->article;
if ($this->getData('commentsToEditor') != '') {
$article->setCommentsToEditor($this->getData('commentsToEditor'));
}
$article->setDateSubmitted(Core::getCurrentDate());
$article->setSubmissionProgress(0);
$article->stampStatusModified();
$articleDao->updateArticle($article);
// Designate this as the review version by default.
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
AuthorAction::designateReviewVersion($authorSubmission, true);
unset($authorSubmission);
$copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditInitialSignoff->setUserId(0);
$copyeditAuthorSignoff->setUserId($user->getId());
$copyeditFinalSignoff->setUserId(0);
$signoffDao->updateObject($copyeditInitialSignoff);
$signoffDao->updateObject($copyeditAuthorSignoff);
$signoffDao->updateObject($copyeditFinalSignoff);
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
$layoutSignoff->setUserId(0);
$signoffDao->updateObject($layoutSignoff);
$proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
$proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getId());
$proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
$proofAuthorSignoff->setUserId($user->getId());
$proofProofreaderSignoff->setUserId(0);
$proofLayoutEditorSignoff->setUserId(0);
$signoffDao->updateObject($proofAuthorSignoff);
$signoffDao->updateObject($proofProofreaderSignoff);
$signoffDao->updateObject($proofLayoutEditorSignoff);
$sectionEditors = $this->assignEditors($article);
$user =& Request::getUser();
// Update search index
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::indexArticleMetadata($article);
ArticleSearchIndex::indexArticleFiles($article);
// Send author notification email
import('classes.mail.ArticleMailTemplate');
$mail = new ArticleMailTemplate($article, 'SUBMISSION_ACK', null, null, null, false);
$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
if ($mail->isEnabled()) {
$mail->addRecipient($user->getEmail(), $user->getFullName());
// If necessary, BCC the acknowledgement to someone.
if ($journal->getSetting('copySubmissionAckPrimaryContact')) {
$mail->addBcc($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
}
if ($journal->getSetting('copySubmissionAckSpecified')) {
$copyAddress = $journal->getSetting('copySubmissionAckAddress');
if (!empty($copyAddress)) {
$mail->addBcc($copyAddress);
}
}
// Also BCC automatically assigned section editors
foreach ($sectionEditors as $sectionEditorEntry) {
$sectionEditor =& $sectionEditorEntry['user'];
$mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
unset($sectionEditor);
}
$mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle(), 'submissionUrl' => Request::url(null, 'author', 'submission', $article->getId())));
$mail->send();
}
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), 'log.author.submitted', array('submissionId' => $article->getId(), 'authorName' => $user->getFullName()));
return $this->articleId;
}
示例4: thankLayoutEditor
/**
* Sends acknowledgement email to the current layout editor.
* @param $submission object
* @param $send boolean
* @param $request object
* @return boolean true iff ready for redirect
*/
function thankLayoutEditor($submission, $send, $request)
{
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$submissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& $request->getJournal();
$user =& $request->getUser();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($submission, 'LAYOUT_ACK');
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $submission->getId());
$layoutEditor =& $userDao->getUser($layoutSignoff->getUserId());
if (!isset($layoutEditor)) {
return true;
}
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('SectionEditorAction::thankLayoutEditor', array(&$submission, &$layoutEditor, &$email));
if ($email->isEnabled()) {
$email->send($request);
}
$layoutSignoff->setDateAcknowledged(Core::getCurrentDate());
$signoffDao->updateObject($layoutSignoff);
} else {
if (!$request->getUserVar('continued')) {
$email->addRecipient($layoutEditor->getEmail(), $layoutEditor->getFullName());
$paramArray = array('layoutEditorName' => $layoutEditor->getFullName(), 'editorialContactSignature' => $user->getContactSignature());
$email->assignParams($paramArray);
}
$email->displayEditForm($request->url(null, null, 'thankLayoutEditor', 'send'), array('articleId' => $submission->getId()));
return false;
}
return true;
}
示例5: completeFinalCopyedit
/**
* Copyeditor completes final copyedit.
* @param $copyeditorSubmission object
* @param $send boolean
* @param $request object
*/
function completeFinalCopyedit($copyeditorSubmission, $send, $request)
{
$copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& $request->getJournal();
$finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
if ($finalSignoff->getDateCompleted() != null) {
return true;
}
$user =& $request->getUser();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($copyeditorSubmission, 'COPYEDIT_FINAL_COMPLETE');
$editAssignments = $copyeditorSubmission->getEditAssignments();
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('CopyeditorAction::completeFinalCopyedit', array(&$copyeditorSubmission, &$editAssignments, &$email));
if ($email->isEnabled()) {
$email->send($request);
}
$finalSignoff->setDateCompleted(Core::getCurrentDate());
$signoffDao->updateObject($finalSignoff);
if ($copyEdFile = $copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL')) {
// Set initial layout version to final copyedit version
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
if (!$layoutSignoff->getFileId()) {
import('classes.file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($copyeditorSubmission->getId());
if ($layoutFileId = $articleFileManager->copyToLayoutFile($copyEdFile->getFileId(), $copyEdFile->getRevision())) {
$layoutSignoff->setFileId($layoutFileId);
$signoffDao->updateObject($layoutSignoff);
}
}
}
// Add log entry
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($request, $copyeditorSubmission, ARTICLE_LOG_COPYEDIT_FINAL, 'log.copyedit.finalEditComplete', array('copyeditorName' => $user->getFullName()));
return true;
} else {
if (!$request->getUserVar('continued')) {
$assignedSectionEditors = $email->toAssignedEditingSectionEditors($copyeditorSubmission->getId());
$assignedEditors = $email->ccAssignedEditors($copyeditorSubmission->getId());
if (empty($assignedSectionEditors) && empty($assignedEditors)) {
$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$paramArray = array('editorialContactName' => $journal->getSetting('contactName'), 'copyeditorName' => $user->getFullName());
} else {
$editorialContact = array_shift($assignedSectionEditors);
if (!$editorialContact) {
$editorialContact = array_shift($assignedEditors);
}
$paramArray = array('editorialContactName' => $editorialContact->getEditorFullName(), 'copyeditorName' => $user->getFullName());
}
$email->assignParams($paramArray);
}
$email->displayEditForm($request->url(null, 'copyeditor', 'completeFinalCopyedit', 'send'), array('articleId' => $copyeditorSubmission->getId()));
return false;
}
}
示例6: recordRecommendation
/**
* Records the reviewer's submission recommendation.
* @param $reviewId int
* @param $recommendation int
* @param $send boolean
*/
function recordRecommendation(&$reviewAssignment, $recommendation, $send)
{
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$reviewId = $reviewAssignment->getReviewId();
$reviewerSubmission =& $reviewerSubmissionDao->getReviewerSubmission($reviewId);
// Check validity of selected recommendation
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
if (!isset($reviewerRecommendationOptions[$recommendation])) {
return true;
}
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (!isset($reviewer)) {
return true;
}
// Only record the reviewers recommendation if
// no recommendation has previously been submitted.
if ($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation === '') {
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($reviewerSubmission, null, 'REVIEW_COMPLETE');
// Must explicitly set sender because we may be here on an access
// key, in which case the user is not technically logged in
$email->setFrom($reviewer->getEmail(), $reviewer->getFullName());
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('ReviewerAction::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
if ($email->isEnabled()) {
$email->setAssoc(ARTICLE_EMAIL_REVIEW_COMPLETE, ARTICLE_EMAIL_TYPE_REVIEW, $reviewId);
$email->send();
}
$reviewAssignment->setRecommendation($recommendation);
$reviewAssignment->setDateCompleted(Core::getCurrentDate());
$reviewAssignment->stampModified();
$reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
// Add log
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
$entry = new ArticleEventLogEntry();
$entry->setArticleId($reviewerSubmission->getArticleId());
$entry->setUserId($reviewer->getId());
$entry->setDateLogged(Core::getCurrentDate());
$entry->setEventType(ARTICLE_LOG_REVIEW_RECOMMENDATION);
$entry->setLogLevel('N');
$entry->setLogMessage('log.review.reviewRecommendationSet', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewerSubmission->getProposalId()));
$entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW);
$entry->setAssocId($reviewAssignment->getId());
ArticleLog::logEventEntry($reviewerSubmission->getArticleId(), $entry);
} else {
if (!Request::getUserVar('continued')) {
$assignedEditors = $email->ccAssignedEditors($reviewerSubmission->getArticleId());
$reviewingSectionEditors = $email->toAssignedReviewingSectionEditors($reviewerSubmission->getArticleId());
if (empty($assignedEditors) && empty($reviewingSectionEditors)) {
$journal =& Request::getJournal();
$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$editorialContactName = $journal->getSetting('contactName');
} else {
if (!empty($reviewingSectionEditors)) {
$editorialContact = array_shift($reviewingSectionEditors);
} else {
$editorialContact = array_shift($assignedEditors);
}
// Modified by EL on February 17th 2013
// No edit assigment anymore
$editorialContactName = $editorialContact->getFullName();
}
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
$email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'articleTitle' => strip_tags($reviewerSubmission->getScientificTitle()), 'recommendation' => Locale::translate($reviewerRecommendationOptions[$recommendation])));
}
$email->displayEditForm(Request::url(null, 'reviewer', 'recordRecommendation'), array('reviewId' => $reviewId, 'recommendation' => $recommendation));
return false;
}
}
return true;
}
示例7: completeAuthorCopyedit
/**
* Author completes editor / author review.
* @param $authorSubmission object
* @param $send boolean
* @param $request object
*/
function completeAuthorCopyedit($authorSubmission, $send, $request)
{
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& $request->getJournal();
$authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $authorSubmission->getId());
if ($authorSignoff->getDateCompleted() != null) {
return true;
}
$user =& $request->getUser();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($authorSubmission, 'COPYEDIT_AUTHOR_COMPLETE');
$editAssignments = $authorSubmission->getEditAssignments();
$copyeditor = $authorSubmission->getUserBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('AuthorAction::completeAuthorCopyedit', array(&$authorSubmission, &$email));
if ($email->isEnabled()) {
$email->send($request);
}
$authorSignoff->setDateCompleted(Core::getCurrentDate());
$finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $authorSubmission->getId());
if ($copyeditor) {
$finalSignoff->setUserId($copyeditor->getId());
}
$finalSignoff->setDateNotified(Core::getCurrentDate());
$signoffDao->updateObject($authorSignoff);
$signoffDao->updateObject($finalSignoff);
// Add log entry
import('classes.article.log.ArticleLog');
ArticleLog::logEvent($request, $authorSubmission, ARTICLE_LOG_COPYEDIT_REVISION, 'log.copyedit.authorFile');
return true;
} else {
if (!$request->getUserVar('continued')) {
if (isset($copyeditor)) {
$email->addRecipient($copyeditor->getEmail(), $copyeditor->getFullName());
$assignedSectionEditors = $email->ccAssignedEditingSectionEditors($authorSubmission->getId());
$assignedEditors = $email->ccAssignedEditors($authorSubmission->getId());
if (empty($assignedSectionEditors) && empty($assignedEditors)) {
$email->addCc($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$editorName = $journal->getSetting('contactName');
} else {
$editor = array_shift($assignedSectionEditors);
if (!$editor) {
$editor = array_shift($assignedEditors);
}
$editorName = $editor->getEditorFullName();
}
} else {
$assignedSectionEditors = $email->toAssignedEditingSectionEditors($authorSubmission->getId());
$assignedEditors = $email->ccAssignedEditors($authorSubmission->getId());
if (empty($assignedSectionEditors) && empty($assignedEditors)) {
$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$editorName = $journal->getSetting('contactName');
} else {
$editor = array_shift($assignedSectionEditors);
if (!$editor) {
$editor = array_shift($assignedEditors);
}
$editorName = $editor->getEditorFullName();
}
}
$paramArray = array('editorialContactName' => isset($copyeditor) ? $copyeditor->getFullName() : $editorName, 'authorName' => $user->getFullName());
$email->assignParams($paramArray);
}
$email->displayEditForm($request->url(null, 'author', 'completeAuthorCopyedit', 'send'), array('articleId' => $authorSubmission->getId()));
return false;
}
}
示例8: completeLayoutEditing
/**
* Marks layout assignment as completed.
* @param $submission object
* @param $send boolean
*/
function completeLayoutEditing($submission, $send = false)
{
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& Request::getJournal();
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $submission->getArticleId());
if ($layoutSignoff->getDateCompleted() != null) {
return true;
}
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($submission, 'LAYOUT_COMPLETE');
$editAssignments =& $submission->getEditAssignments();
if (empty($editAssignments)) {
return;
}
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('LayoutEditorAction::completeLayoutEditing', array(&$submission, &$editAssignments, &$email));
if ($email->isEnabled()) {
$email->setAssoc(ARTICLE_EMAIL_LAYOUT_NOTIFY_COMPLETE, ARTICLE_EMAIL_TYPE_LAYOUT, $layoutSignoff->getId());
$email->send();
}
$layoutSignoff->setDateCompleted(Core::getCurrentDate());
$signoffDao->updateObject($layoutSignoff);
// Add log entry
$user =& Request::getUser();
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($submission->getArticleId(), ARTICLE_LOG_LAYOUT_COMPLETE, ARTICLE_LOG_TYPE_LAYOUT, $user->getId(), 'log.layout.layoutEditComplete', array('editorName' => $user->getFullName(), 'articleId' => $submission->getArticleId()));
return true;
} else {
$user =& Request::getUser();
if (!Request::getUserVar('continued')) {
$assignedSectionEditors = $email->toAssignedEditingSectionEditors($submission->getArticleId());
$assignedEditors = $email->ccAssignedEditors($submission->getArticleId());
if (empty($assignedSectionEditors) && empty($assignedEditors)) {
$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$editorialContactName = $journal->getSetting('contactName');
} else {
$editorialContact = array_shift($assignedSectionEditors);
if (!$editorialContact) {
$editorialContact = array_shift($assignedEditors);
}
$editorialContactName = $editorialContact->getEditorFullName();
}
$paramArray = array('editorialContactName' => $editorialContactName, 'layoutEditorName' => $user->getFullName());
$email->assignParams($paramArray);
}
$email->displayEditForm(Request::url(null, 'layoutEditor', 'completeAssignment', 'send'), array('articleId' => $submission->getArticleId()));
return false;
}
}
示例9: proofreadEmail
//.........这里部分代码省略.........
if (!isset($receiver)) {
return true;
}
$receiverName = $receiver->getFullName();
$receiverAddress = $receiver->getEmail();
$email->ccAssignedEditingSectionEditors($sectionEditorSubmission->getId());
$addParamArray = array('layoutEditorName' => $receiverName, 'layoutEditorUsername' => $receiver->getUsername(), 'layoutEditorPassword' => $receiver->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => Request::url(null, 'proofreader', 'submission', $articleId));
if (!$actionPath) {
// Reset underway/complete/thank dates
$signoffReset = $signoffDao->build($signoffType, ASSOC_TYPE_ARTICLE, $articleId);
$signoffReset->setDateUnderway(null);
$signoffReset->setDateCompleted(null);
$signoffReset->setDateAcknowledged(null);
}
break;
case 'PROOFREAD_LAYOUT_ACK':
$eventType = ARTICLE_EMAIL_PROOFREAD_THANK_LAYOUTEDITOR;
$signoffType = 'SIGNOFF_PROOFREADING_LAYOUT';
$setDateField = 'setDateAcknowledged';
$receiver = $sectionEditorSubmission->getUserBySignoffType($signoffType);
if (!isset($receiver)) {
return true;
}
$receiverName = $receiver->getFullName();
$receiverAddress = $receiver->getEmail();
$email->ccAssignedEditingSectionEditors($sectionEditorSubmission->getId());
$addParamArray = array('layoutEditorName' => $receiverName, 'editorialContactSignature' => $user->getContactSignature());
break;
case 'PROOFREAD_LAYOUT_COMPLETE':
$eventType = ARTICLE_EMAIL_PROOFREAD_NOTIFY_LAYOUTEDITOR_COMPLETE;
$signoffType = 'SIGNOFF_PROOFREADING_LAYOUT';
$setDateField = 'setDateCompleted';
$getDateField = 'getDateCompleted';
$editAssignments =& $sectionEditorSubmission->getEditAssignments();
$assignmentIndex = 0;
$editorAdded = false;
foreach ($editAssignments as $editAssignment) {
if ($editAssignment->getIsEditor() || $editAssignment->getCanEdit()) {
if ($assignmentIndex++ == 0) {
$receiverName = $editAssignment->getEditorFullName();
$receiverAddress = $editAssignment->getEditorEmail();
} else {
$ccs[$editAssignment->getEditorEmail()] = $editAssignment->getEditorFullName();
}
$editorAdded = true;
}
}
if (!$editorAdded) {
$receiverAddress = $journal->getSetting('contactEmail');
$receiverName = $journal->getSetting('contactName');
}
$addParamArray = array('editorialContactName' => $receiverName, 'layoutEditorName' => $user->getFullName());
break;
default:
return true;
}
$signoff = $signoffDao->build($signoffType, ASSOC_TYPE_ARTICLE, $articleId);
if (isset($getDateField)) {
$date = $signoff->{$getDateField}();
if (isset($date)) {
Request::redirect(null, null, 'submission', $articleId);
}
}
if ($email->isEnabled() && ($actionPath || $email->hasErrors())) {
if (!Request::getUserVar('continued')) {
$email->addRecipient($receiverAddress, $receiverName);
if (isset($ccs)) {
foreach ($ccs as $address => $name) {
$email->addCc($address, $name);
}
}
$paramArray = array();
if (isset($addParamArray)) {
$paramArray += $addParamArray;
}
$email->assignParams($paramArray);
}
$email->displayEditForm($actionPath, array('articleId' => $articleId));
return false;
} else {
HookRegistry::call('ProofreaderAction::proofreadEmail', array(&$email, $mailType));
if ($email->isEnabled()) {
$email->send($request);
}
$signoff->{$setDateField}(Core::getCurrentDate());
if (isset($setNextDateField)) {
$nextSignoff->{$setNextDateField}(Core::getCurrentDate());
}
if (isset($nullifyDateFields)) {
foreach ($nullifyDateFields as $fieldSetter) {
$signoff->{$fieldSetter}(null);
}
}
$signoffDao->updateObject($signoff);
if (isset($nextSignoff)) {
$signoffDao->updateObject($nextSignoff);
}
return true;
}
}
示例10: recordRecommendation
/**
* Records the reviewer's submission recommendation.
* @param $reviewId int
* @param $recommendation int
* @param $send boolean
* @param $request object
*/
function recordRecommendation(&$reviewerSubmission, $recommendation, $send, $request)
{
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
// Check validity of selected recommendation
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
if (!isset($reviewerRecommendationOptions[$recommendation])) {
return true;
}
$reviewAssignment =& $reviewAssignmentDao->getById($reviewerSubmission->getReviewId());
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (!isset($reviewer)) {
return true;
}
// Only record the reviewers recommendation if
// no recommendation has previously been submitted.
if ($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation === '') {
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($reviewerSubmission, 'REVIEW_COMPLETE');
// Must explicitly set sender because we may be here on an access
// key, in which case the user is not technically logged in
$email->setReplyTo($reviewer->getEmail(), $reviewer->getFullName());
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('ReviewerAction::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
if ($email->isEnabled()) {
$email->send($request);
}
$reviewAssignment->setRecommendation($recommendation);
$reviewAssignment->setDateCompleted(Core::getCurrentDate());
$reviewAssignment->stampModified();
$reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
// Add log
import('classes.article.log.ArticleLog');
ArticleLog::logEvent($request, $reviewerSubmission, ARTICLE_LOG_REVIEW_RECOMMENDATION, 'log.review.reviewRecommendationSet', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewAssignment->getSubmissionId(), 'round' => $reviewAssignment->getRound(), 'reviewId' => $reviewAssignment->getId()));
} else {
if (!$request->getUserVar('continued')) {
$assignedEditors = $email->ccAssignedEditors($reviewerSubmission->getId());
$reviewingSectionEditors = $email->toAssignedReviewingSectionEditors($reviewerSubmission->getId());
if (empty($assignedEditors) && empty($reviewingSectionEditors)) {
$journal =& Request::getJournal();
$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$editorialContactName = $journal->getSetting('contactName');
} else {
if (!empty($reviewingSectionEditors)) {
$editorialContact = array_shift($reviewingSectionEditors);
} else {
$editorialContact = array_shift($assignedEditors);
}
$editorialContactName = $editorialContact->getEditorFullName();
}
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
$email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'articleTitle' => strip_tags($reviewerSubmission->getLocalizedTitle()), 'recommendation' => __($reviewerRecommendationOptions[$recommendation])));
}
$email->displayEditForm($request->url(null, 'reviewer', 'recordRecommendation'), array('reviewId' => $reviewerSubmission->getReviewId(), 'recommendation' => $recommendation));
return false;
}
}
return true;
}
示例11: execute
/**
* Save changes to article.
*/
function execute()
{
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$ercReviewersDao =& DAORegistry::getDAO('ErcReviewersDAO');
$institutionDao =& DAORegistry::getDAO('InstitutionDAO');
$journal = Request::getJournal();
$user = Request::getUser();
// Update article
$article =& $this->article;
if ($article->getDateSubmitted() == null) {
$year = substr(Core::getCurrentDate(), 0, 4);
$countyear = $articleDao->getSubmissionsForYearCount($year) + 1;
$pSponsor = $article->getArticlePrimarySponsor();
$institution = $institutionDao->getInstitutionById($pSponsor->getInstitutionId());
$article->setProposalId($year . '-' . $countyear . '-' . $institution->getInstitutionAcronym());
}
if ($this->getData('commentsToEditor') != '') {
$article->setCommentsToEditor($this->getData('commentsToEditor'));
}
$article->setDateSubmitted(Core::getCurrentDate());
$article->setSubmissionProgress(0);
$article->stampStatusModified();
$articleDao->updateArticle($article);
// Designate this as the review version by default.
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
AuthorAction::designateReviewVersion($authorSubmission, true);
unset($authorSubmission);
$copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditInitialSignoff->setUserId(0);
$copyeditAuthorSignoff->setUserId($user->getId());
$copyeditFinalSignoff->setUserId(0);
$signoffDao->updateObject($copyeditInitialSignoff);
$signoffDao->updateObject($copyeditAuthorSignoff);
$signoffDao->updateObject($copyeditFinalSignoff);
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
$layoutSignoff->setUserId(0);
$signoffDao->updateObject($layoutSignoff);
$proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
$proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getId());
$proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
$proofAuthorSignoff->setUserId($user->getId());
$proofProofreaderSignoff->setUserId(0);
$proofLayoutEditorSignoff->setUserId(0);
$signoffDao->updateObject($proofAuthorSignoff);
$signoffDao->updateObject($proofProofreaderSignoff);
$signoffDao->updateObject($proofLayoutEditorSignoff);
$sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
$sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $article->getSectionId());
$user =& Request::getUser();
// Update search index
import('classes.search.ArticleSearchIndex');
ArticleSearchIndex::indexArticleMetadata($article);
ArticleSearchIndex::indexArticleFiles($article);
// Send author notification email
import('classes.mail.ArticleMailTemplate');
$mail = new ArticleMailTemplate($article, null, 'SUBMISSION_ACK', null, null, null, false);
foreach ($sectionEditors as $sectionEditor) {
// If one of the secretary is the chair of the committee, send from the chair, if not, take the last secretary in the array
$from = $mail->getFrom();
if ($ercReviewersDao->isErcReviewer($journal->getId(), $sectionEditor->getId(), REVIEWER_CHAIR)) {
$mail->setFrom($sectionEditor->getEmail(), $sectionEditor->getFullName());
} elseif ($from['email'] == $user->getEmail()) {
$mail->setFrom($sectionEditor->getEmail(), $sectionEditor->getFullName());
}
$mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
unset($sectionEditor);
}
if ($mail->isEnabled()) {
$mail->addRecipient($user->getEmail(), $user->getFullName());
if ($journal->getSetting('copySubmissionAckSpecified')) {
$copyAddress = $journal->getSetting('copySubmissionAckAddress');
if (!empty($copyAddress)) {
$mail->addBcc($copyAddress);
}
}
$section = $sectionDao->getSection($article->getSectionId());
$mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'address' => $sectionDao->getSettingValue($article->getSectionId(), 'address'), 'bankAccount' => $sectionDao->getSettingValue($article->getSectionId(), 'bankAccount'), 'proposalId' => $article->getProposalId(), 'submissionUrl' => Request::url(null, 'author', 'submission', $article->getId())));
$mail->send();
}
// Send a regular notification to section editors
$lastDecision = $article->getLastSectionDecision();
switch ($lastDecision->getReviewType()) {
case REVIEW_TYPE_INITIAL:
if ($lastDecision->getRound() == 1) {
$message = 'notification.type.articleSubmitted.initialReview';
} else {
$message = 'notification.type.articleReSubmitted.initialReview';
}
break;
case REVIEW_TYPE_PR:
if ($lastDecision->getRound() == 1) {
$message = 'notification.type.articleSubmitted.continuingReview';
//.........这里部分代码省略.........