コード例 #1
0
 /**
  * Initialize form data with the author name and the monograph id.
  * @param $args array
  * @param $request PKPRequest
  */
 function initData($args, &$request)
 {
     $press =& $request->getPress();
     $monograph =& $this->getMonograph();
     $submitter = $monograph->getUser();
     import('classes.mail.MonographMailTemplate');
     $email = new MonographMailTemplate($monograph, 'EDITOR_DECISION_ACCEPT');
     $paramArray = array('authorName' => $submitter->getFullName(), 'pressName' => $press->getLocalizedName(), 'monographTitle' => $monograph->getLocalizedTitle(), 'editorialContactSignature' => $submitter->getContactSignature());
     $email->assignParams($paramArray);
     $actionLabels = array(SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS => 'editor.monograph.decision.requestRevisions', SUBMISSION_EDITOR_DECISION_RESUBMIT => 'editor.monograph.decision.resubmit', SUBMISSION_EDITOR_DECISION_DECLINE => 'editor.monograph.decision.decline');
     $this->_data = array('monographId' => $monograph->getId(), 'decision' => $this->getDecision(), 'authorName' => $monograph->getAuthorString(), 'personalMessage' => $email->getBody(), 'actionLabel' => $actionLabels[$this->getDecision()]);
     return parent::initData($args, $request);
 }
コード例 #2
0
 /**
  * @see Form::initData()
  * @param $actionLabels array
  */
 function initData($args, &$request, $actionLabels)
 {
     $press =& $request->getPress();
     $seriesEditorSubmission =& $this->getSeriesEditorSubmission();
     $submitter = $seriesEditorSubmission->getUser();
     import('classes.mail.MonographMailTemplate');
     $email = new MonographMailTemplate($seriesEditorSubmission, 'EDITOR_DECISION_ACCEPT');
     $paramArray = array('authorName' => $submitter->getFullName(), 'pressName' => $press->getLocalizedName(), 'monographTitle' => $seriesEditorSubmission->getLocalizedTitle(), 'editorialContactSignature' => $submitter->getContactSignature());
     $email->assignParams($paramArray);
     $data = array('monographId' => $seriesEditorSubmission->getId(), 'decision' => $this->getDecision(), 'authorName' => $seriesEditorSubmission->getAuthorString(), 'personalMessage' => $email->getBody(), 'actionLabel' => $actionLabels[$this->getDecision()]);
     foreach ($data as $key => $value) {
         $this->setData($key, $value);
     }
     return parent::initData($args, $request);
 }
 /**
  * @copydoc Form::initData()
  */
 function initData($args, $request, $actionLabels)
 {
     $context = $request->getContext();
     $router = $request->getRouter();
     $dispatcher = $router->getDispatcher();
     $submission = $this->getSubmission();
     $user = $request->getUser();
     import('lib.pkp.classes.mail.SubmissionMailTemplate');
     $emailKeys = array(SUBMISSION_EDITOR_DECISION_ACCEPT => 'EDITOR_DECISION_ACCEPT', SUBMISSION_EDITOR_DECISION_DECLINE => 'EDITOR_DECISION_DECLINE', SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW => 'EDITOR_DECISION_SEND_TO_EXTERNAL', SUBMISSION_EDITOR_DECISION_RESUBMIT => 'EDITOR_DECISION_RESUBMIT', SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS => 'EDITOR_DECISION_REVISIONS', SUBMISSION_EDITOR_DECISION_SEND_TO_PRODUCTION => 'EDITOR_DECISION_SEND_TO_PRODUCTION');
     $email = new SubmissionMailTemplate($submission, $emailKeys[$this->getDecision()]);
     $paramArray = array('authorName' => $submission->getAuthorString(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => $dispatcher->url($request, ROUTE_PAGE, null, 'authorDashboard', 'submission', $submission->getId()));
     $email->assignParams($paramArray);
     // If we are in review stage we need a review round.
     $reviewRound = $this->getReviewRound();
     if (is_a($reviewRound, 'ReviewRound')) {
         $this->setData('reviewRoundId', $reviewRound->getId());
     }
     $data = array('submissionId' => $submission->getId(), 'decision' => $this->getDecision(), 'authorName' => $submission->getAuthorString(), 'personalMessage' => $email->getBody() . "\n" . $context->getSetting('emailSignature'), 'actionLabel' => $actionLabels[$this->getDecision()]);
     foreach ($data as $key => $value) {
         $this->setData($key, $value);
     }
     return parent::initData($args, $request);
 }