/** * Displays the author dashboard. * @param $args array * @param $request PKPRequest */ function submission($args, $request) { // Pass the authorized submission on to the template. $this->setupTemplate($request); $templateMgr = TemplateManager::getManager($request); $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); $templateMgr->assign('submission', $submission); // Link actions. import('lib.pkp.controllers.modals.submissionMetadata.linkAction.AuthorViewMetadataLinkAction'); $templateMgr->assign('viewMetadataAction', new AuthorViewMetadataLinkAction($request, $submission->getId())); import('lib.pkp.controllers.modals.documentLibrary.linkAction.SubmissionLibraryLinkAction'); $templateMgr->assign('submissionLibraryAction', new SubmissionLibraryLinkAction($request, $submission->getId())); $workflowStages = WorkflowStageDAO::getWorkflowStageKeysAndPaths(); $stageNotifications = array(); foreach (array_keys($workflowStages) as $stageId) { $stageNotifications[$stageId] = false; } $editDecisionDao = DAORegistry::getDAO('EditDecisionDAO'); /* @var $editDecisionDao EditDecisionDAO */ $stageDecisions = $editDecisionDao->getEditorDecisions($submission->getId()); $stagesWithDecisions = array(); foreach ($stageDecisions as $decision) { $stagesWithDecisions[$decision['stageId']] = $decision['stageId']; } $workflowStages = WorkflowStageDAO::getStageStatusesBySubmission($submission, $stagesWithDecisions, $stageNotifications); $templateMgr->assign('workflowStages', $workflowStages); return $templateMgr->display('authorDashboard/authorDashboard.tpl'); }
/** * Fetch the JSON-encoded submission progress bar. * @param $args array * @param $request Request * @return JSONMessage JSON object */ function submissionProgressBar($args, $request) { $templateMgr = TemplateManager::getManager($request); $context = $request->getContext(); $workflowStages = WorkflowStageDAO::getWorkflowStageKeysAndPaths(); $stageNotifications = array(); foreach (array_keys($workflowStages) as $stageId) { $stageNotifications[$stageId] = $this->notificationOptionsByStage($request->getUser(), $stageId, $context->getId()); } $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); $editDecisionDao = DAORegistry::getDAO('EditDecisionDAO'); /* @var $editDecisionDao EditDecisionDAO */ $stageDecisions = $editDecisionDao->getEditorDecisions($submission->getId()); $stagesWithDecisions = array(); foreach ($stageDecisions as $decision) { $stagesWithDecisions[$decision['stageId']] = $decision['stageId']; } $workflowStages = WorkflowStageDAO::getStageStatusesBySubmission($submission, $stagesWithDecisions, $stageNotifications); $templateMgr->assign('workflowStages', $workflowStages); if ($this->isSubmissionReady($submission)) { $templateMgr->assign('submissionIsReady', true); } return $templateMgr->fetchJson('workflow/submissionProgressBar.tpl'); }