Ejemplo n.º 1
0
 /**
  * Display section editor index page.
  */
 function index($args)
 {
     SectionEditorHandler::validate();
     SectionEditorHandler::setupTemplate();
     $journal =& Request::getJournal();
     $user =& Request::getUser();
     $rangeInfo = Handler::getRangeInfo('submissions');
     // Get the user's search conditions, if any
     $searchField = Request::getUserVar('searchField');
     $dateSearchField = Request::getUserVar('dateSearchField');
     $searchMatch = Request::getUserVar('searchMatch');
     $search = Request::getUserVar('search');
     $fromDate = Request::getUserDateVar('dateFrom', 1, 1);
     if ($fromDate !== null) {
         $fromDate = date('Y-m-d H:i:s', $fromDate);
     }
     $toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
     if ($toDate !== null) {
         $toDate = date('Y-m-d H:i:s', $toDate);
     }
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
     $page = isset($args[0]) ? $args[0] : '';
     $sections =& $sectionDao->getSectionTitles($journal->getJournalId());
     switch ($page) {
         case 'submissionsInEditing':
             $functionName = 'getSectionEditorSubmissionsInEditing';
             $helpTopicId = 'editorial.sectionEditorsRole.submissions.inEditing';
             break;
         case 'submissionsArchives':
             $functionName = 'getSectionEditorSubmissionsArchives';
             $helpTopicId = 'editorial.sectionEditorsRole.submissions.archives';
             break;
         default:
             $page = 'submissionsInReview';
             $functionName = 'getSectionEditorSubmissionsInReview';
             $helpTopicId = 'editorial.sectionEditorsRole.submissions.inReview';
     }
     $submissions =& $sectionEditorSubmissionDao->{$functionName}($user->getUserId(), $journal->getJournalId(), Request::getUserVar('section'), $searchField, $searchMatch, $search, $dateSearchField, $fromDate, $toDate, $rangeInfo);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('helpTopicId', $helpTopicId);
     $templateMgr->assign('sectionOptions', array(0 => Locale::Translate('editor.allSections')) + $sections);
     $templateMgr->assign_by_ref('submissions', $submissions);
     $templateMgr->assign('section', Request::getUserVar('section'));
     $templateMgr->assign('pageToDisplay', $page);
     $templateMgr->assign('sectionEditor', $user->getFullName());
     // Set search parameters
     $duplicateParameters = array('searchField', 'searchMatch', 'search', 'dateFromMonth', 'dateFromDay', 'dateFromYear', 'dateToMonth', 'dateToDay', 'dateToYear', 'dateSearchField');
     foreach ($duplicateParameters as $param) {
         $templateMgr->assign($param, Request::getUserVar($param));
     }
     $templateMgr->assign('dateFrom', $fromDate);
     $templateMgr->assign('dateTo', $toDate);
     $templateMgr->assign('fieldOptions', array(SUBMISSION_FIELD_TITLE => 'article.title', SUBMISSION_FIELD_AUTHOR => 'user.role.author', SUBMISSION_FIELD_EDITOR => 'user.role.editor'));
     $templateMgr->assign('dateFieldOptions', array(SUBMISSION_FIELD_DATE_SUBMITTED => 'submissions.submitted', SUBMISSION_FIELD_DATE_COPYEDIT_COMPLETE => 'submissions.copyeditComplete', SUBMISSION_FIELD_DATE_LAYOUT_COMPLETE => 'submissions.layoutComplete', SUBMISSION_FIELD_DATE_PROOFREADING_COMPLETE => 'submissions.proofreadingComplete'));
     import('issue.IssueAction');
     $issueAction =& new IssueAction();
     $templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
     $templateMgr->display('sectionEditor/index.tpl');
 }
 /**
  * Thank layout editor for proofreading
  */
 function thankLayoutEditorProofreader($args)
 {
     $articleId = Request::getUserVar('articleId');
     $send = Request::getUserVar('send') ? 1 : 0;
     list($journal, $submission) = SubmissionEditHandler::validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
     parent::setupTemplate(true, $articleId, 'editing');
     import('submission.proofreader.ProofreaderAction');
     if (ProofreaderAction::proofreadEmail($articleId, 'PROOFREAD_LAYOUT_ACK', $send ? '' : Request::url(null, null, 'thankLayoutEditorProofreader'))) {
         Request::redirect(null, null, 'submissionEditing', $articleId);
     }
 }
Ejemplo n.º 3
0
 /**
  * Setup common template variables.
  * @param $level int set to 0 if caller is at the same level as this handler in the hierarchy; otherwise the number of levels below this handler
  */
 function setupTemplate($level = EDITOR_SECTION_HOME, $articleId = 0, $parentPage = null)
 {
     parent::setupTemplate();
     // Layout Editors have access to some Issue Mgmt functions. Make sure we give them
     // the appropriate breadcrumbs and sidebar.
     $isLayoutEditor = Request::getRequestedPage() == 'layoutEditor';
     $journal =& Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     if ($level == EDITOR_SECTION_HOME) {
         $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'));
     } else {
         if ($level == EDITOR_SECTION_SUBMISSIONS) {
             $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'editor'), 'user.role.editor'), array(Request::url(null, 'editor', 'submissions'), 'article.submissions'));
         } else {
             if ($level == EDITOR_SECTION_ISSUES) {
                 $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, $isLayoutEditor ? 'layoutEditor' : 'editor'), $isLayoutEditor ? 'user.role.layoutEditor' : 'user.role.editor'), array(Request::url(null, $isLayoutEditor ? 'layoutEditor' : 'editor', 'futureIssues'), 'issue.issues'));
             }
         }
     }
     import('classes.submission.sectionEditor.SectionEditorAction');
     $submissionCrumb = SectionEditorAction::submissionBreadcrumb($articleId, $parentPage, 'editor');
     if (isset($submissionCrumb)) {
         $pageHierarchy = array_merge($pageHierarchy, $submissionCrumb);
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
Ejemplo n.º 4
0
 /**
  * Delete a submission.
  */
 function deleteSubmission($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     EditorHandler::validate($articleId);
     parent::setupTemplate(true);
     $journal =& Request::getJournal();
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $article =& $articleDao->getArticle($articleId);
     $status = $article->getStatus();
     if ($article->getJournalId() == $journal->getJournalId() && ($status == STATUS_DECLINED || $status == STATUS_ARCHIVED)) {
         // Delete article files
         import('file.ArticleFileManager');
         $articleFileManager =& new ArticleFileManager($articleId);
         $articleFileManager->deleteArticleTree();
         // Delete article database entries
         $articleDao->deleteArticleById($articleId);
     }
     Request::redirect(null, null, 'submissions', 'submissionsArchives');
 }
Ejemplo n.º 5
0
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     SectionEditorHandler::validate();
     SectionEditorHandler::setupTemplate(true);
     $articleId = $args[0];
     $commentId = $args[1];
     list($journal, $submission) = SubmissionEditHandler::validate($articleId);
     list($comment) = SubmissionCommentsHandler::validate($commentId);
     SectionEditorAction::deleteComment($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     } else {
         if ($comment->getCommentType() == COMMENT_TYPE_EDITOR_DECISION) {
             Request::redirect(null, null, 'viewEditorDecisionComments', $articleId);
         } else {
             if ($comment->getCommentType() == COMMENT_TYPE_COPYEDIT) {
                 Request::redirect(null, null, 'viewCopyeditComments', $articleId);
             } else {
                 if ($comment->getCommentType() == COMMENT_TYPE_LAYOUT) {
                     Request::redirect(null, null, 'viewLayoutComments', $articleId);
                 } else {
                     if ($comment->getCommentType() == COMMENT_TYPE_PROOFREAD) {
                         Request::redirect(null, null, 'viewProofreadComments', $articleId);
                     }
                 }
             }
         }
     }
 }