/**
  * Internal function to return a Thesis object from a row.
  * @param $row array
  * @return Thesis
  */
 function &_returnThesisFromRow(&$row)
 {
     $thesisPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);
     $thesisPlugin->import('Thesis');
     $thesis = new Thesis();
     $thesis->setId($row['thesis_id']);
     $thesis->setJournalId($row['journal_id']);
     $thesis->setStatus($row['status']);
     $thesis->setDegree($row['degree']);
     $thesis->setDegreeName($row['degree_name']);
     $thesis->setDepartment($row['department']);
     $thesis->setUniversity($row['university']);
     $thesis->setDateApproved($this->dateFromDB($row['date_approved']));
     $thesis->setTitle($row['title']);
     $thesis->setAbstract($row['abstract']);
     $thesis->setUrl($row['url']);
     $thesis->setComment($row['comment']);
     $thesis->setStudentFirstName($row['student_first_name']);
     $thesis->setStudentMiddleName($row['student_middle_name']);
     $thesis->setStudentLastName($row['student_last_name']);
     $thesis->setStudentEmail($row['student_email']);
     $thesis->setStudentEmailPublish($row['student_email_publish']);
     $thesis->setStudentBio($row['student_bio']);
     $thesis->setSupervisorFirstName($row['supervisor_first_name']);
     $thesis->setSupervisorMiddleName($row['supervisor_middle_name']);
     $thesis->setSupervisorLastName($row['supervisor_last_name']);
     $thesis->setSupervisorEmail($row['supervisor_email']);
     $thesis->setDiscipline($row['discipline']);
     $thesis->setSubjectClass($row['subject_class']);
     $thesis->setSubject($row['subject']);
     $thesis->setCoverageGeo($row['coverage_geo']);
     $thesis->setCoverageChron($row['coverage_chron']);
     $thesis->setCoverageSample($row['coverage_sample']);
     $thesis->setMethod($row['method']);
     $thesis->setLanguage($row['language']);
     $thesis->setDateSubmitted($row['date_submitted']);
     return $thesis;
 }
 /**
  * Save thesis. 
  */
 function execute()
 {
     $thesisPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);
     $thesisPlugin->import('Thesis');
     $thesisDao =& DAORegistry::getDAO('ThesisDAO');
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     $thesis = new Thesis();
     $thesis->setJournalId($journalId);
     $thesis->setStatus(THESIS_STATUS_INACTIVE);
     $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());
     $thesisDao->insertThesis($thesis);
     // Send supervisor confirmation email
     if (!empty($this->uploadCodeEnabled)) {
         $uploadCode = $thesisPlugin->getSetting($journalId, 'uploadCode');
         $submittedUploadCode = $this->getData('uploadCode');
     }
     if (empty($uploadCode) || $uploadCode != $submittedUploadCode) {
         $journalName = $journal->getLocalizedTitle();
         $thesisName = $thesisPlugin->getSetting($journalId, 'thesisName');
         $thesisEmail = $thesisPlugin->getSetting($journalId, 'thesisEmail');
         $thesisPhone = $thesisPlugin->getSetting($journalId, 'thesisPhone');
         $thesisFax = $thesisPlugin->getSetting($journalId, 'thesisFax');
         $thesisMailingAddress = $thesisPlugin->getSetting($journalId, 'thesisMailingAddress');
         $thesisContactSignature = $thesisName;
         if (!empty($thesisMailingAddress)) {
             $thesisContactSignature .= "\n" . $thesisMailingAddress;
         }
         if (!empty($thesisPhone)) {
             $thesisContactSignature .= "\n" . Locale::Translate('user.phone') . ': ' . $thesisPhone;
         }
         if (!empty($thesisFax)) {
             $thesisContactSignature .= "\n" . Locale::Translate('user.fax') . ': ' . $thesisFax;
         }
         $thesisContactSignature .= "\n" . Locale::Translate('user.email') . ': ' . $thesisEmail;
         $studentName = $thesis->getStudentFirstName() . ' ' . $thesis->getStudentLastName();
         $supervisorName = $thesis->getSupervisorFirstName() . ' ' . $thesis->getSupervisorLastName();
         $paramArray = array('journalName' => $journalName, 'thesisName' => $thesisName, 'thesisEmail' => $thesisEmail, 'title' => $thesis->getTitle(), 'studentName' => $studentName, 'degree' => Locale::Translate($thesis->getDegreeString()), 'degreeName' => $thesis->getDegreeName(), 'department' => $thesis->getDepartment(), 'university' => $thesis->getUniversity(), 'dateApproved' => $thesis->getDateApproved(), 'supervisorName' => $supervisorName, 'abstract' => $thesis->getAbstract(), 'thesisContactSignature' => $thesisContactSignature);
         import('classes.mail.MailTemplate');
         $mail = new MailTemplate('THESIS_ABSTRACT_CONFIRM');
         $mail->setFrom($thesisEmail, "\"" . $thesisName . "\"");
         $mail->assignParams($paramArray);
         $mail->addRecipient($thesis->getSupervisorEmail(), "\"" . $supervisorName . "\"");
         $mail->addCc($thesis->getStudentEmail(), "\"" . $studentName . "\"");
         $mail->send();
     }
 }
Example #3
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);
     }
 }