00001 <?php
00002
00015
00016
00017
00018 import("submission.form.comment.CommentForm");
00019
00020 class EditorDecisionCommentForm extends CommentForm {
00021
00026 function EditorDecisionCommentForm($article, $roleId) {
00027 parent::CommentForm($article, COMMENT_TYPE_EDITOR_DECISION, $roleId, $article->getArticleId());
00028 }
00029
00033 function display() {
00034 $templateMgr = &TemplateManager::getManager();
00035 $templateMgr->assign('pageTitle', 'submission.comments.editorAuthorCorrespondence');
00036 $templateMgr->assign('articleId', $this->article->getArticleId());
00037 $templateMgr->assign('commentAction', 'postEditorDecisionComment');
00038 $templateMgr->assign('hiddenFormParams',
00039 array(
00040 'articleId' => $this->article->getArticleId()
00041 )
00042 );
00043
00044 $isEditor = $this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR ? true : false;
00045 $templateMgr->assign('isEditor', $isEditor);
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 $journal = &Request::getJournal();
00076
00077
00078
00079
00080
00081 $recipients = array();
00082
00083 if ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {
00084
00085 $user = &$userDao->getUser($this->article->getUserId());
00086
00087 if ($user) $recipients = array_merge($recipients, array($user->getEmail() => $user->getFullName()));
00088 } else {
00089
00090 $editAssignmentDao = &DAORegistry::getDAO('EditAssignmentDAO');
00091 $editAssignments = &$editAssignmentDao->getEditAssignmentsByArticleId($this->article->getArticleId());
00092 $editorAddresses = array();
00093 while (!$editAssignments->eof()) {
00094 $editAssignment =& $editAssignments->next();
00095 $editorAddresses[$editAssignment->getEditorEmail()] = $editAssignment->getEditorFullName();
00096 }
00097
00098
00099
00100 if (empty($editorAddresses)) {
00101 $editors = &$roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getJournalId());
00102 while (!$editors->eof()) {
00103 $editor = &$editors->next();
00104 $editorAddresses[$editor->getEmail()] = $editor->getFullName();
00105 }
00106 }
00107 $recipients = array_merge($recipients, $editorAddresses);
00108 }
00109
00110 parent::email($recipients);
00111 }
00112 }
00113
00114 ?>