Example #1
0
 function &_getCriterias($sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore, $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection, $budgetOption, $budget, $sources, $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety)
 {
     $institutionDao =& DAORegistry::getDAO('InstitutionDAO');
     $proposalDetailsDao =& DAORegistry::getDAO('ProposalDetailsDAO');
     $criterias = array();
     if ($decisionType && $decisionStatus) {
         $decisionTypesMap = array(INITIAL_REVIEW => 'submission.initialReview', PROGRESS_REPORT => 'submission.progressReport', PROTOCOL_AMENDMENT => 'submission.protocolAmendment', SERIOUS_ADVERSE_EVENT => 'submission.seriousAdverseEvents', FINAL_REPORT => 'submission.finalReport');
         $decisionStatusMap = array(98 => 'editor.reports.aDecisionsIUR', 99 => 'editor.reports.aDecisionsEUR', SUBMISSION_SECTION_DECISION_APPROVED => 'editor.article.decision.approved', SUBMISSION_SECTION_DECISION_RESUBMIT => 'editor.article.decision.resubmit', SUBMISSION_SECTION_DECISION_DECLINED => 'editor.article.decision.declined');
         if ($sectionId != 0) {
             $sectionDao =& DAORegistry::getDAO('SectionDAO');
             $section =& $sectionDao->getSection($sectionId);
             $string = Locale::translate('editor.reports.fromCommittee') . ' ' . $section->getLocalizedAbbrev();
         } else {
             $string = Locale::translate('editor.reports.fromCommittee') . ' ' . Locale::translate('editor.reports.anyCommittee');
         }
         array_push($criterias, Locale::translate('editor.reports.oneDecisionIs') . ': ' . Locale::translate($decisionTypesMap[$decisionType]) . ' ' . Locale::translate($decisionStatusMap[$decisionStatus]) . ' ' . $string);
     }
     if ($decisionAfter && $decisionAfter != "") {
         if ($decisionStatus != 98) {
             array_push($criterias, Locale::translate('editor.reports.criterias.decisionAfter') . ' ' . $decisionAfter . ' ' . Locale::translate('editor.reports.dateInclusive'));
         } else {
             array_push($criterias, Locale::translate('editor.reports.criterias.submittedAfter') . ' ' . $decisionAfter . ' ' . Locale::translate('editor.reports.dateInclusive'));
         }
     }
     if ($decisionBefore && $decisionBefore != "") {
         if ($decisionStatus != 98) {
             array_push($criterias, Locale::translate('editor.reports.criterias.decisionBefore') . ' ' . $decisionBefore . ' ' . Locale::translate('editor.reports.dateInclusive'));
         } else {
             array_push($criterias, Locale::translate('editor.reports.criterias.submittedBefore') . ' ' . $decisionBefore . ' ' . Locale::translate('editor.reports.dateInclusive'));
         }
     }
     $proposalDetails = new ProposalDetails();
     if ($studentResearch) {
         array_push($criterias, Locale::translate('proposal.studentInitiatedResearch') . ': ' . Locale::translate($proposalDetails->getYesNoKey($studentResearch)));
     }
     if ($startAfter && $startAfter != "") {
         array_push($criterias, Locale::translate('editor.reports.researchStartAfter') . ' ' . $startAfter . ' ' . Locale::translate('editor.reports.dateInclusive'));
     }
     if ($startBefore && $startBefore != "") {
         array_push($criterias, Locale::translate('editor.reports.researchStartBefore') . ' ' . $startBefore . ' ' . Locale::translate('editor.reports.dateInclusive'));
     }
     if ($endAfter && $endAfter != "") {
         array_push($criterias, Locale::translate('editor.reports.researchEndAfter') . ' ' . $endAfter . ' ' . Locale::translate('editor.reports.dateInclusive'));
     }
     if ($endBefore && $endBefore != "") {
         array_push($criterias, Locale::translate('editor.reports.researchEndBefore') . ' ' . $endBefore . ' ' . Locale::translate('editor.reports.dateInclusive'));
     }
     $kiiField = array_filter($kiiField);
     if (!empty($kiiField)) {
         $string = Locale::translate('proposal.keyImplInstitution') . ': ';
         for ($i = 0; $i < count($kiiField); $i++) {
             $institution = $institutionDao->getInstitutionById($kiiField[$i]);
             if ($i == 0) {
                 $string .= $institution->getInstitutionName();
             } else {
                 $string .= ' ' . Locale::translate('common.or') . ' ' . $institution->getInstitutionName();
             }
         }
         array_push($criterias, $string);
         unset($string);
     }
     if ($multiCountry) {
         array_push($criterias, Locale::translate('proposal.multiCountryResearch') . ': ' . Locale::translate($proposalDetails->getYesNoKey($multiCountry)));
         if ($multiCountry == PROPOSAL_DETAIL_YES) {
             $countries = array_filter($countries);
             if (!empty($countries)) {
                 $string = Locale::translate('common.country') . ': ';
                 for ($i = 0; $i < count($countries); $i++) {
                     $countryDao =& DAORegistry::getDAO('CountryDAO');
                     if ($i == 0) {
                         $string .= $countryDao->getCountry($countries[$i]);
                     } else {
                         $string .= ' ' . Locale::translate('common.or') . ' ' . $countryDao->getCountry($countries[$i]);
                     }
                 }
                 array_push($criterias, $string);
                 unset($string);
             }
         }
     }
     $geoAreas = array_filter($geoAreas);
     if (!empty($geoAreas)) {
         $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO');
         $string = Locale::translate('proposal.geoArea') . ': ';
         for ($i = 0; $i < count($geoAreas); $i++) {
             $extraField =& $extraFieldDao->getExtraField($geoAreas[$i]);
             if ($i == 0) {
                 $string .= isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null;
             } else {
                 $string .= ' ' . Locale::translate('common.or') . ' ' . (isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null);
             }
             unset($extraField);
         }
         array_push($criterias, $string);
         unset($string);
     }
     $researchDomains = array_filter($researchDomains);
     if (!empty($researchDomains)) {
         $string = Locale::translate('proposal.researchDomains') . ': ';
         for ($i = 0; $i < count($researchDomains); $i++) {
             $extraField =& $extraFieldDao->getExtraField($researchDomains[$i]);
             if ($i == 0) {
                 $string .= isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null;
             } else {
                 $string .= ' ' . Locale::translate('common.or') . ' ' . (isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null);
             }
             unset($extraField);
         }
         array_push($criterias, $string);
         unset($string);
     }
     $researchFields = array_filter($researchFields);
     if (!empty($researchFields)) {
         $string = Locale::translate('proposal.researchField') . ': ';
         for ($i = 0; $i < count($researchFields); $i++) {
             $extraField =& $extraFieldDao->getExtraField($researchFields[$i]);
             if ($i == 0) {
                 $string .= isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null;
             } else {
                 $string .= ' ' . Locale::translate('common.or') . ' ' . (isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null);
             }
             unset($extraField);
         }
         array_push($criterias, $string);
         unset($string);
     }
     if ($withHumanSubjects) {
         array_push($criterias, Locale::translate('proposal.withHumanSubjects') . ': ' . Locale::translate($proposalDetails->getYesNoKey($withHumanSubjects)));
         if ($withHumanSubjects == PROPOSAL_DETAIL_YES) {
             $proposalTypes = array_filter($proposalTypes);
             if (!empty($proposalTypes)) {
                 $string = Locale::translate('proposal.proposalType') . ': ';
                 for ($i = 0; $i < count($proposalTypes); $i++) {
                     $extraField =& $extraFieldDao->getExtraField($proposalTypes[$i]);
                     if ($i == 0) {
                         $string .= isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null;
                     } else {
                         $string .= ' ' . Locale::translate('common.or') . ' ' . (isset($extraField) ? $extraField->getLocalizedExtraFieldName() : null);
                     }
                     unset($extraField);
                 }
                 array_push($criterias, $string);
                 unset($string);
             }
         }
     }
     if ($dataCollection) {
         array_push($criterias, Locale::translate('proposal.dataCollection') . ': ' . Locale::translate($proposalDetails->getYesNoKey($dataCollection)));
     }
     if ($budget && $budget != "") {
         array_push($criterias, Locale::translate('proposal.fundsRequired') . ' ' . $budgetOption . ' ' . $budget);
     }
     $sources = array_filter($sources);
     if (!empty($sources)) {
         $string = Locale::translate('proposal.source') . ': ';
         for ($i = 0; $i < count($sources); $i++) {
             $institution = $institutionDao->getInstitutionById($sources[$i]);
             if ($i == 0) {
                 $string .= $institution->getInstitutionName();
             } else {
                 $string .= ' ' . Locale::translate('common.or') . ' ' . $institution->getInstitutionName();
             }
         }
         array_push($criterias, $string);
         unset($string);
     }
     $riskAssessment = new RiskAssessment();
     if ($identityRevealed != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.identityRevealed') . ' ' . Locale::translate($riskAssessment->getYesNoKey($identityRevealed)));
     }
     if ($unableToConsent != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.unableToConsent') . ' ' . Locale::translate($riskAssessment->getYesNoKey($unableToConsent)));
     }
     if ($under18 != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.under18') . ' ' . Locale::translate($riskAssessment->getYesNoKey($under18)));
     }
     if ($dependentRelationship != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.dependentRelationship') . ' ' . Locale::translate($riskAssessment->getYesNoKey($dependentRelationship)));
     }
     if ($ethnicMinority != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.ethnicMinority') . ' ' . Locale::translate($riskAssessment->getYesNoKey($ethnicMinority)));
     }
     if ($impairment != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.impairment') . ' ' . Locale::translate($riskAssessment->getYesNoKey($impairment)));
     }
     if ($pregnant != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludesHumanSubject') . ' ' . Locale::translate('proposal.pregnant') . ' ' . Locale::translate($riskAssessment->getYesNoKey($pregnant)));
     }
     if ($newTreatment != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.newTreatment') . ' ' . Locale::translate($riskAssessment->getYesNoKey($newTreatment)));
     }
     if ($bioSamples != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.bioSamples') . ' ' . Locale::translate($riskAssessment->getYesNoKey($bioSamples)));
         if ($bioSamples == RISK_ASSESSMENT_YES) {
             if ($exportHumanTissue != null) {
                 array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.exportHumanTissue') . ' ' . Locale::translate($riskAssessment->getYesNoKey($exportHumanTissue)));
                 if ($exportHumanTissue == RISK_ASSESSMENT_YES) {
                     if ($exportReason != null) {
                         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.exportReason') . ' ' . Locale::translate($riskAssessment->getExportReasonKey()));
                     }
                 }
             }
         }
     }
     if ($radiation != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.radiation') . ' ' . Locale::translate($riskAssessment->getYesNoKey($radiation)));
     }
     if ($distress != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.distress') . ' ' . Locale::translate($riskAssessment->getYesNoKey($distress)));
     }
     if ($inducements != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.inducements') . ' ' . Locale::translate($riskAssessment->getYesNoKey($inducements)));
     }
     if ($sensitiveInfo != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.sensitiveInfo') . ' ' . Locale::translate($riskAssessment->getYesNoKey($sensitiveInfo)));
     }
     if ($reproTechnology != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.reproTechnology') . ' ' . Locale::translate($riskAssessment->getYesNoKey($reproTechnology)));
     }
     if ($genetic != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.genetic') . ' ' . Locale::translate($riskAssessment->getYesNoKey($genetic)));
     }
     if ($stemCell != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.stemCell') . ' ' . Locale::translate($riskAssessment->getYesNoKey($stemCell)));
     }
     if ($biosafety != null) {
         array_push($criterias, Locale::translate('proposal.researchIncludes') . ' ' . Locale::translate('proposal.biosafety') . ' ' . Locale::translate($riskAssessment->getYesNoKey($biosafety)));
     }
     return $criterias;
 }
 /**
  * Internal function to return a proposal details object from a row.
  * @param $row array
  * @return ProposalDetails object
  */
 function &_returnProposalDetailsFromRow(&$row)
 {
     $proposalDetails = new ProposalDetails();
     $proposalDetails->setArticleId($row['article_id']);
     $proposalDetails->setStudentResearch($row['student']);
     if (isset($row['start_date'])) {
         $proposalDetails->setStartDate(date("d-M-Y", strtotime($this->dateFromDB($row['start_date']))));
     }
     if (isset($row['end_date'])) {
         $proposalDetails->setEndDate(date("d-M-Y", strtotime($this->dateFromDB($row['end_date']))));
     }
     $proposalDetails->setKeyImplInstitution($row['key_implementing_institution']);
     $proposalDetails->setMultiCountryResearch($row['multi_country']);
     $proposalDetails->setCountries($row['countries']);
     $proposalDetails->setNationwide($row['nationwide']);
     $proposalDetails->setGeoAreas($row['geo_areas']);
     $proposalDetails->setResearchDomains($row['research_domains']);
     $proposalDetails->setResearchFields($row['research_fields']);
     $proposalDetails->setHumanSubjects($row['human_subjects']);
     $proposalDetails->setProposalTypes($row['proposal_types']);
     $proposalDetails->setDataCollection($row['data_collection']);
     $proposalDetails->setCommitteeReviewed($row['committee_reviewed']);
     $proposalDetails->setStudentResearchInfo($this->studentResearchDao->getStudentResearchByArticleId($row['article_id']));
     HookRegistry::call('ProposalDetailsDAO::_returnProposalDetailsFromRow', array(&$proposalDetails, &$row));
     return $proposalDetails;
 }
Example #3
0
 /**
  * Save changes to article.
  * @param $request PKPRequest
  * @return int the article ID
  */
 function execute(&$request)
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $article =& $this->article;
     // Retrieve the previous citation list for comparison.
     $previousRawCitationList = $article->getCitations();
     ///////////////////////////////////////////
     ////////////// Update Authors /////////////
     ///////////////////////////////////////////
     $authors = $this->getData('authors');
     for ($i = 0, $count = count($authors); $i < $count; $i++) {
         if ($authors[$i]['authorId'] > 0) {
             // Update an existing author
             $author =& $article->getAuthor($authors[$i]['authorId']);
             $isExistingAuthor = true;
         } else {
             // Create a new author
             $author = new Author();
             $isExistingAuthor = false;
         }
         if ($author != null) {
             $author->setSubmissionId($article->getId());
             if (isset($authors[$i]['firstName'])) {
                 $author->setFirstName($authors[$i]['firstName']);
             }
             if (isset($authors[$i]['middleName'])) {
                 $author->setMiddleName($authors[$i]['middleName']);
             }
             if (isset($authors[$i]['lastName'])) {
                 $author->setLastName($authors[$i]['lastName']);
             }
             if (isset($authors[$i]['affiliation'])) {
                 $author->setAffiliation($authors[$i]['affiliation']);
             }
             if (isset($authors[$i]['phone'])) {
                 $author->setPhoneNumber($authors[$i]['phone']);
             }
             if (isset($authors[$i]['email'])) {
                 $author->setEmail($authors[$i]['email']);
             }
             $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
             $author->setSequence($authors[$i]['seq']);
             if ($isExistingAuthor == false) {
                 $article->addAuthor($author);
             }
         }
         unset($author);
     }
     // Remove deleted authors
     $deletedAuthors = explode(':', $this->getData('deletedAuthors'));
     for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) {
         $article->removeAuthor($deletedAuthors[$i]);
     }
     ///////////////////////////////////////////
     //////////// Update Abstract(s) ///////////
     ///////////////////////////////////////////
     import('classes.article.ProposalAbstract');
     $journal = Request::getJournal();
     $abstracts = $this->getData('abstracts');
     foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) {
         if ($abstracts[$localeKey]['abstractId'] > 0) {
             $abstract = $article->getAbstractByLocale($localeKey);
             $isExistingAbstract = true;
         } else {
             $abstract = new ProposalAbstract();
             $isExistingAbstract = false;
         }
         if ($abstract != null) {
             $abstract->setArticleId($article->getId());
             $abstract->setLocale($localeKey);
             $abstract->setScientificTitle($abstracts[$localeKey]['scientificTitle']);
             $abstract->setPublicTitle($abstracts[$localeKey]['publicTitle']);
             $abstract->setBackground($abstracts[$localeKey]['background']);
             $abstract->setObjectives($abstracts[$localeKey]['objectives']);
             $abstract->setStudyMethods($abstracts[$localeKey]['studyMethods']);
             $abstract->setExpectedOutcomes($abstracts[$localeKey]['expectedOutcomes']);
             $abstract->setKeywords($abstracts[$localeKey]['keywords']);
             if ($isExistingAbstract == false) {
                 $article->addAbstract($abstract);
             }
         }
         unset($abstract);
     }
     ///////////////////////////////////////////
     ///////// Update Proposal Details /////////
     ///////////////////////////////////////////
     $proposalDetailsData = $this->getData('proposalDetails');
     import('classes.article.ProposalDetails');
     $proposalDetails = new ProposalDetails();
     $institutionDao =& DAORegistry::getDAO('InstitutionDAO');
     import('classes.journal.Institution');
     $proposalDetails->setArticleId($article->getId());
     $proposalDetails->setStudentResearch($proposalDetailsData['studentInitiatedResearch']);
     $proposalDetails->setStartDate($proposalDetailsData['startDate']);
     $proposalDetails->setEndDate($proposalDetailsData['endDate']);
     if ($proposalDetailsData['keyImplInstitution'] == "OTHER") {
         $institution = new Institution();
         $institution->setInstitutionName($proposalDetailsData['otherInstitutionName']);
         $institution->setInstitutionAcronym($proposalDetailsData['otherInstitutionAcronym']);
         $institution->setInstitutionType($proposalDetailsData['otherInstitutionType']);
         $institution->setInstitutionInternational($proposalDetailsData['international']);
         if ($proposalDetailsData['international'] == INSTITUTION_NATIONAL) {
             $institution->setInstitutionLocation($proposalDetailsData['locationCountry']);
         } elseif ($proposalDetailsData['international'] == INSTITUTION_INTERNATIONAL) {
             $institution->setInstitutionLocation($proposalDetailsData['locationInternational']);
         }
         $institutionId = $institutionDao->insertInstitution($institution);
         $proposalDetails->setKeyImplInstitution($institutionId);
         unset($institution);
     } else {
         $proposalDetails->setKeyImplInstitution($proposalDetailsData['keyImplInstitution']);
     }
     $proposalDetails->setMultiCountryResearch($proposalDetailsData['multiCountryResearch']);
     if ($proposalDetailsData['multiCountryResearch'] == PROPOSAL_DETAIL_YES) {
         $countriesArray = $proposalDetailsData['countries'];
         $countries = implode(",", $countriesArray);
         $proposalDetails->setCountries($countries);
     }
     $proposalDetails->setNationwide($proposalDetailsData['nationwide']);
     if ($proposalDetailsData['nationwide'] != PROPOSAL_DETAIL_YES) {
         $geoAreasArray = $proposalDetailsData['geoAreas'];
         $proposalDetails->setGeoAreasFromArray($geoAreasArray);
     }
     $researchDomainsArray = $proposalDetailsData['researchDomains'];
     $proposalDetails->setResearchDomainsFromArray($researchDomainsArray);
     $researchFieldsArray = $proposalDetailsData['researchFields'];
     foreach ($researchFieldsArray as $i => $field) {
         if ($field == "OTHER") {
             $otherField = $proposalDetailsData['otherResearchField'];
             if ($otherField != "") {
                 $researchFieldsArray[$i] = "Other (" . $otherField . ")";
             }
         }
     }
     $proposalDetails->setResearchFieldsFromArray($researchFieldsArray);
     $proposalDetails->setHumanSubjects($proposalDetailsData['withHumanSubjects']);
     if ($proposalDetailsData['withHumanSubjects'] == PROPOSAL_DETAIL_YES) {
         $proposalTypesArray = $proposalDetailsData['proposalTypes'];
         foreach ($proposalTypesArray as $i => $type) {
             if ($type == "OTHER") {
                 $otherType = $proposalDetailsData['otherProposalType'];
                 if ($otherType != "") {
                     $proposalTypesArray[$i] = "Other (" . $otherType . ")";
                 }
             }
         }
         $proposalDetails->setProposalTypesFromArray($proposalTypesArray);
     }
     $proposalDetails->setDataCollection($proposalDetailsData['dataCollection']);
     if ($proposalDetailsData['reviewedByOtherErc'] == PROPOSAL_DETAIL_YES) {
         $proposalDetails->setCommitteeReviewed($proposalDetailsData['otherErcDecision']);
     } else {
         $proposalDetails->setCommitteeReviewed(PROPOSAL_DETAIL_NO);
     }
     // Update or insert student research
     import('classes.article.StudentResearch');
     $studentResearchInfo = new StudentResearch();
     $studentResearchInfo->setArticleId($article->getId());
     $studentResearchData = $this->getData('studentResearch');
     $studentResearchInfo->setInstitution($studentResearchData['studentInstitution']);
     $studentResearchInfo->setDegree($studentResearchData['academicDegree']);
     $studentResearchInfo->setSupervisorName($studentResearchData['supervisorName']);
     $studentResearchInfo->setSupervisorEmail($studentResearchData['supervisorEmail']);
     $proposalDetails->setStudentResearchInfo($studentResearchInfo);
     $article->setProposalDetails($proposalDetails);
     ///////////////////////////////////////////
     //////// Update Sources of Monetary ///////
     ///////////////////////////////////////////
     $sources = $article->getSources();
     $sourcesData = $this->getData('sources');
     //Remove sources
     foreach ($sources as $source) {
         $isPresent = false;
         foreach ($sourcesData as $sourceData) {
             if (!empty($sourceData['sourceId'])) {
                 if ($source->getSourceId() == $sourceData['sourceId']) {
                     $isPresent = true;
                 }
             }
         }
         if (!$isPresent) {
             $article->removeSource($source->getSourceId());
         }
         unset($source);
     }
     for ($i = 0, $count = count($sourcesData); $i < $count; $i++) {
         if (!empty($sourcesData[$i]['sourceId'])) {
             // Update an existing source
             $source =& $article->getSource($sourcesData[$i]['sourceId']);
             $isExistingSource = true;
         } else {
             // Create a new source
             $source = new ProposalSource();
             $isExistingSource = false;
         }
         if ($source != null) {
             $source->setArticleId($article->getId());
             if ($sourcesData[$i]['institution'] == "OTHER") {
                 $institution = new Institution();
                 $institution->setInstitutionName($sourcesData[$i]['otherInstitutionName']);
                 $institution->setInstitutionAcronym($sourcesData[$i]['otherInstitutionAcronym']);
                 $institution->setInstitutionType($sourcesData[$i]['otherInstitutionType']);
                 $institution->setInstitutionInternational($sourcesData[$i]['international']);
                 if ($sourcesData[$i]['international'] == INSTITUTION_NATIONAL) {
                     $institution->setInstitutionLocation($sourcesData[$i]['locationCountry']);
                 } elseif ($proposalDetailsData['international'] == INSTITUTION_INTERNATIONAL) {
                     $institution->setInstitutionLocation($sourcesData[$i]['locationInternational']);
                 }
                 $institutionId = $institutionDao->insertInstitution($institution);
                 $source->setInstitutionId($institutionId);
                 unset($institution);
             } elseif ($sourcesData[$i]['institution'] == "KII") {
                 $source->setInstitutionId($proposalDetails->getKeyImplInstitution());
             } else {
                 $source->setInstitutionId($sourcesData[$i]['institution']);
             }
             $source->setSourceAmount($sourcesData[$i]['amount']);
             if (!$isExistingSource) {
                 $article->addSource($source);
             }
         }
         unset($source);
     }
     ///////////////////////////////////////////
     ///////////// Risk Assessment /////////////
     ///////////////////////////////////////////
     import('classes.article.RiskAssessment');
     $riskAssessment = new RiskAssessment();
     $riskAssessmentData = $this->getData('riskAssessment');
     $riskAssessment->setArticleId($article->getId());
     $riskAssessment->setIdentityRevealed($riskAssessmentData['identityRevealed']);
     $riskAssessment->setUnableToConsent($riskAssessmentData['unableToConsent']);
     $riskAssessment->setUnder18($riskAssessmentData['under18']);
     $riskAssessment->setDependentRelationship($riskAssessmentData['dependentRelationship']);
     $riskAssessment->setEthnicMinority($riskAssessmentData['ethnicMinority']);
     $riskAssessment->setImpairment($riskAssessmentData['impairment']);
     $riskAssessment->setPregnant($riskAssessmentData['pregnant']);
     $riskAssessment->setNewTreatment($riskAssessmentData['newTreatment']);
     $riskAssessment->setBioSamples($riskAssessmentData['bioSamples']);
     $riskAssessment->setExportHumanTissue($riskAssessmentData['exportHumanTissue']);
     $riskAssessment->setExportReason($riskAssessmentData['exportReason']);
     $riskAssessment->setRadiation($riskAssessmentData['radiation']);
     $riskAssessment->setDistress($riskAssessmentData['distress']);
     $riskAssessment->setInducements($riskAssessmentData['inducements']);
     $riskAssessment->setSensitiveInfo($riskAssessmentData['sensitiveInfo']);
     $riskAssessment->setReproTechnology($riskAssessmentData['reproTechnology']);
     $riskAssessment->setGenetic($riskAssessmentData['genetic']);
     $riskAssessment->setStemCell($riskAssessmentData['stemCell']);
     $riskAssessment->setBiosafety($riskAssessmentData['biosafety']);
     $riskAssessment->setRiskLevel($riskAssessmentData['riskLevel']);
     $riskAssessment->setListRisks($riskAssessmentData['listRisks']);
     $riskAssessment->setHowRisksMinimized($riskAssessmentData['howRisksMinimized']);
     $riskAssessment->setRisksToTeam(isset($riskAssessmentData['risksToTeam']) ? 1 : 0);
     $riskAssessment->setRisksToSubjects(isset($riskAssessmentData['risksToSubjects']) ? 1 : 0);
     $riskAssessment->setRisksToCommunity(isset($riskAssessmentData['risksToCommunity']) ? 1 : 0);
     $riskAssessment->setBenefitsToParticipants(isset($riskAssessmentData['benefitsToParticipants']) ? 1 : 0);
     $riskAssessment->setKnowledgeOnCondition(isset($riskAssessmentData['knowledgeOnCondition']) ? 1 : 0);
     $riskAssessment->setKnowledgeOnDisease(isset($riskAssessmentData['knowledgeOnDisease']) ? 1 : 0);
     $riskAssessment->setMultiInstitutions($riskAssessmentData['multiInstitutions']);
     $riskAssessment->setConflictOfInterest($riskAssessmentData['conflictOfInterest']);
     $article->setRiskAssessment($riskAssessment);
     parent::execute();
     // Save the article
     $articleDao->updateArticle($article);
     // Update references list if it changed.
     $citationDao =& DAORegistry::getDAO('CitationDAO');
     $rawCitationList = $article->getCitations();
     if ($previousRawCitationList != $rawCitationList) {
         $citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $article->getId(), $rawCitationList);
     }
 }
 /**
  * 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;
 }