/** * Private function for returning a sample research proposal * @param type $approvalNotice * @return \SectionEditorSubmission */ private function _createSampleProposal($approvalNotice) { $institutionDao =& DAORegistry::getDAO('InstitutionDAO'); $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO'); $sectionDao =& DAORegistry::getDAO('SectionDAO'); // Create the submission import('classes.submission.sectionEditor.SectionEditorSubmission'); $sectionEditorSubmission = new SectionEditorSubmission(); $sectionEditorSubmission->setProposalId('2014.76.RV'); $sectionEditorSubmission->setDateSubmitted('2014-06-13 14:57:17'); // Create the decision import('classes.article.SectionDecision'); $sectionDecision = new SectionDecision(); $sectionDecision->setSectionId($sectionDao->getRandomSectionId()); $reviewTypes = $approvalNotice->getReviewTypesArray(); if ($reviewTypes[0] != APPROVAL_NOTICE_TYPE_ALL) { $sectionDecision->setReviewType($reviewTypes[0]); } else { $sectionDecision->setReviewType(1); } $sectionDecision->setRound(2); $sectionEditorSubmission->setDecisions(array(0 => $sectionDecision)); // Create the investigators import('classes.article.Author'); $firstInvestigator = new Author(); $firstInvestigator->setFirstName('Jane'); $firstInvestigator->setLastName('Roe'); $firstInvestigator->setPrimaryContact(1); $firstInvestigator->setAffiliation('World Health Organization, Western Pacific Regional Office'); $coInvestigator1 = new Author(); $coInvestigator1->setFirstName('John'); $coInvestigator1->setLastName('Doe'); $coInvestigator1->setPrimaryContact(0); $coInvestigator1->setAffiliation('National Public Health Institution'); $coInvestigator2 = new Author(); $coInvestigator2->setFirstName('Marie'); $coInvestigator2->setMiddleName('Elizabeth'); $coInvestigator2->setLastName('Watson'); $coInvestigator2->setPrimaryContact(0); $coInvestigator2->setAffiliation('HUYBN'); $coInvestigator3 = new Author(); $coInvestigator3->setFirstName('Pascal'); $coInvestigator3->setLastName('Lavaud'); $coInvestigator3->setPrimaryContact(0); $coInvestigator3->setAffiliation('Cabinet MEDICAL, Avenue Bollée'); $sectionEditorSubmission->setAuthors(array(0 => $firstInvestigator, 1 => $coInvestigator1, 2 => $coInvestigator2, 3 => $coInvestigator3)); return $sectionEditorSubmission; }
/** * Internal function to return a section decision object from a row. * @param $row array * @return sectionDecision */ function &_returnSectionDecisionFromRow(&$row) { $sectionDecision = new SectionDecision(); $sectionDecision->setId($row['section_decision_id']); $sectionDecision->setArticleId($row['article_id']); $sectionDecision->setReviewType($row['review_type']); $sectionDecision->setRound($row['round']); $sectionDecision->setSectionId($row['section_id']); $sectionDecision->setDecision($row['decision']); $sectionDecision->setComments($row['comments']); $sectionDecision->setDateDecided($this->datetimeFromDB($row['date_decided'])); $sectionDecision->setProposalId($row['public_id']); $sectionDecision->setReviewAssignments($this->reviewAssignmentDao->getReviewAssignmentsByDecisionId($row['section_decision_id'])); $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); import('classes.file.ArticleFileManager'); $sectionDecision->setAuthorViewableReviewFiles($this->reviewAssignmentDao->getAuthorViewableFilesByDecision($row['section_decision_id'])); $sectionDecision->setDecisionFiles($articleFileDao->getArticleFilesByAssocId($row['section_decision_id'], ARTICLE_FILE_DECISION)); $meetingDao =& DAORegistry::getDAO('MeetingDAO'); $sectionDecision->setMeetings($meetingDao->getMeetingsBySectionDecisionId($row['section_decision_id'])); HookRegistry::call('SectionDecisionDAO::_returnSectionDecisionFromRow', array(&$sectionDecision, &$row)); return $sectionDecision; }
/** * Records an editor's submission decision. (Modified: Update if there is already an existing decision.) * @param $sectionEditorSubmission object * @param $decision int * @param $lastDecisionId int (Added) */ function recordDecision($sectionEditorSubmission, $decision, $reviewType, $round, $comments = null, $dateDecided = null, $lastDecisionId = null) { $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO'); $user =& Request::getUser(); $journal =& Request::getJournal(); $currentDate = date(Core::getCurrentDate()); $approvalDate = $dateDecided == null ? $currentDate : date($dateDecided); // Create the section decision import('classes.article.SectionDecision'); $sectionDecision = new SectionDecision(); if ($lastDecisionId) { $sectionDecision->setId($lastDecisionId); } $sectionDecision->setArticleId($sectionEditorSubmission->getArticleId()); $sectionDecision->setDecision($decision); $sectionDecision->setReviewType($reviewType); $sectionDecision->setRound($round); $sectionDecision->setSectionId($user->getSecretaryCommitteeId()); $sectionDecision->setComments($comments); $sectionDecision->setDateDecided($approvalDate); if (!HookRegistry::call('SectionEditorAction::recordDecision', array($sectionEditorSubmission, $decision, $reviewType, $round, $dateDecided, $lastDecisionId))) { if ($reviewType == REVIEW_TYPE_FR && ($decision == SUBMISSION_SECTION_DECISION_APPROVED || $decision == SUBMISSION_SECTION_DECISION_EXEMPTED && $sectionDecision->getComments())) { if (!SectionEditorAction::_publishResearch($sectionEditorSubmission)) { Request::redirect(null, null, 'submissionReview', $sectionEditorSubmission->getArticleId()); } } if ($reviewType == REVIEW_TYPE_FR && ($decision == SUBMISSION_SECTION_DECISION_APPROVED || $decision == SUBMISSION_SECTION_DECISION_EXEMPTED && $sectionDecision->getComments())) { $sectionEditorSubmission->setStatus(STATUS_COMPLETED); } elseif ($decision == SUBMISSION_SECTION_DECISION_EXEMPTED && $sectionDecision->getComments() || $decision == SUBMISSION_SECTION_DECISION_APPROVED || $decision == SUBMISSION_SECTION_DECISION_DONE || $decision == SUBMISSION_SECTION_DECISION_INCOMPLETE || $decision == SUBMISSION_SECTION_DECISION_RESUBMIT) { $sectionEditorSubmission->setStatus(STATUS_REVIEWED); } elseif ($decision == SUBMISSION_SECTION_DECISION_DECLINED) { $sectionEditorSubmission->setStatus(STATUS_ARCHIVED); } $sectionEditorSubmission->stampStatusModified(); $sectionEditorSubmission->addDecision($sectionDecision); $sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission); // Send a notification to the user import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $url = Request::url($journal->getPath(), 'author', 'submissionReview', array($sectionEditorSubmission->getArticleId())); switch ($decision) { case SUBMISSION_SECTION_DECISION_COMPLETE: $message = 'notification.type.submissionComplete'; break; case SUBMISSION_SECTION_DECISION_INCOMPLETE: $message = 'notification.type.submissionIncomplete'; break; case SUBMISSION_SECTION_DECISION_EXPEDITED: $message = 'notification.type.submissionExpedited'; break; case SUBMISSION_SECTION_DECISION_FULL_REVIEW: $message = 'notification.type.submissionAssigned'; break; case SUBMISSION_SECTION_DECISION_EXEMPTED: $message = 'notification.type.submissionExempted'; break; case SUBMISSION_SECTION_DECISION_DECLINED: $message = 'notification.type.submissionDecline'; break; case SUBMISSION_SECTION_DECISION_APPROVED: $message = 'notification.type.submissionAccept'; break; case SUBMISSION_SECTION_DECISION_DONE: $message = 'notification.type.submissionDone'; break; case SUBMISSION_SECTION_DECISION_RESUBMIT: $message = 'notification.type.reviseAndResubmit'; break; } switch ($reviewType) { case REVIEW_TYPE_PR: $message = $message . '.continuingReview'; break; case REVIEW_TYPE_AMENDMENT: $message = $message . '.amendment'; break; case REVIEW_TYPE_SAE: $message = $message . '.sae'; break; case REVIEW_TYPE_FR: $message = $message . '.eos'; break; } $notificationManager->createNotification($sectionEditorSubmission->getUserId(), $message, $sectionEditorSubmission->getProposalId(), $url, 1, NOTIFICATION_TYPE_SECTION_DECISION_COMMENT); $decisions = SectionEditorSubmission::getAllPossibleEditorDecisionOptions(); // Add log import('classes.article.log.ArticleLog'); import('classes.article.log.ArticleEventLogEntry'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION)); ArticleLog::logEvent($sectionEditorSubmission->getArticleId(), ARTICLE_LOG_SECTION_DECISION, ARTICLE_LOG_TYPE_EDITOR, $user->getId(), 'log.editor.decision', array('editorName' => $user->getFullName(), 'proposalId' => $sectionEditorSubmission->getProposalId(), 'decision' => Locale::translate($sectionDecision->getReviewTypeKey()) . ' - ' . $sectionDecision->getRound() . ': ' . Locale::translate($decisions[$decision]))); } }
/** * Private function for returning a sample research proposal * @param type $approvalNotice * @return \SectionEditorSubmission */ private function _createSampleProposal($approvalNotice) { $institutionDao =& DAORegistry::getDAO('InstitutionDAO'); $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO'); $sectionDao =& DAORegistry::getDAO('SectionDAO'); // Create the submission import('classes.submission.sectionEditor.SectionEditorSubmission'); $sectionEditorSubmission = new SectionEditorSubmission(); $sectionEditorSubmission->setProposalId('2014.76.RV'); $sectionEditorSubmission->setDateSubmitted('2014-06-13 14:57:17'); // Create the decision import('classes.article.SectionDecision'); $sectionDecision = new SectionDecision(); $sectionDecision->setSectionId($sectionDao->getRandomSectionId()); $reviewTypes = $approvalNotice->getReviewTypesArray(); if ($reviewTypes[0] != APPROVAL_NOTICE_TYPE_ALL) { $sectionDecision->setReviewType($reviewTypes[0]); } else { $sectionDecision->setReviewType(1); } $sectionDecision->setRound(2); $sectionEditorSubmission->setDecisions(array(0 => $sectionDecision)); // Create the investigators import('classes.article.Author'); $firstInvestigator = new Author(); $firstInvestigator->setFirstName('Jane'); $firstInvestigator->setLastName('Roe'); $firstInvestigator->setPrimaryContact(1); $firstInvestigator->setAffiliation('World Health Organization, Western Pacific Regional Office'); $coInvestigator1 = new Author(); $coInvestigator1->setFirstName('John'); $coInvestigator1->setLastName('Doe'); $coInvestigator1->setPrimaryContact(0); $coInvestigator1->setAffiliation('National Public Health Institution'); $coInvestigator2 = new Author(); $coInvestigator2->setFirstName('Marie'); $coInvestigator2->setMiddleName('Elizabeth'); $coInvestigator2->setLastName('Watson'); $coInvestigator2->setPrimaryContact(0); $coInvestigator2->setAffiliation('HUYBN'); $coInvestigator3 = new Author(); $coInvestigator3->setFirstName('Pascal'); $coInvestigator3->setLastName('Lavaud'); $coInvestigator3->setPrimaryContact(0); $coInvestigator3->setAffiliation('Cabinet MEDICAL, Avenue Bollée'); $sectionEditorSubmission->setAuthors(array(0 => $firstInvestigator, 1 => $coInvestigator1, 2 => $coInvestigator2, 3 => $coInvestigator3)); // Create the abstract import('classes.article.ProposalAbstract'); $abstract = new ProposalAbstract(); $abstract->setLocale('en_US'); $abstract->setScientificTitle('Here, the scientific title of the concerned health research proposal will appear.'); $abstract->setPublicTitle('Here, the public title of the concerned health research proposal will appear.'); $abstract->setBackground('Here, the background of the concerned health research proposal will appear. Here, the background of the concerned health research proposal will appear. Here, the background of the concerned health research proposal will appear. Here, the background of the concerned health research proposal will appear. Here, the background of the concerned health research proposal will appear. Here, the background of the concerned health research proposal will appear. Here, the background of the concerned health research proposal will appear.'); $abstract->setObjectives('Here, the objectives of the concerned health research proposal will appear. Here, the objectives of the concerned health research proposal will appear. Here, the objectives of the concerned health research proposal will appear. Here, the objectives of the concerned health research proposal will appear. Here, the objectives of the concerned health research proposal will appear.'); $abstract->setStudyMethods('Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear. Here, the study methods of the concerned health research proposal will appear.'); $abstract->setExpectedOutcomes('Here, the expected outcomes of the concerned health research proposal will appear. Here, the expected outcomes of the concerned health research proposal will appear. Here, the expected outcomes of the concerned health research proposal will appear. Here, the expected outcomes of the concerned health research proposal will appear. Here, the expected outcomes of the concerned health research proposal will appear. Here, the expected outcomes of the concerned health research proposal will appear.'); $sectionEditorSubmission->setAbstracts(array(0 => $abstract)); // Create proposal details import('classes.article.ProposalDetails'); $details = new ProposalDetails(); import('classes.article.StudentResearch'); $studentResearch = new StudentResearch(); $studentResearch->setInstitution('National University of Public Health'); $studentResearch->setDegree(STUDENT_DEGREE_PHD); $studentResearch->setSupervisorName('Dr. Arwin Wagala'); $details->setStudentResearchInfo($studentResearch); $details->setStartDate('2014-04-08'); $details->setEndDate('2017-09-02'); $details->setKeyImplInstitution($institutionDao->getRandomInstitutionId()); $details->setMultiCountryResearch(PROPOSAL_DETAIL_YES); $details->setCountries('GE,AM'); $details->setGeoAreas($extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_GEO_AREA) . '+' . $extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_GEO_AREA) . '+' . $extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_GEO_AREA)); $details->setResearchDomains($extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_RESEARCH_DOMAIN)); $details->setResearchFields($extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_RESEARCH_FIELD) . '+' . $extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_RESEARCH_FIELD)); $details->setProposalTypes($extraFieldDao->getRandomFieldIdByType(EXTRA_FIELD_PROPOSAL_TYPE)); $details->setDataCollection(PROPOSAL_DETAIL_BOTH_DATA_COLLECTION); $sectionEditorSubmission->setProposalDetails($details); return $sectionEditorSubmission; }