classes/submission/form/comment/DirectorDecisionCommentForm.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 
00018 import("submission.form.comment.CommentForm");
00019 
00020 class DirectorDecisionCommentForm extends CommentForm {
00021 
00026    function DirectorDecisionCommentForm($paper, $roleId) {
00027       parent::CommentForm($paper, COMMENT_TYPE_DIRECTOR_DECISION, $roleId, $paper->getId());
00028    }
00029 
00033    function display() {
00034       $templateMgr =& TemplateManager::getManager();
00035       $templateMgr->assign('pageTitle', 'submission.comments.directorAuthorCorrespondence');
00036       $templateMgr->assign('paperId', $this->paper->getPaperId());
00037       $templateMgr->assign('commentAction', 'postDirectorDecisionComment');
00038       $templateMgr->assign('hiddenFormParams', 
00039          array(
00040             'paperId' => $this->paper->getPaperId()
00041          )
00042       );
00043 
00044       $isDirector = $this->roleId == ROLE_ID_DIRECTOR || $this->roleId == ROLE_ID_TRACK_DIRECTOR ? true : false;
00045       $templateMgr->assign('isDirector', $isDirector);
00046 
00047       parent::display();
00048    }
00049 
00053    function readInputData() {
00054       $this->readUserVars(
00055          array(
00056             'commentTitle',
00057             'comments'
00058          )
00059       );
00060    }
00061 
00065    function execute() {
00066       parent::execute();
00067    }
00068 
00072    function email() {
00073       $roleDao =& DAORegistry::getDAO('RoleDAO');
00074       $userDao =& DAORegistry::getDAO('UserDAO');
00075       $conference =& Request::getConference();
00076 
00077       // Create list of recipients:
00078 
00079       // Director Decision comments are to be sent to the director or author,
00080       // the opposite of whomever wrote the comment.
00081       $recipients = array();
00082 
00083       if ($this->roleId == ROLE_ID_DIRECTOR || $this->roleId == ROLE_ID_TRACK_DIRECTOR) {
00084          // Then add author
00085          $user =& $userDao->getUser($this->paper->getUserId());
00086 
00087          if ($user) $recipients = array_merge($recipients, array($user->getEmail() => $user->getFullName()));
00088       } else {
00089          // Then add director
00090          $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
00091          $editAssignments =& $editAssignmentDao->getEditAssignmentsByPaperId($this->paper->getPaperId());
00092          $directorAddresses = array();
00093          while (!$editAssignments->eof()) {
00094             $editAssignment =& $editAssignments->next();
00095             $directorAddresses[$editAssignment->getDirectorEmail()] = $editAssignment->getDirectorFullName();
00096          }
00097 
00098          // If no directors are currently assigned to this paper,
00099          // send the email to all directors for the conference
00100          if (empty($directorAddresses)) {
00101             $directors =& $roleDao->getUsersByRoleId(ROLE_ID_DIRECTOR, $conference->getId());
00102             while (!$directors->eof()) {
00103                $director =& $directors->next();
00104                $directorAddresses[$director->getEmail()] = $director->getFullName();
00105             }
00106          }
00107          $recipients = array_merge($recipients, $directorAddresses);
00108       }
00109 
00110       parent::email($recipients);   
00111    }
00112 }
00113 
00114 ?>

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