当前位置: 首页>>代码示例>>PHP>>正文


PHP ArticleLog::logEventEntry方法代码示例

本文整理汇总了PHP中ArticleLog::logEventEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleLog::logEventEntry方法的具体用法?PHP ArticleLog::logEventEntry怎么用?PHP ArticleLog::logEventEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArticleLog的用法示例。


在下文中一共展示了ArticleLog::logEventEntry方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: logEventLevel

 /**
  * Add a new event log entry with the specified parameters, including log level.
  * @param $articleId int
  * @param $logLevel char
  * @param $eventType int
  * @param $assocType int
  * @param $assocId int
  * @param $messageKey string
  * @param $messageParams array
  */
 function logEventLevel($articleId, $logLevel, $eventType, $assocType = 0, $assocId = 0, $messageKey = null, $messageParams = array())
 {
     $entry =& new ArticleEventLogEntry();
     $entry->setLogLevel($logLevel);
     $entry->setEventType($eventType);
     $entry->setAssocType($assocType);
     $entry->setAssocId($assocId);
     if (isset($messageKey)) {
         $entry->setLogMessage($messageKey, $messageParams);
     }
     return ArticleLog::logEventEntry($articleId, $entry);
 }
开发者ID:Jouper,项目名称:jouper,代码行数:22,代码来源:ArticleLog.inc.php

示例2: uploadCopyeditVersion

 /**
  * Upload the copyedited version of an article.
  * @param $copyeditorSubmission object
  */
 function uploadCopyeditVersion($copyeditorSubmission, $copyeditStage)
 {
     import("file.ArticleFileManager");
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     // Only allow an upload if they're in the initial or final copyediting
     // stages.
     if ($copyeditStage == 'initial' && ($copyeditorSubmission->getDateNotified() == null || $copyeditorSubmission->getDateCompleted() != null)) {
         return;
     } else {
         if ($copyeditStage == 'final' && ($copyeditorSubmission->getDateFinalNotified() == null || $copyeditorSubmission->getDateFinalCompleted() != null)) {
             return;
         } else {
             if ($copyeditStage != 'initial' && $copyeditStage != 'final') {
                 return;
             }
         }
     }
     $articleFileManager =& new ArticleFileManager($copyeditorSubmission->getArticleId());
     $user =& Request::getUser();
     $fileName = 'upload';
     if ($articleFileManager->uploadedFileExists($fileName)) {
         HookRegistry::call('CopyeditorAction::uploadCopyeditVersion', array(&$copyeditorSubmission));
         if ($copyeditorSubmission->getCopyeditFileId() != null) {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName, $copyeditorSubmission->getCopyeditFileId());
         } else {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName);
         }
     }
     if (isset($fileId) && $fileId != 0) {
         $copyeditorSubmission->setCopyeditFileId($fileId);
         if ($copyeditStage == 'initial') {
             $copyeditorSubmission->setInitialRevision($articleFileDao->getRevisionNumber($fileId));
         } elseif ($copyeditStage == 'final') {
             $copyeditorSubmission->setFinalRevision($articleFileDao->getRevisionNumber($fileId));
         }
         $copyeditorSubmissionDao->updateCopyeditorSubmission($copyeditorSubmission);
         // Add log
         import('article.log.ArticleLog');
         import('article.log.ArticleEventLogEntry');
         $entry =& new ArticleEventLogEntry();
         $entry->setArticleId($copyeditorSubmission->getArticleId());
         $entry->setUserId($user->getUserId());
         $entry->setDateLogged(Core::getCurrentDate());
         $entry->setEventType(ARTICLE_LOG_COPYEDIT_COPYEDITOR_FILE);
         $entry->setLogMessage('log.copyedit.copyeditorFile');
         $entry->setAssocType(ARTICLE_LOG_TYPE_COPYEDIT);
         $entry->setAssocId($fileId);
         ArticleLog::logEventEntry($copyeditorSubmission->getArticleId(), $entry);
     }
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:55,代码来源:CopyeditorAction.inc.php

示例3: uploadReviewerVersion

 /**
  * Upload the annotated version of an article.
  * @param $reviewId int
  */
 function uploadReviewerVersion($reviewId)
 {
     import('classes.file.ArticleFileManager');
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
     $reviewAssignment =& $reviewAssignmentDao->getById($reviewId);
     $sectionDecision =& $sectionDecisionDao->getSectionDecision($reviewAssignment->getDecisionId());
     $articleFileManager = new ArticleFileManager($sectionDecision->getArticleId());
     // 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)) {
             // Check if file already uploaded
             $reviewFile =& $reviewAssignment->getReviewerFile();
             if ($reviewFile != null) {
                 $articleFileManager->deleteFile($reviewFile->getFileId());
             }
             HookRegistry::call('ReviewerAction::uploadReviewFile', array(&$reviewAssignment));
             if ($reviewAssignment->getReviewerFileId() != null) {
                 $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getDecisionId(), $reviewAssignment->getReviewerFileId());
             } else {
                 $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getDecisionId());
             }
         }
     }
     if (isset($fileId) && $fileId != 0) {
         $reviewAssignment->setReviewerFileId($fileId);
         $reviewAssignment->stampModified();
         $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
         // Add log
         import('classes.article.log.ArticleLog');
         import('classes.article.log.ArticleEventLogEntry');
         $userDao =& DAORegistry::getDAO('UserDAO');
         $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
         $entry = new ArticleEventLogEntry();
         $entry->setArticleId($sectionDecision->getArticleId());
         $entry->setUserId($reviewer->getId());
         $entry->setDateLogged(Core::getCurrentDate());
         $entry->setEventType(ARTICLE_LOG_REVIEW_FILE);
         $entry->setLogLevel('N');
         $entry->setLogMessage('log.review.reviewerFile');
         $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW);
         $entry->setAssocId($reviewAssignment->getId());
         ArticleLog::logEventEntry($sectionDecision->getArticleId(), $entry);
         //Send a notification to section editors
         import('lib.pkp.classes.notification.NotificationManager');
         $articleDao =& DAORegistry::getDAO('ArticleDAO');
         $article =& $articleDao->getArticle($sectionDecision->getArticleId());
         $notificationManager = new NotificationManager();
         $notificationUsers = $article->getAssociatedUserIds(false, false);
         $user =& Request::getUser();
         $message = $article->getProposalId() . ':<br/>' . $user->getUsername();
         foreach ($notificationUsers as $userRole) {
             $url = Request::url(null, $userRole['role'], 'submission', array($article->getId(), 'submissionReview'), null, 'peerReview');
             $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerFile', $message, $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT);
         }
     }
 }
开发者ID:elavaud,项目名称:hrp_ct,代码行数:63,代码来源:ReviewerAction.inc.php

示例4: uploadReviewForReviewer

 /**
  * Upload a review on behalf of its reviewer.
  * @param $reviewId int
  */
 function uploadReviewForReviewer($reviewId)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $user =& Request::getUser();
     $reviewAssignment =& $reviewAssignmentDao->getById($reviewId);
     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId(), true);
     if (HookRegistry::call('SectionEditorAction::uploadReviewForReviewer', array(&$reviewAssignment, &$reviewer))) {
         return;
     }
     // Upload the review file.
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($reviewAssignment->getSubmissionId());
     // Only upload the file if the reviewer has yet to submit a recommendation
     if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) {
         $fileName = 'upload';
         if ($articleFileManager->uploadedFileExists($fileName)) {
             if ($reviewAssignment->getReviewerFileId() != null) {
                 $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getReviewerFileId());
             } else {
                 $fileId = $articleFileManager->uploadReviewFile($fileName);
             }
         }
     }
     if (isset($fileId) && $fileId != 0) {
         // Only confirm the review for the reviewer if
         // he has not previously done so.
         if ($reviewAssignment->getDateConfirmed() == null) {
             $reviewAssignment->setDeclined(0);
             $reviewAssignment->setDateConfirmed(Core::getCurrentDate());
         }
         $reviewAssignment->setReviewerFileId($fileId);
         $reviewAssignment->stampModified();
         $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
         // Add log
         import('classes.article.log.ArticleLog');
         import('classes.article.log.ArticleEventLogEntry');
         $entry = new ArticleEventLogEntry();
         $entry->setArticleId($reviewAssignment->getSubmissionId());
         $entry->setUserId($user->getId());
         $entry->setDateLogged(Core::getCurrentDate());
         $entry->setEventType(ARTICLE_LOG_REVIEW_FILE_BY_PROXY);
         $entry->setLogMessage('log.review.reviewFileByProxy', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewAssignment->getSubmissionId(), 'round' => $reviewAssignment->getRound(), 'userName' => $user->getFullName()));
         $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW);
         $entry->setAssocId($reviewAssignment->getId());
         ArticleLog::logEventEntry($reviewAssignment->getSubmissionId(), $entry);
     }
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:52,代码来源:SectionEditorAction.inc.php

示例5: uploadCopyeditVersion

 /**
  * Upload the copyedited version of an article.
  * @param $copyeditorSubmission object
  */
 function uploadCopyeditVersion($copyeditorSubmission, $copyeditStage)
 {
     import('classes.file.ArticleFileManager');
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     if ($copyeditStage == 'initial') {
         $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
     } else {
         if ($copyeditStage == 'final') {
             $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
         }
     }
     // Only allow an upload if they're in the initial or final copyediting
     // stages.
     if ($copyeditStage == 'initial' && ($signoff->getDateNotified() == null || $signoff->getDateCompleted() != null)) {
         return;
     } else {
         if ($copyeditStage == 'final' && ($signoff->getDateNotified() == null || $signoff->getDateCompleted() != null)) {
             return;
         } else {
             if ($copyeditStage != 'initial' && $copyeditStage != 'final') {
                 return;
             }
         }
     }
     $articleFileManager = new ArticleFileManager($copyeditorSubmission->getArticleId());
     $user =& Request::getUser();
     $fileName = 'upload';
     if ($articleFileManager->uploadedFileExists($fileName)) {
         HookRegistry::call('CopyeditorAction::uploadCopyeditVersion', array(&$copyeditorSubmission));
         if ($signoff->getFileId() != null) {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName, $copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true));
         } else {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName);
         }
     }
     if (isset($fileId) && $fileId != 0) {
         $signoff->setFileId($fileId);
         // No revision anymore
         //$signoff->setFileRevision($articleFileDao->getRevisionNumber($fileId));
         $signoffDao->updateObject($signoff);
         // Add log
         import('classes.article.log.ArticleLog');
         import('classes.article.log.ArticleEventLogEntry');
         $entry = new ArticleEventLogEntry();
         $entry->setArticleId($copyeditorSubmission->getArticleId());
         $entry->setUserId($user->getId());
         $entry->setDateLogged(Core::getCurrentDate());
         $entry->setEventType(ARTICLE_LOG_COPYEDIT_COPYEDITOR_FILE);
         $entry->setLogMessage('log.copyedit.copyeditorFile');
         $entry->setAssocType(ARTICLE_LOG_TYPE_COPYEDIT);
         $entry->setAssocId($fileId);
         ArticleLog::logEventEntry($copyeditorSubmission->getArticleId(), $entry);
     }
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:60,代码来源:CopyeditorAction.inc.php

示例6: uploadReviewerVersion

 /**
  * Upload the annotated version of an article.
  * @param $reviewId int
  */
 function uploadReviewerVersion($reviewId)
 {
     import("file.ArticleFileManager");
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignment =& $reviewAssignmentDao->getReviewAssignmentById($reviewId);
     $articleFileManager =& new ArticleFileManager($reviewAssignment->getArticleId());
     // 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);
         // Add log
         import('article.log.ArticleLog');
         import('article.log.ArticleEventLogEntry');
         $userDao =& DAORegistry::getDAO('UserDAO');
         $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
         $entry =& new ArticleEventLogEntry();
         $entry->setArticleId($reviewAssignment->getArticleId());
         $entry->setUserId($reviewer->getUserId());
         $entry->setDateLogged(Core::getCurrentDate());
         $entry->setEventType(ARTICLE_LOG_REVIEW_FILE);
         $entry->setLogMessage('log.review.reviewerFile');
         $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW);
         $entry->setAssocId($reviewAssignment->getReviewId());
         ArticleLog::logEventEntry($reviewAssignment->getArticleId(), $entry);
     }
 }
开发者ID:Jouper,项目名称:jouper,代码行数:43,代码来源:ReviewerAction.inc.php


注:本文中的ArticleLog::logEventEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。