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


PHP ArticleFileManager::copyToLayoutFile方法代码示例

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


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

示例1: completeFinalCopyedit

 /**
  * Section editor completes final copyedit (copyeditors disabled).
  * @param $sectionEditorSubmission object
  * @param $request object
  */
 function completeFinalCopyedit($sectionEditorSubmission, $request)
 {
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     // This is only allowed if copyeditors are disabled.
     if ($journal->getSetting('useCopyeditors')) {
         return;
     }
     if (HookRegistry::call('SectionEditorAction::completeFinalCopyedit', array(&$sectionEditorSubmission))) {
         return;
     }
     $copyeditSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $sectionEditorSubmission->getId());
     $copyeditSignoff->setDateCompleted(Core::getCurrentDate());
     $signoffDao->updateObject($copyeditSignoff);
     if ($copyEdFile = $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL')) {
         // Set initial layout version to final copyedit version
         $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $sectionEditorSubmission->getId());
         if (!$layoutSignoff->getFileId()) {
             import('classes.file.ArticleFileManager');
             $articleFileManager = new ArticleFileManager($sectionEditorSubmission->getId());
             if ($layoutFileId = $articleFileManager->copyToLayoutFile($copyEdFile->getFileId(), $copyEdFile->getRevision())) {
                 $layoutSignoff->setFileId($layoutFileId);
                 $signoffDao->updateObject($layoutSignoff);
             }
         }
     }
     // Add log entry
     import('classes.article.log.ArticleLog');
     ArticleLog::logEvent($request, $sectionEditorSubmission, ARTICLE_LOG_COPYEDIT_FINAL, 'log.copyedit.finalEditComplete', array('copyeditorName' => $user->getFullName()));
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:37,代码来源:SectionEditorAction.inc.php

示例2: 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;
     }
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:64,代码来源:CopyeditorAction.inc.php


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