public function renderPdfSectionFromArray(array $answers, \Jazzee\ApplicantPDF $pdf) { $pdf->addText($this->_applicationPage->getTitle() . "\n", 'h3'); if (!$this->_applicationPage->isRequired() and count($answers) and $this->getArrayStatus($answers) == self::SKIPPED) { $pdf->addText("Applicant Skipped this page.\n", 'p'); } else { foreach ($answers as $answer) { $this->renderPdfAnswerFromArray($this->_applicationPage->getPage(), $pdf, $answer); $pdf->addText("\n", 'p'); } } }
public function pdfValueFromArray(array $answerData, \Jazzee\ApplicantPDF $pdf) { foreach ($answerData['elements'] as $arr) { if ($arr['id'] == $this->_element->getId()) { $pdf->addPdf(\Jazzee\Globals::getFileStore()->getFileContents($arr["values"][0]["value"])); return 'Attached'; } } return null; }
/** * Render a single answer in the PDF * @param \Jazzee\ApplicantPDF $pdf * @param \Jazzee\Entity\Page $page * @param \Jazzee\Entity\Answer $answer */ protected function renderPdfAnswerFromArray(\Jazzee\Entity\Page $page, \Jazzee\ApplicantPDF $pdf, array $answerData) { $locationSummary = ''; $schoolName = ''; $schoolType = ''; foreach ($answerData['elements'] as $element) { if ($element['id'] == 'locationSummary') { $locationSummary = $element['displayValue']; } if ($element['id'] == 'schoolName') { $schoolName = $element['displayValue']; } if ($element['id'] == 'schoolType') { $schoolType = $element['displayValue']; } } $pdf->addText("Type: ", 'b'); $pdf->addText("{$schoolType}\n", 'p'); $pdf->addText("School: ", 'b'); $pdf->addText("{$schoolName}\n", 'p'); $pdf->addText("Location: ", 'b'); $pdf->addText("{$locationSummary}\n", 'p'); parent::renderPdfAnswerFromArray($page, $pdf, $answerData); }
public static function isAllowed($controller, $action, \Jazzee\Entity\User $user = null, \Jazzee\Entity\Program $program = null, \Jazzee\Entity\Application $application = null) { //several views are controller by the complete action if (in_array($action, array('refreshTags', 'refreshPage', 'refreshSirPage'))) { $action = 'index'; } if (in_array($action, array('do', 'doAction', 'pageDo', 'doPageAction'))) { $action = 'editAnswer'; } if (in_array($action, array('pdf', 'pdftemplate'))) { $action = 'pdf'; } //require a working ApplicantPDF class if (in_array($action, array('pdf'))) { if (!\Jazzee\ApplicantPDF::isAvailable()) { return false; } } return parent::isAllowed($controller, $action, $user, $program, $application); }
/** * Create a table from answers * and append any attached PDFs * @param \Jazzee\ApplicantPDF $pdf */ public function renderPdfSection(\Jazzee\ApplicantPDF $pdf) { $pdf->addText($this->_applicationPage->getTitle() . "\n", 'h3'); foreach ($this->getAnswers() as $answer) { foreach ($this->_applicationPage->getPage()->getElements() as $element) { $element->getJazzeeElement()->setController($this->_controller); $value = $element->getJazzeeElement()->pdfValue($answer, $pdf); if (!empty($value)) { $pdf->addText("{$element->getTitle()}: ", 'b'); $pdf->addText("{$value}\n", 'p'); } } if ($child = $answer->getChildren()->first()) { $jazzeePage = $this->_applicationPage->getPage()->getChildren()->first()->getApplicationPageJazzeePage(); $jazzeePage->setApplicant($this->_applicant); $jazzeePage->setController($this->_controller); $jazzeePage->renderLorPdfAnswer($pdf, $this->_applicationPage->getPage()->getChildren()->first(), $child); } if (!$pdf instanceof \Jazzee\RestrictedPDF) { if ($attachment = $answer->getAttachment()) { $pdf->addPdf($attachment->getAttachment()); } } $pdf->addText("\n", 'p'); } }
/** * Render standrad LOR pdf section * @param \Jazzee\ApplicantPDF $pdf * @param \Jazzee\Entity\Page $page * @param \Jazzee\Entity\Answer $answer */ public function renderLorPdfAnswer(\Jazzee\ApplicantPDF $pdf, \Jazzee\Entity\Page $page, \Jazzee\Entity\Answer $answer) { $pdf->addText($page->getTitle() . "\n", 'h5'); $this->renderPdfAnswer($pdf, $page, $answer); }
/** * Create a table from answers * and append any attached PDFs * @param \Jazzee\ApplicantPDF $pdf */ public function renderPdfSection(\Jazzee\ApplicantPDF $pdf) { $pdf->addText($this->_applicationPage->getTitle() . "\n", 'h3'); if ($this->getStatus() == \Jazzee\Interfaces\Page::SKIPPED) { $pdf->addText("Applicant Skipped this page.\n", 'p'); } else { foreach ($this->getAnswers() as $answer) { $this->renderPdfAnswer($pdf, $this->_applicationPage->getPage(), $answer); if ($answer->getMatchedScore()) { foreach ($answer->getMatchedScore()->getSummary() as $key => $value) { $pdf->addText("{$key}: ", 'b'); $pdf->addText("{$value}\n", 'p'); } } else { $pdf->addText('This score has not been received from ETS.', 'p'); } $pdf->addText("\n", 'p'); } } }
/** * Render branching LOR pdf section * @param \Jazzee\ApplicantPDF $pdf * @param \Jazzee\Entity\Page $page * @param \Jazzee\Entity\Answer $answer */ public function renderLorPdfAnswer(\Jazzee\ApplicantPDF $pdf, \Jazzee\Entity\Page $page, \Jazzee\Entity\Answer $answer) { $childAnswer = $answer->getChildren()->first(); $childPage = $childAnswer->getPage(); $pdf->addText($page->getTitle() . "\n", 'h5'); $pdf->addText("{$page->getVar('branchingElementLabel')}: ", 'b'); $pdf->addText("{$childPage->getTitle()}\n", 'p'); $this->renderPdfAnswer($pdf, $childPage, $childAnswer); }