本文整理汇总了PHP中ArticleLog::logEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleLog::logEvent方法的具体用法?PHP ArticleLog::logEvent怎么用?PHP ArticleLog::logEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleLog
的用法示例。
在下文中一共展示了ArticleLog::logEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectProofreader
/**
* Select a proofreader for submission
*/
function selectProofreader($userId, $article, $request)
{
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$proofSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getId());
if (!HookRegistry::call('ProofreaderAction::selectProofreader', array(&$userId, &$article))) {
$proofSignoff->setUserId($userId);
$signoffDao->updateObject($proofSignoff);
// Add log entry
$user =& Request::getUser();
$userDao =& DAORegistry::getDAO('UserDAO');
$proofreader =& $userDao->getUser($userId);
if (!isset($proofreader)) {
return;
}
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($request, $article, ARTICLE_LOG_PROOFREAD_ASSIGN, 'log.proofread.assign', array('assignerName' => $user->getFullName(), 'proofreaderName' => $proofreader->getFullName()));
}
}
示例2: selectProofreader
/**
* Select a proofreader for submission
*/
function selectProofreader($userId, $article)
{
$proofAssignmentDao =& DAORegistry::getDAO('ProofAssignmentDAO');
$proofAssignment =& $proofAssignmentDao->getProofAssignmentByArticleId($article->getArticleId());
if (!HookRegistry::call('ProofreaderAction::selectProofreader', array(&$userId, &$article, &$proofAssignment))) {
$proofAssignment->setProofreaderId($userId);
$proofAssignmentDao->updateProofAssignment($proofAssignment);
// Add log entry
$user =& Request::getUser();
$userDao =& DAORegistry::getDAO('UserDAO');
$proofreader =& $userDao->getUser($userId);
if (!isset($proofreader)) {
return;
}
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($article->getArticleId(), ARTICLE_LOG_PROOFREAD_ASSIGN, ARTICLE_LOG_TYPE_PROOFREAD, $user->getUserId(), 'log.proofread.assign', array('assignerName' => $user->getFullName(), 'proofreaderName' => $proofreader->getFullName(), 'articleId' => $article->getArticleId()));
}
}
示例3: copyeditUnderway
/**
* Set that the copyedit is underway.
*/
function copyeditUnderway(&$copyeditorSubmission)
{
if (!HookRegistry::call('CopyeditorAction::copyeditUnderway', array(&$copyeditorSubmission))) {
$copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$initialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
$finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
if ($initialSignoff->getDateNotified() != null && $initialSignoff->getDateUnderway() == null) {
$initialSignoff->setDateUnderway(Core::getCurrentDate());
$signoffDao->updateObject($initialSignoff);
$update = true;
} elseif ($finalSignoff->getDateNotified() != null && $finalSignoff->getDateUnderway() == null) {
$finalSignoff->setDateUnderway(Core::getCurrentDate());
$signoffDao->updateObject($finalSignoff);
$update = true;
}
if (isset($update)) {
// Add log entry
$user =& Request::getUser();
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($copyeditorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_INITIATE, ARTICLE_LOG_TYPE_COPYEDIT, $user->getId(), 'log.copyedit.initiate', array('copyeditorName' => $user->getFullName(), 'articleId' => $copyeditorSubmission->getArticleId()));
}
}
}
示例4: saveMetadata
/**
* Save metadata.
* @param $article object
* @param $request PKPRequest
*/
function saveMetadata($article, &$request)
{
$router =& $request->getRouter();
if (!HookRegistry::call('Action::saveMetadata', array(&$article))) {
import('classes.submission.form.MetadataForm');
$journal =& $request->getJournal();
$metadataForm = new MetadataForm($article, $journal);
$metadataForm->readInputData();
// Check for any special cases before trying to save
if ($request->getUserVar('addAuthor')) {
// Add an author
$editData = true;
$authors = $metadataForm->getData('authors');
array_push($authors, array());
$metadataForm->setData('authors', $authors);
} else {
if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) {
// Delete an author
$editData = true;
list($delAuthor) = array_keys($delAuthor);
$delAuthor = (int) $delAuthor;
$authors = $metadataForm->getData('authors');
if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) {
$deletedAuthors = explode(':', $metadataForm->getData('deletedAuthors'));
array_push($deletedAuthors, $authors[$delAuthor]['authorId']);
$metadataForm->setData('deletedAuthors', join(':', $deletedAuthors));
}
array_splice($authors, $delAuthor, 1);
$metadataForm->setData('authors', $authors);
if ($metadataForm->getData('primaryContact') == $delAuthor) {
$metadataForm->setData('primaryContact', 0);
}
} else {
if ($request->getUserVar('moveAuthor')) {
// Move an author up/down
$editData = true;
$moveAuthorDir = $request->getUserVar('moveAuthorDir');
$moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd';
$moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex');
$authors = $metadataForm->getData('authors');
if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) {
$tmpAuthor = $authors[$moveAuthorIndex];
$primaryContact = $metadataForm->getData('primaryContact');
if ($moveAuthorDir == 'u') {
$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1];
$authors[$moveAuthorIndex - 1] = $tmpAuthor;
if ($primaryContact == $moveAuthorIndex) {
$metadataForm->setData('primaryContact', $moveAuthorIndex - 1);
} else {
if ($primaryContact == $moveAuthorIndex - 1) {
$metadataForm->setData('primaryContact', $moveAuthorIndex);
}
}
} else {
$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1];
$authors[$moveAuthorIndex + 1] = $tmpAuthor;
if ($primaryContact == $moveAuthorIndex) {
$metadataForm->setData('primaryContact', $moveAuthorIndex + 1);
} else {
if ($primaryContact == $moveAuthorIndex + 1) {
$metadataForm->setData('primaryContact', $moveAuthorIndex);
}
}
}
}
$metadataForm->setData('authors', $authors);
}
}
}
if (isset($editData)) {
$metadataForm->display();
return false;
} else {
if (!$metadataForm->validate()) {
return $metadataForm->display();
}
$metadataForm->execute($request);
// Send a notification to associated users
import('classes.notification.NotificationManager');
$notificationManager = new NotificationManager();
$notificationUsers = $article->getAssociatedUserIds();
foreach ($notificationUsers as $userRole) {
$notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_METADATA_MODIFIED, $article->getJournalId(), ASSOC_TYPE_ARTICLE, $article->getId());
}
// Add log entry
$user =& $request->getUser();
import('classes.article.log.ArticleLog');
ArticleLog::logEvent($request, $article, ARTICLE_LOG_METADATA_UPDATE, 'log.editor.metadataModified', array('editorName' => $user->getFullName()));
return true;
}
}
}
示例5: 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;
}
}
示例6: waiveSubmissionFee
/**
* Payments
*/
function waiveSubmissionFee($args, $request)
{
$articleId = (int) array_shift($args);
$markAsPaid = $request->getUserVar('markAsPaid');
$this->validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
$submission =& $this->submission;
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$user =& $request->getUser();
$journal =& $request->getJournal();
$queuedPayment =& $paymentManager->createQueuedPayment($journal->getId(), PAYMENT_TYPE_SUBMISSION, $markAsPaid ? $submission->getUserId() : $user->getId(), $articleId, $markAsPaid ? $journal->getSetting('submissionFee') : 0, $markAsPaid ? $journal->getSetting('currency') : '');
// Since this is a waiver, fulfill the payment immediately
$paymentManager->fulfillQueuedPayment($queuedPayment, $markAsPaid ? 'ManualPayment' : 'Waiver');
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON));
if ($markAsPaid) {
$message = 'log.editor.fee.paid';
} else {
$message = 'log.editor.fee.waived';
}
ArticleLog::logEvent($submission->getArticleId(), ARTICLE_LOG_SECTION_DECISION, ARTICLE_LOG_TYPE_EDITOR, $user->getId(), $message, array('editorName' => $user->getFullName(), 'proposalId' => $submission->getProposalId()));
$request->redirect(null, null, 'submissionReview', $articleId);
}
示例7: copyeditUnderway
/**
* Set that the copyedit is underway.
*/
function copyeditUnderway(&$copyeditorSubmission)
{
if (!HookRegistry::call('CopyeditorAction::copyeditUnderway', array(&$copyeditorSubmission))) {
$copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
if ($copyeditorSubmission->getDateNotified() != null && $copyeditorSubmission->getDateUnderway() == null) {
$copyeditorSubmission->setDateUnderway(Core::getCurrentDate());
$update = true;
} elseif ($copyeditorSubmission->getDateFinalNotified() != null && $copyeditorSubmission->getDateFinalUnderway() == null) {
$copyeditorSubmission->setDateFinalUnderway(Core::getCurrentDate());
$update = true;
}
if (isset($update)) {
$copyeditorSubmissionDao->updateCopyeditorSubmission($copyeditorSubmission);
// Add log entry
$user =& Request::getUser();
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($copyeditorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_INITIATE, ARTICLE_LOG_TYPE_COPYEDIT, $user->getUserId(), 'log.copyedit.initiate', array('copyeditorName' => $user->getFullName(), 'articleId' => $copyeditorSubmission->getArticleId()));
}
}
}
示例8: submission
/**
* Display a summary of the status of an author's submission.
*/
function submission($args)
{
$journal =& Request::getJournal();
$user =& Request::getUser();
$articleId = isset($args[0]) ? (int) $args[0] : 0;
$this->validate($articleId);
$submission =& $this->submission;
$this->setupTemplate(true, $articleId);
$articleDao =& DAORegistry::getDAO('ArticleDAO');
if (Request::getUserVar("archive")) {
$article = $articleDao->getArticle($articleId);
$article->setStatus(STATUS_ARCHIVED);
$article->stampStatusModified();
$articleDao->updateArticle($article);
// Add log
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($articleId, ARTICLE_LOG_EDITOR_ARCHIVE, ARTICLE_LOG_TYPE_EDITOR, $articleId, 'log.editor.archived', array('articleId' => $articleId));
}
$journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
$journalSettings = $journalSettingsDao->getJournalSettings($journal->getId());
// Setting the round.
$round = isset($args[1]) ? $args[1] : $submission->getCurrentRound();
$templateMgr =& TemplateManager::getManager();
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($submission->getArticleId());
if ($publishedArticle) {
$issueDao =& DAORegistry::getDAO('IssueDAO');
$issue =& $issueDao->getIssueById($publishedArticle->getIssueId());
$templateMgr->assign_by_ref('issue', $issue);
}
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$section =& $sectionDao->getSection($submission->getSectionId());
$templateMgr->assign_by_ref('section', $section);
$templateMgr->assign_by_ref('journalSettings', $journalSettings);
$templateMgr->assign_by_ref('submission', $submission);
$templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
$templateMgr->assign_by_ref('reviewAssignments', $submission->getReviewAssignments($round));
$templateMgr->assign('round', $round);
$templateMgr->assign_by_ref('submissionFile', $submission->getSubmissionFile());
$templateMgr->assign_by_ref('revisedFile', $submission->getRevisedFile());
$templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
$authorSubmisionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission = $authorSubmisionDao->getAuthorSubmission($articleId);
if ($authorSubmission->getSubmissionStatus() == STATUS_QUEUED_EDITING) {
$templateMgr->assign_by_ref('proofView', $proofView = 1);
}
//%CBP% Pass repository URL also
//TODO: Update to get different file versions also (include ED)
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
$submission->getAuthorFileRevisions($submission->getCurrentRound());
if ($submission->getRevisedFile()) {
$submissionFile = $submission->getRevisedFile();
} else {
$submissionFile = $submission->getSubmissionFile();
}
$editorDecisions = $submission->getDecisions($submission->getCurrentRound());
$lastDecision = count($editorDecisions) >= 1 ? $editorDecisions[count($editorDecisions) - 1] : null;
if ($submissionFile) {
$fileId = $submissionFile->getFileId();
$object = $CBPPlatformDao->getFedoraObjectInformation($fileId);
$objectPid = $object['fedora_namespace'] . ":" . $object['fedora_pid'];
$templateMgr->assign_by_ref('repositoryObjectPid', $objectPid);
$objectDsid = $object['fedora_dsid'];
$templateMgr->assign_by_ref('repositoryObjectDsid', $objectDsid);
}
$templateMgr->assign('lastEditorDecision', $lastDecision['decision']);
import('classes.submission.sectionEditor.SectionEditorSubmission');
$templateMgr->assign_by_ref('editorDecisionOptions', SectionEditorSubmission::getEditorDecisionOptions());
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
$templateMgr->assign('authorFees', true);
$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
if ($paymentManager->submissionEnabled()) {
$templateMgr->assign_by_ref('submissionPayment', $completedPaymentDAO->getSubmissionCompletedPayment($journal->getId(), $articleId));
}
if ($paymentManager->fastTrackEnabled()) {
$templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment($journal->getId(), $articleId));
}
if ($paymentManager->publicationEnabled()) {
$templateMgr->assign_by_ref('publicationPayment', $completedPaymentDAO->getPublicationCompletedPayment($journal->getId(), $articleId));
}
}
$templateMgr->assign('helpTopicId', 'editorial.authorsRole');
$initialCopyeditSignoff = $submission->getSignoff('SIGNOFF_COPYEDITING_INITIAL');
$templateMgr->assign('canEditMetadata', !$initialCopyeditSignoff->getDateCompleted() && $submission->getStatus() != STATUS_PUBLISHED);
$templateMgr->display('author/submission.tpl');
}
示例9: expediteSubmission
/**
* Rush a new submission into the end of the editing queue.
* @param $article object
*/
function expediteSubmission($article)
{
$user =& Request::getUser();
import('submission.editor.EditorAction');
import('submission.sectionEditor.SectionEditorAction');
import('submission.proofreader.ProofreaderAction');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
$submissionFile = $sectionEditorSubmission->getSubmissionFile();
// Add a long entry before doing anything.
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($article->getArticleId(), ARTICLE_LOG_EDITOR_EXPEDITE, ARTICLE_LOG_TYPE_EDITOR, $user->getUserId(), 'log.editor.submissionExpedited', array('editorName' => $user->getFullName(), 'articleId' => $article->getArticleId()));
// 1. Ensure that an editor is assigned.
$editAssignments =& $sectionEditorSubmission->getEditAssignments();
if (empty($editAssignments)) {
// No editors are currently assigned; assign self.
EditorAction::assignEditor($article->getArticleId(), $user->getUserId(), true);
}
// 2. Accept the submission and send to copyediting.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
if (!$sectionEditorSubmission->getCopyeditFile()) {
SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT);
$reviewFile = $sectionEditorSubmission->getReviewFile();
SectionEditorAction::setCopyeditFile($sectionEditorSubmission, $reviewFile->getFileId(), $reviewFile->getRevision());
}
// 3. Add a galley.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
$galleys =& $sectionEditorSubmission->getGalleys();
if (empty($galleys)) {
// No galley present -- use copyediting file.
import('file.ArticleFileManager');
$copyeditFile =& $sectionEditorSubmission->getCopyeditFile();
$fileType = $copyeditFile->getFileType();
$articleFileManager =& new ArticleFileManager($article->getArticleId());
$fileId = $articleFileManager->copyPublicFile($copyeditFile->getFilePath(), $fileType);
if (strstr($fileType, 'html')) {
$galley =& new ArticleHTMLGalley();
} else {
$galley =& new ArticleGalley();
}
$galley->setArticleId($article->getArticleId());
$galley->setFileId($fileId);
$galley->setLocale(Locale::getLocale());
if ($galley->isHTMLGalley()) {
$galley->setLabel('HTML');
} else {
if (strstr($fileType, 'pdf')) {
$galley->setLabel('PDF');
} else {
if (strstr($fileType, 'postscript')) {
$galley->setLabel('Postscript');
} else {
if (strstr($fileType, 'xml')) {
$galley->setLabel('XML');
} else {
$galley->setLabel(Locale::translate('common.untitled'));
}
}
}
}
$galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$galleyDao->insertGalley($galley);
}
$sectionEditorSubmission->setStatus(STATUS_QUEUED);
$sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
}
示例10: 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;
}
}
示例11: saveMetadata
//.........这里部分代码省略.........
// Check for any special cases before trying to save
if ($request->getUserVar('addAuthor')) {
// Add an author
$editData = true;
$authors = $metadataForm->getData('authors');
array_push($authors, array());
$metadataForm->setData('authors', $authors);
} else {
if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) {
// Delete an author
$editData = true;
list($delAuthor) = array_keys($delAuthor);
$delAuthor = (int) $delAuthor;
$authors = $metadataForm->getData('authors');
if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) {
$deletedAuthors = explode(':', $metadataForm->getData('deletedAuthors'));
array_push($deletedAuthors, $authors[$delAuthor]['authorId']);
$metadataForm->setData('deletedAuthors', join(':', $deletedAuthors));
}
array_splice($authors, $delAuthor, 1);
$metadataForm->setData('authors', $authors);
if ($metadataForm->getData('primaryContact') == $delAuthor) {
$metadataForm->setData('primaryContact', 0);
}
} else {
if ($request->getUserVar('moveAuthor')) {
// Move an author up/down
$editData = true;
$moveAuthorDir = $request->getUserVar('moveAuthorDir');
$moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd';
$moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex');
$authors = $metadataForm->getData('authors');
if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) {
$tmpAuthor = $authors[$moveAuthorIndex];
$primaryContact = $metadataForm->getData('primaryContact');
if ($moveAuthorDir == 'u') {
$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1];
$authors[$moveAuthorIndex - 1] = $tmpAuthor;
if ($primaryContact == $moveAuthorIndex) {
$metadataForm->setData('primaryContact', $moveAuthorIndex - 1);
} else {
if ($primaryContact == $moveAuthorIndex - 1) {
$metadataForm->setData('primaryContact', $moveAuthorIndex);
}
}
} else {
$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1];
$authors[$moveAuthorIndex + 1] = $tmpAuthor;
if ($primaryContact == $moveAuthorIndex) {
$metadataForm->setData('primaryContact', $moveAuthorIndex + 1);
} else {
if ($primaryContact == $moveAuthorIndex + 1) {
$metadataForm->setData('primaryContact', $moveAuthorIndex);
}
}
}
}
$metadataForm->setData('authors', $authors);
}
}
}
if (isset($editData)) {
$metadataForm->display();
return false;
} else {
if (!$metadataForm->validate()) {
return $metadataForm->display();
}
$metadataForm->execute($request);
// Send a notification to associated users
import('lib.pkp.classes.notification.NotificationManager');
$notificationManager = new NotificationManager();
$notificationUsers = $article->getAssociatedUserIds();
foreach ($notificationUsers as $userRole) {
$url = $router->url($request, null, $userRole['role'], 'submission', $article->getId(), null, 'metadata');
$notificationManager->createNotification($userRole['id'], 'notification.type.metadataModified', $article->getProposalId(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED);
}
//Added by AIM, Jan 20, 2012
$notificationUsers = array();
$roleDao =& DAORegistry::getDAO('RoleDAO');
$editors = $roleDao->getUsersByRoleId(ROLE_ID_EDITOR);
while (!$editors->eof()) {
$editor =& $editors->next();
$notificationUsers[] = array('id' => $editor->getId(), 'role' => $roleDao->getRolePath(ROLE_ID_EDITOR));
unset($editor);
}
//print_r($notificationUsers); die();
foreach ($notificationUsers as $userRole) {
$url = $router->url($request, null, $userRole['role'], 'submission', $article->getId(), null, 'metadata');
$notificationManager->createNotification($userRole['id'], 'notification.type.metadataModified', $article->getProposalId(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED);
}
// Add log entry
$user =& $request->getUser();
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
ArticleLog::logEvent($article->getId(), ARTICLE_LOG_METADATA_UPDATE, ARTICLE_LOG_TYPE_DEFAULT, 0, 'log.editor.metadataModified', array('editorName' => $user->getFullName()));
return true;
}
}
}
示例12: uploadReviewerVersion
/**
* Upload the annotated version of an article.
* @param $reviewId int
* @param $reviewerSubmission object
* @param $request object
*/
function uploadReviewerVersion($reviewId, $reviewerSubmission, $request)
{
import('classes.file.ArticleFileManager');
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment =& $reviewAssignmentDao->getById($reviewId);
$articleFileManager = new ArticleFileManager($reviewAssignment->getSubmissionId());
// Only upload the file if the reviewer has yet to submit a recommendation
// and if review forms are not used
if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) {
$fileName = 'upload';
if ($articleFileManager->uploadedFileExists($fileName)) {
HookRegistry::call('ReviewerAction::uploadReviewFile', array(&$reviewAssignment));
if ($reviewAssignment->getReviewerFileId() != null) {
$fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getReviewerFileId());
} else {
$fileId = $articleFileManager->uploadReviewFile($fileName);
}
}
}
if (isset($fileId) && $fileId != 0) {
$reviewAssignment->setReviewerFileId($fileId);
$reviewAssignment->stampModified();
$reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
$userDao =& DAORegistry::getDAO('UserDAO');
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
// Add log
import('classes.article.log.ArticleLog');
ArticleLog::logEvent($request, $reviewerSubmission, ARTICLE_LOG_REVIEW_FILE, 'log.review.reviewerFile', array('reviewId' => $reviewAssignment->getId()));
}
}
示例13: assignLayoutEditor
/**
* Assign a layout editor to a submission.
* @param $submission object
* @param $editorId int user ID of the new layout editor
*/
function assignLayoutEditor($submission, $editorId)
{
if (HookRegistry::call('SectionEditorAction::assignLayoutEditor', array(&$submission, &$editorId))) {
return;
}
$layoutAssignment =& $submission->getLayoutAssignment();
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
if ($layoutAssignment->getEditorId()) {
ArticleLog::logEvent($submission->getArticleId(), ARTICLE_LOG_LAYOUT_UNASSIGN, ARTICLE_LOG_TYPE_LAYOUT, $layoutAssignment->getLayoutId(), 'log.layout.layoutEditorUnassigned', array('editorName' => $layoutAssignment->getEditorFullName(), 'articleId' => $submission->getArticleId()));
}
$layoutAssignment->setEditorId($editorId);
$layoutAssignment->setDateNotified(null);
$layoutAssignment->setDateUnderway(null);
$layoutAssignment->setDateCompleted(null);
$layoutAssignment->setDateAcknowledged(null);
$layoutDao =& DAORegistry::getDAO('LayoutAssignmentDAO');
$layoutDao->updateLayoutAssignment($layoutAssignment);
$layoutAssignment =& $layoutDao->getLayoutAssignmentById($layoutAssignment->getLayoutId());
ArticleLog::logEvent($submission->getArticleId(), ARTICLE_LOG_LAYOUT_ASSIGN, ARTICLE_LOG_TYPE_LAYOUT, $layoutAssignment->getLayoutId(), 'log.layout.layoutEditorAssigned', array('editorName' => $layoutAssignment->getEditorFullName(), 'articleId' => $submission->getArticleId()));
}
示例14: execute
//.........这里部分代码省略.........
$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';
} else {
$message = 'notification.type.articleReSubmitted.continuingReview';
}
break;
case REVIEW_TYPE_AMENDMENT:
if ($lastDecision->getRound() == 1) {
$message = 'notification.type.articleSubmitted.PAAmendmentReview';
} else {
$message = 'notification.type.articleReSubmitted.PAAmendmentReview';
}
break;
case REVIEW_TYPE_SAE:
if ($lastDecision->getRound() == 1) {
$message = 'notification.type.articleSubmitted.SAE';
} else {
$message = 'notification.type.articleReSubmitted.SAE';
}
break;
case REVIEW_TYPE_FR:
if ($lastDecision->getRound() == 1) {
$message = 'notification.type.articleSubmitted.EOS';
} else {
$message = 'notification.type.articleReSubmitted.EOS';
}
break;
}
import('lib.pkp.classes.notification.NotificationManager');
$notificationManager = new NotificationManager();
$url = Request::url($journal->getPath(), 'sectionEditor', 'submission', array($article->getId(), 'submissionReview'));
foreach ($sectionEditors as $sectionEditor) {
$notificationManager->createNotification($sectionEditor->getId(), $message, $article->getProposalId(), $url, 1, NOTIFICATION_TYPE_ARTICLE_SUBMITTED);
}
import('classes.article.log.ArticleLog');
import('classes.article.log.ArticleEventLogEntry');
if ($lastDecision->getRound() == 1) {
$message = 'log.author.submitted';
} else {
$message = 'log.author.resubmitted';
}
ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), $message, array('submissionId' => $article->getProposalId(), 'authorName' => $user->getFullName(), 'reviewType' => Locale::translate($lastDecision->getReviewTypeKey())));
return $this->articleId;
}
示例15: completeAuthorCopyedit
/**
* Author completes editor / author review.
* @param $authorSubmission object
*/
function completeAuthorCopyedit($authorSubmission, $send = false)
{
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& Request::getJournal();
if ($authorSubmission->getCopyeditorDateAuthorCompleted() != null) {
return true;
}
$user =& Request::getUser();
import('mail.ArticleMailTemplate');
$email =& new ArticleMailTemplate($authorSubmission, 'COPYEDIT_AUTHOR_COMPLETE');
$editAssignments = $authorSubmission->getEditAssignments();
$copyeditor =& $authorSubmission->getCopyeditor();
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('AuthorAction::completeAuthorCopyedit', array(&$authorSubmission, &$email));
if ($email->isEnabled()) {
$email->setAssoc(ARTICLE_EMAIL_COPYEDIT_NOTIFY_AUTHOR_COMPLETE, ARTICLE_EMAIL_TYPE_COPYEDIT, $authorSubmission->getArticleId());
$email->send();
}
$authorSubmission->setCopyeditorDateAuthorCompleted(Core::getCurrentDate());
$authorSubmission->setCopyeditorDateFinalNotified(Core::getCurrentDate());
$authorSubmissionDao->updateAuthorSubmission($authorSubmission);
// Add log entry
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($authorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_REVISION, ARTICLE_LOG_TYPE_AUTHOR, $user->getUserId(), 'log.copyedit.authorFile');
return true;
} else {
if (!Request::getUserVar('continued')) {
if (isset($copyeditor)) {
$email->addRecipient($copyeditor->getEmail(), $copyeditor->getFullName());
$assignedSectionEditors = $email->ccAssignedEditingSectionEditors($authorSubmission->getArticleId());
$assignedEditors = $email->ccAssignedEditors($authorSubmission->getArticleId());
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->getArticleId());
$assignedEditors = $email->ccAssignedEditors($authorSubmission->getArticleId());
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->getArticleId()));
return false;
}
}