예제 #1
0
 /**
  * Save thesis. 
  */
 function execute()
 {
     $thesisPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);
     $thesisPlugin->import('Thesis');
     $thesisDao =& DAORegistry::getDAO('ThesisDAO');
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     if (isset($this->thesisId)) {
         $thesis =& $thesisDao->getThesis($this->thesisId);
     }
     if (!isset($thesis)) {
         $thesis = new Thesis();
     }
     $thesis->setJournalId($journalId);
     $thesis->setStatus($this->getData('status'));
     $thesis->setDegree($this->getData('degree'));
     $thesis->setDegreeName($this->getData('degreeName'));
     $thesis->setDepartment($this->getData('department'));
     $thesis->setUniversity($this->getData('university'));
     $thesis->setTitle($this->getData('title'));
     $thesis->setDateApproved($this->getData('dateApprovedYear') . '-' . $this->getData('dateApprovedMonth') . '-' . $this->getData('dateApprovedDay'));
     $thesis->setUrl(strtolower($this->getData('url')));
     $thesis->setAbstract($this->getData('abstract'));
     $thesis->setComment($this->getData('comment'));
     $thesis->setStudentFirstName($this->getData('studentFirstName'));
     $thesis->setStudentMiddleName($this->getData('studentMiddleName'));
     $thesis->setStudentLastName($this->getData('studentLastName'));
     $thesis->setStudentEmail($this->getData('studentEmail'));
     $thesis->setStudentEmailPublish($this->getData('studentEmailPublish') == null ? 0 : 1);
     $thesis->setStudentBio($this->getData('studentBio'));
     $thesis->setSupervisorFirstName($this->getData('supervisorFirstName'));
     $thesis->setSupervisorMiddleName($this->getData('supervisorMiddleName'));
     $thesis->setSupervisorLastName($this->getData('supervisorLastName'));
     $thesis->setSupervisorEmail($this->getData('supervisorEmail'));
     $thesis->setDiscipline($this->getData('discipline'));
     $thesis->setSubjectClass($this->getData('subjectClass'));
     $thesis->setSubject($this->getData('keyword'));
     $thesis->setCoverageGeo($this->getData('coverageGeo'));
     $thesis->setCoverageChron($this->getData('coverageChron'));
     $thesis->setCoverageSample($this->getData('coverageSample'));
     $thesis->setMethod($this->getData('method'));
     $thesis->setLanguage($this->getData('language'));
     $thesis->setDateSubmitted(Core::getCurrentDate());
     // Update or insert thesis
     if ($thesis->getId() != null) {
         $thesisDao->updateThesis($thesis);
     } else {
         $thesisDao->insertThesis($thesis);
     }
 }