本文整理汇总了PHP中ArticleMailTemplate::ccAssignedEditingSectionEditors方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::ccAssignedEditingSectionEditors方法的具体用法?PHP ArticleMailTemplate::ccAssignedEditingSectionEditors怎么用?PHP ArticleMailTemplate::ccAssignedEditingSectionEditors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleMailTemplate
的用法示例。
在下文中一共展示了ArticleMailTemplate::ccAssignedEditingSectionEditors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: completeCopyedit
/**
* Copyeditor completes initial copyedit.
* @param $copyeditorSubmission object
*/
function completeCopyedit($copyeditorSubmission, $send = false)
{
$copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& Request::getJournal();
$initialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
if ($initialSignoff->getDateCompleted() != null) {
return true;
}
$user =& Request::getUser();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($copyeditorSubmission, 'COPYEDIT_COMPLETE');
$editAssignments = $copyeditorSubmission->getEditAssignments();
$author = $copyeditorSubmission->getUser();
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('CopyeditorAction::completeCopyedit', array(&$copyeditorSubmission, &$editAssignments, &$author, &$email));
if ($email->isEnabled()) {
$email->setAssoc(ARTICLE_EMAIL_COPYEDIT_NOTIFY_COMPLETE, ARTICLE_EMAIL_TYPE_COPYEDIT, $copyeditorSubmission->getArticleId());
$email->send();
}
$initialSignoff->setDateCompleted(Core::getCurrentDate());
$authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
$authorSignoff->setUserId($author->getId());
$authorSignoff->setDateNotified(Core::getCurrentDate());
$signoffDao->updateObject($initialSignoff);
$signoffDao->updateObject($authorSignoff);
// Add log entry
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($copyeditorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_INITIAL, ARTICLE_LOG_TYPE_COPYEDIT, $user->getId(), 'log.copyedit.initialEditComplete', array('copyeditorName' => $user->getFullName(), 'articleId' => $copyeditorSubmission->getArticleId()));
return true;
} else {
if (!Request::getUserVar('continued')) {
$email->addRecipient($author->getEmail(), $author->getFullName());
$email->ccAssignedEditingSectionEditors($copyeditorSubmission->getArticleId());
$email->ccAssignedEditors($copyeditorSubmission->getArticleId());
$paramArray = array('editorialContactName' => $author->getFullName(), 'copyeditorName' => $user->getFullName(), 'authorUsername' => $author->getUsername(), 'submissionEditingUrl' => Request::url(null, 'author', 'submissionEditing', array($copyeditorSubmission->getArticleId())));
$email->assignParams($paramArray);
}
$email->displayEditForm(Request::url(null, 'copyeditor', 'completeCopyedit', 'send'), array('articleId' => $copyeditorSubmission->getArticleId()));
return false;
}
}
示例2: 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;
}
}
示例3: proofreadEmail
/**
* Proofread Emails
* @param $articleId int
* @param $mailType defined string - type of proofread mail being sent
* @param $request object
* @param $actionPath string - form action
* @return true iff ready for a redirect
*/
function proofreadEmail($articleId, $mailType, $request, $actionPath = '')
{
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($articleId);
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& Request::getJournal();
$user =& Request::getUser();
$ccs = array();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($sectionEditorSubmission, $mailType);
switch ($mailType) {
case 'PROOFREAD_AUTHOR_REQUEST':
$eventType = ARTICLE_EMAIL_PROOFREAD_NOTIFY_AUTHOR;
$signoffType = 'SIGNOFF_PROOFREADING_AUTHOR';
$setDateField = 'setDateNotified';
$nullifyDateFields = array('setDateUnderway', 'setDateCompleted', 'setDateAcknowledged');
$setUserId = $sectionEditorSubmission->getUserId();
$receiver =& $userDao->getUser($setUserId);
$setUserId = $receiver;
if (!isset($receiver)) {
return true;
}
$receiverName = $receiver->getFullName();
$receiverAddress = $receiver->getEmail();
$email->ccAssignedEditingSectionEditors($sectionEditorSubmission->getId());
$addParamArray = array('authorName' => $receiver->getFullName(), 'authorUsername' => $receiver->getUsername(), 'authorPassword' => $receiver->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => Request::url(null, 'author', 'submissionEditing', $articleId));
break;
case 'PROOFREAD_AUTHOR_ACK':
$eventType = ARTICLE_EMAIL_PROOFREAD_THANK_AUTHOR;
$signoffType = 'SIGNOFF_PROOFREADING_AUTHOR';
$setDateField = 'setDateAcknowledged';
$receiver =& $userDao->getUser($sectionEditorSubmission->getUserId());
if (!isset($receiver)) {
return true;
}
$receiverName = $receiver->getFullName();
$receiverAddress = $receiver->getEmail();
$email->ccAssignedEditingSectionEditors($sectionEditorSubmission->getId());
$addParamArray = array('authorName' => $receiver->getFullName(), 'editorialContactSignature' => $user->getContactSignature());
break;
case 'PROOFREAD_AUTHOR_COMPLETE':
$eventType = ARTICLE_EMAIL_PROOFREAD_NOTIFY_AUTHOR_COMPLETE;
$signoffType = 'SIGNOFF_PROOFREADING_AUTHOR';
$setDateField = 'setDateCompleted';
$getDateField = 'getDateCompleted';
$editAssignments =& $sectionEditorSubmission->getEditAssignments();
$nextSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $articleId);
if ($nextSignoff->getUserId() != 0) {
$setNextDateField = 'setDateNotified';
$proofreader =& $userDao->getUser($nextSignoff->getUserId());
$receiverName = $proofreader->getFullName();
$receiverAddress = $proofreader->getEmail();
$editorAdded = false;
foreach ($editAssignments as $editAssignment) {
if ($editAssignment->getIsEditor() || $editAssignment->getCanEdit()) {
$ccs[$editAssignment->getEditorEmail()] = $editAssignment->getEditorFullName();
$editorAdded = true;
}
}
if (!$editorAdded) {
$ccs[$journal->getSetting('contactEmail')] = $journal->getSetting('contactName');
}
} else {
$editorAdded = false;
$assignmentIndex = 0;
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, 'authorName' => $user->getFullName());
break;
case 'PROOFREAD_REQUEST':
$eventType = ARTICLE_EMAIL_PROOFREAD_NOTIFY_PROOFREADER;
$signoffType = 'SIGNOFF_PROOFREADING_PROOFREADER';
$setDateField = 'setDateNotified';
$nullifyDateFields = array('setDateUnderway', 'setDateCompleted', 'setDateAcknowledged');
$receiver = $sectionEditorSubmission->getUserBySignoffType($signoffType);
if (!isset($receiver)) {
return true;
//.........这里部分代码省略.........