execute() public method

Save changes to submission.
public execute ( $request )
$request PKPRequest
 /**
  * Save changes to submission.
  * @param $request PKPRequest
  */
 function execute($request)
 {
     parent::execute($request);
     $submission = $this->getSubmission();
     $submissionDao = Application::getSubmissionDAO();
     $submission->setSectionId($this->getData('sectionId'));
     // Copy an uploaded cover file for the article, if there is one.
     if ($temporaryFileId = $this->getData('temporaryFileId')) {
         $user = $request->getUser();
         $temporaryFileDao = DAORegistry::getDAO('TemporaryFileDAO');
         $temporaryFile = $temporaryFileDao->getTemporaryFile($temporaryFileId, $user->getId());
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $newFileName = 'article_' . $submission->getId() . '_cover' . $publicFileManager->getImageExtension($temporaryFile->getFileType());
         $journal = $request->getJournal();
         $publicFileManager->copyJournalFile($journal->getId(), $temporaryFile->getFilePath(), $newFileName);
         $submission->setCoverImage($newFileName);
     }
     $submission->setCoverImageAltText($this->getData('coverImageAltText'));
     $submissionDao->updateObject($submission);
     if ($submission->getDatePublished()) {
         import('classes.search.ArticleSearchIndex');
         ArticleSearchIndex::articleMetadataChanged($submission);
     }
 }
 /**
  * Save changes to submission.
  * @param $request PKPRequest
  */
 function execute($request)
 {
     parent::execute($request);
     $submission = $this->getSubmission();
     $submissionDao = Application::getSubmissionDAO();
     $submission->setSectionId($this->getData('sectionId'));
     $submissionDao->updateObject($submission);
     if ($submission->getDatePublished()) {
         import('classes.search.ArticleSearchIndex');
         ArticleSearchIndex::articleMetadataChanged($submission);
     }
 }
Esempio n. 3
0
 /**
  * Save changes to submission.
  * @param $request PKPRequest
  */
 function execute($request)
 {
     parent::execute($request);
     $submission = $this->getSubmission();
     $submissionDao = Application::getSubmissionDAO();
     // if section changed consider reordering
     $reorder = false;
     $oldSectionId = $submission->getSectionId();
     if ($oldSectionId != $this->getData('sectionId')) {
         $reorder = true;
         $submission->setSectionId($this->getData('sectionId'));
     }
     $locale = AppLocale::getLocale();
     // Copy an uploaded cover file for the article, if there is one.
     if ($temporaryFileId = $this->getData('temporaryFileId')) {
         $user = $request->getUser();
         $temporaryFileDao = DAORegistry::getDAO('TemporaryFileDAO');
         $temporaryFile = $temporaryFileDao->getTemporaryFile($temporaryFileId, $user->getId());
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $newFileName = 'article_' . $submission->getId() . '_cover_' . $locale . $publicFileManager->getImageExtension($temporaryFile->getFileType());
         $journal = $request->getJournal();
         $publicFileManager->copyJournalFile($journal->getId(), $temporaryFile->getFilePath(), $newFileName);
         $submission->setCoverImage($newFileName, $locale);
     }
     $submission->setCoverImageAltText($this->getData('coverImageAltText'), $locale);
     $submissionDao->updateObject($submission);
     if ($reorder) {
         // see if it is a published article
         $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
         $publishedArticle = $publishedArticleDao->getPublishedArticleByArticleId($submission->getId(), null, false);
         /* @var $publishedArticle PublishedArticle */
         if ($publishedArticle) {
             // Resequence the articles.
             $publishedArticle->setSequence(REALLY_BIG_NUMBER);
             $publishedArticleDao->updatePublishedArticle($publishedArticle);
             $publishedArticleDao->resequencePublishedArticles($submission->getSectionId(), $publishedArticle->getIssueId());
             // The reordering for the old section is not necessary, but for the correctness sake
             $publishedArticleDao->resequencePublishedArticles($oldSectionId, $publishedArticle->getIssueId());
         }
     }
     if ($submission->getDatePublished()) {
         import('classes.search.ArticleSearchIndex');
         ArticleSearchIndex::articleMetadataChanged($submission);
     }
 }
 /**
  * Save changes to submission.
  * @param $request PKPRequest
  */
 function execute($request)
 {
     parent::execute($request);
     $submission = $this->getSubmission();
     $submissionDao = Application::getSubmissionDAO();
     // Clean any new release or feature object that may
     // exist associated with the current submission series.
     $newReleaseDao = DAORegistry::getDAO('NewReleaseDAO');
     /* @var $newReleaseDao NewReleaseDAO */
     $newReleaseDao->deleteNewRelease($submission->getId(), ASSOC_TYPE_SERIES, $submission->getSeriesId());
     $featureDao = DAORegistry::getDAO('FeatureDAO');
     /* @var $featureDao FeatureDAO */
     $featureDao->deleteFeature($submission->getId(), ASSOC_TYPE_SERIES, $submission->getSeriesId());
     $submission->setSeriesId($this->getData('seriesId'));
     $submission->setSeriesPosition($this->getData('seriesPosition'));
     $submissionDao->updateObject($submission);
     if ($submission->getDatePublished()) {
         import('classes.search.MonographSearchIndex');
         MonographSearchIndex::indexMonographMetadata($submission);
     }
 }