classes/author/form/submit/AuthorSubmitForm.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00020 // $Id$
00021 
00022 
00023 import('form.Form');
00024 
00025 class AuthorSubmitForm extends Form {
00026 
00028    var $paperId;
00029 
00031    var $paper;
00032 
00034    var $step;
00035 
00041    function AuthorSubmitForm($paper, $step) {
00042       parent::Form(sprintf('author/submit/step%d.tpl', $step));
00043 
00044       $this->addCheck(new FormValidatorPost($this));
00045 
00046       $this->step = $step;
00047       $this->paper = $paper;
00048       $this->paperId = $paper ? $paper->getId() : null;
00049    }
00050 
00054    function display() {
00055       $templateMgr =& TemplateManager::getManager();
00056       $templateMgr->assign('paperId', $this->paperId);
00057       $templateMgr->assign('submitStep', $this->step);
00058 
00059       switch($this->step) {
00060          case 3:
00061             $helpTopicId = 'submission.indexingMetadata';
00062             break;
00063          case 4:
00064             $helpTopicId = 'submission.supplementaryFiles';
00065             break;
00066          default:
00067             $helpTopicId = 'submission.index';
00068       }
00069       $templateMgr->assign('helpTopicId', $helpTopicId);
00070 
00071       $schedConf =& Request::getSchedConf();
00072       $settingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
00073 
00074       // Determine which submission steps should be shown
00075 
00076       $progress = isset($this->paper) ? $this->paper->getCurrentStage() : REVIEW_STAGE_ABSTRACT;
00077       $reviewMode = isset($this->paper)?$this->paper->getReviewMode():$schedConf->getSetting('reviewMode');
00078 
00079       $showAbstractSteps = $progress == REVIEW_STAGE_ABSTRACT || $reviewMode != REVIEW_MODE_BOTH_SEQUENTIAL;
00080       $showPaperSteps = $progress == REVIEW_STAGE_PRESENTATION || $reviewMode == REVIEW_MODE_BOTH_SIMULTANEOUS || $reviewMode == REVIEW_MODE_PRESENTATIONS_ALONE;
00081 
00082       $templateMgr->assign('showAbstractSteps', $showAbstractSteps);
00083       $templateMgr->assign('showPaperSteps', $showPaperSteps);
00084 
00085       if (isset($this->paper)) {
00086          $templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
00087       }
00088 
00089       parent::display();
00090    }
00091 
00092    function confirmSubmission(&$paper, &$user, &$schedConf, &$conference, $mailTemplate = 'SUBMISSION_ACK') {
00093       // Update search index
00094       import('search.PaperSearchIndex');
00095       PaperSearchIndex::indexPaperMetadata($paper);
00096       PaperSearchIndex::indexPaperFiles($paper);
00097 
00098       // Send author notification email
00099       import('mail.PaperMailTemplate');
00100       $mail = new PaperMailTemplate($paper, $mailTemplate, null, null, null, null, false);
00101       $mail->setFrom($schedConf->getSetting('contactEmail'), $schedConf->getSetting('contactName'));
00102       if ($mail->isEnabled()) {
00103          $mail->addRecipient($user->getEmail(), $user->getFullName());
00104          // If necessary, BCC the acknowledgement to someone.
00105          if($schedConf->getSetting('copySubmissionAckPrimaryContact')) {
00106             $mail->addBcc(
00107                $schedConf->getSetting('contactEmail'),
00108                $schedConf->getSetting('contactName')
00109             );
00110          }
00111          if($schedConf->getSetting('copySubmissionAckSpecified')) {
00112             $copyAddress = $schedConf->getSetting('copySubmissionAckAddress');
00113             if (!empty($copyAddress)) $mail->addBcc($copyAddress);
00114          }
00115 
00116          $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
00117          $editAssignments =& $editAssignmentDao->getEditAssignmentsByPaperId($paper->getId());
00118          while ($editAssignment =& $editAssignments->next()) {
00119             $mail->addBcc($editAssignment->getDirectorEmail(), $editAssignment->getDirectorFullName());
00120             unset($editAssignment);
00121          }
00122 
00123          $mail->assignParams(array(
00124             'authorName' => $user->getFullName(),
00125             'authorUsername' => $user->getUsername(),
00126             'editorialContactSignature' => $schedConf->getSetting('contactName') . "\n" . $conference->getConferenceTitle(),
00127             'submissionUrl' => Request::url(null, null, 'author', 'submission', $paper->getId())
00128          ));
00129          $mail->send();
00130       }
00131    }
00132 
00139    function assignDirectors(&$paper) {
00140       $trackId = $paper->getTrackId();
00141       $schedConf =& Request::getSchedConf();
00142 
00143       $trackDirectorsDao =& DAORegistry::getDAO('TrackDirectorsDAO');
00144       $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
00145 
00146       $trackDirectors =& $trackDirectorsDao->getDirectorsByTrackId($schedConf->getId(), $trackId);
00147 
00148       foreach ($trackDirectors as $trackDirector) {
00149          $editAssignment = new EditAssignment();
00150          $editAssignment->setPaperId($paper->getId());
00151          $editAssignment->setDirectorId($trackDirector->getId());
00152          $editAssignmentDao->insertEditAssignment($editAssignment);
00153          unset($editAssignment);
00154       }
00155 
00156       return $trackDirectors;
00157    }
00158 }
00159 
00160 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7