Exemplo n.º 1
0
 /**
  * Delete a submission.
  * @param $args array
  * @param $request PKPRequest
  */
 function deleteSubmission($args, $request)
 {
     $articleId = (int) array_shift($args);
     $this->validate($request, $articleId);
     $authorSubmission =& $this->submission;
     $this->setupTemplate($request, true);
     // If the submission is incomplete, allow the author to delete it.
     if ($authorSubmission->getSubmissionProgress() != 0) {
         import('classes.file.ArticleFileManager');
         $articleFileManager = new ArticleFileManager($articleId);
         $articleFileManager->deleteArticleTree();
         $articleDao =& DAORegistry::getDAO('ArticleDAO');
         $articleDao->deleteArticleById($articleId);
         import('classes.search.ArticleSearchIndex');
         $articleSearchIndex = new ArticleSearchIndex();
         $articleSearchIndex->articleDeleted($articleId);
         $articleSearchIndex->articleChangesFinished();
     }
     $request->redirect(null, null, 'index');
 }
Exemplo n.º 2
0
 /**
  * @copydoc Submission::deleteById
  */
 function deleteById($submissionId)
 {
     parent::deleteById($submissionId);
     $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticleDao->deletePublishedArticleByArticleId($submissionId);
     $articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO');
     $articleGalleyDao->deleteByArticleId($submissionId);
     $articleSearchDao = DAORegistry::getDAO('ArticleSearchDAO');
     $articleSearchDao->deleteSubmissionKeywords($submissionId);
     // Delete article citations.
     $citationDao = DAORegistry::getDAO('CitationDAO');
     $citationDao->deleteObjectsByAssocId(ASSOC_TYPE_ARTICLE, $submissionId);
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->articleDeleted($submissionId);
     $articleSearchIndex->articleChangesFinished();
     $this->flushCache();
 }
Exemplo n.º 3
0
 /**
  * Delete an article by ID.
  * @param $articleId int
  */
 function deleteArticleById($articleId)
 {
     $this->authorDao->deleteAuthorsByArticle($articleId);
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticleDao->deletePublishedArticleByArticleId($articleId);
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $commentDao->deleteBySubmissionId($articleId);
     $noteDao =& DAORegistry::getDAO('NoteDAO');
     $noteDao->deleteByAssoc(ASSOC_TYPE_ARTICLE, $articleId);
     $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
     $sectionEditorSubmissionDao->deleteDecisionsByArticle($articleId);
     $sectionEditorSubmissionDao->deleteReviewRoundsByArticle($articleId);
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignmentDao->deleteBySubmissionId($articleId);
     $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
     $editAssignmentDao->deleteEditAssignmentsByArticle($articleId);
     // Delete copyedit, layout, and proofread signoffs
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $copyedInitialSignoffs = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $articleId);
     $copyedAuthorSignoffs = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId);
     $copyedFinalSignoffs = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $articleId);
     $layoutSignoffs = $signoffDao->getBySymbolic('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $articleId);
     $proofreadAuthorSignoffs = $signoffDao->getBySymbolic('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId);
     $proofreadProofreaderSignoffs = $signoffDao->getBySymbolic('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $articleId);
     $proofreadLayoutSignoffs = $signoffDao->getBySymbolic('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $articleId);
     $signoffs = array($copyedInitialSignoffs, $copyedAuthorSignoffs, $copyedFinalSignoffs, $layoutSignoffs, $proofreadAuthorSignoffs, $proofreadProofreaderSignoffs, $proofreadLayoutSignoffs);
     foreach ($signoffs as $signoff) {
         if ($signoff) {
             $signoffDao->deleteObject($signoff);
         }
     }
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $articleCommentDao->deleteArticleComments($articleId);
     $articleGalleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $articleGalleyDao->deleteGalleysByArticle($articleId);
     $articleSearchDao =& DAORegistry::getDAO('ArticleSearchDAO');
     $articleSearchDao->deleteArticleKeywords($articleId);
     $articleEventLogDao =& DAORegistry::getDAO('ArticleEventLogDAO');
     $articleEventLogDao->deleteByAssoc(ASSOC_TYPE_ARTICLE, $articleId);
     $articleEmailLogDao =& DAORegistry::getDAO('ArticleEmailLogDAO');
     $articleEmailLogDao->deleteByAssoc(ASSOC_TYPE_ARTICLE, $articleId);
     $notificationDao =& DAORegistry::getDAO('NotificationDAO');
     $notificationDao->deleteByAssoc(ASSOC_TYPE_ARTICLE, $articleId);
     $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
     $suppFileDao->deleteSuppFilesByArticle($articleId);
     // Delete article files -- first from the filesystem, then from the database
     import('classes.file.ArticleFileManager');
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $articleFiles =& $articleFileDao->getArticleFilesByArticle($articleId);
     $articleFileManager = new ArticleFileManager($articleId);
     foreach ($articleFiles as $articleFile) {
         $articleFileManager->deleteFile($articleFile->getFileId());
     }
     $articleFileDao->deleteArticleFiles($articleId);
     // Delete article citations.
     $citationDao =& DAORegistry::getDAO('CitationDAO');
     $citationDao->deleteObjectsByAssocId(ASSOC_TYPE_ARTICLE, $articleId);
     $this->update('DELETE FROM article_settings WHERE article_id = ?', $articleId);
     $this->update('DELETE FROM articles WHERE article_id = ?', $articleId);
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->articleDeleted($articleId);
     $articleSearchIndex->articleChangesFinished();
     $this->flushCache();
 }
Exemplo n.º 4
0
 /**
  * Delete an article by ID.
  * @param $articleId int
  */
 function deleteById($articleId)
 {
     parent::deleteById($articleId);
     $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticleDao->deletePublishedArticleByArticleId($articleId);
     $articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO');
     $articleGalleyDao->deleteGalleysByArticle($articleId);
     $articleSearchDao = DAORegistry::getDAO('ArticleSearchDAO');
     $articleSearchDao->deleteSubmissionKeywords($articleId);
     $commentDao = DAORegistry::getDAO('CommentDAO');
     $commentDao->deleteBySubmissionId($submissionId);
     // Delete article files -- first from the filesystem, then from the database
     import('classes.file.ArticleFileManager');
     $articleFileDao = DAORegistry::getDAO('ArticleFileDAO');
     $articleFiles = $articleFileDao->getArticleFilesByArticle($articleId);
     $articleFileManager = new ArticleFileManager($articleId);
     foreach ($articleFiles as $articleFile) {
         $articleFileManager->deleteFile($articleFile->getFileId());
     }
     $articleFileDao->deleteArticleFiles($articleId);
     // Delete article citations.
     $citationDao = DAORegistry::getDAO('CitationDAO');
     $citationDao->deleteObjectsByAssocId(ASSOC_TYPE_ARTICLE, $articleId);
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->articleDeleted($articleId);
     $articleSearchIndex->articleChangesFinished();
     $this->flushCache();
 }