Esempio n. 1
0
 public function paymentForm(\Jazzee\Entity\Applicant $applicant, $amount)
 {
     $form = new \Foundation\Form();
     $form->setAction($this->_controller->getActionPath());
     $form->newHiddenElement('amount', $amount);
     $field = $form->newField();
     $field->setLegend($this->_paymentType->getName());
     $field = $form->newField();
     $instructions = "<p><strong>Application Fee:</strong> &#36;{$amount}</p>";
     $instructions .= '<p><strong>Make Checks Payable to:</strong> ' . $this->_paymentType->getVar('payable') . '</p>';
     if ($this->_paymentType->getVar('address')) {
         $instructions .= '<p><h4>Mail Check to:</h4>' . nl2br($this->_paymentType->getVar('address')) . '</p>';
     }
     if ($this->_paymentType->getVar('coupon')) {
         $instructions .= '<p><h4>Include the following information with your payment:</h4> ' . nl2br($this->_paymentType->getVar('coupon')) . '</p>';
     }
     $search = array('_Applicant_Name_', '_Applicant_ID_', '_Program_Name_', '_Program_ID_');
     $replace = array();
     $replace[] = $applicant->getFirstName() . ' ' . $applicant->getLastName();
     $replace[] = $applicant->getId();
     $replace[] = $applicant->getApplication()->getProgram()->getName();
     $replace[] = $applicant->getApplication()->getProgram()->getId();
     $instructions = str_ireplace($search, $replace, $instructions);
     $instructions .= '<p>Click the Pay By Check button to pay your fee by check.  Your account will be temporarily credited and you can complete your application.  Your application will not be reviewed until your check is recieved.</p>';
     $field->setInstructions($instructions);
     $form->newButton('submit', 'Pay By Check');
     return $form;
 }
 /**
  * Check credentials and intialize members
  */
 public function beforeAction()
 {
     parent::beforeAction();
     if (!isset($this->_store->applicantID)) {
         //Not authenticated
         $this->addMessage('error', "You are not logged in or your session has expired.  Please log in again");
         $this->redirectApplyPath('applicant/login');
     }
     $this->_applicant = $this->_em->getRepository('\\Jazzee\\Entity\\Applicant')->find($this->_store->applicantID);
     //make sure the url path is the actual application
     if ($this->_application != $this->_applicant->getApplication()) {
         $this->redirectApplyPath('applicant/login');
     }
     foreach ($this->_pages as $applicationPage) {
         $applicationPage->getJazzeePage()->setApplicant($this->_applicant);
     }
     $this->setVar('applicant', $this->_applicant);
 }
Esempio n. 3
0
 /**
  * PDF a full single applicant
  * @param \Jazzee\Entity\Applicant $applicant
  * @return string the PDF buffer suitable for display
  */
 public function pdf(\Jazzee\Entity\Applicant $applicant)
 {
     $this->setFont('p');
     $this->pdf->set_info("Title", $this->pdf->convert_to_unicode('utf8', $applicant->getFullName(), '') . ' Application');
     $this->addText($applicant->getFullName() . "\n", 'h1');
     $this->addText('Email Address: ' . $applicant->getEmail() . "\n", 'p');
     $this->write();
     foreach ($applicant->getApplication()->getApplicationPages(\Jazzee\Entity\ApplicationPage::APPLICATION) as $page) {
         if ($page->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) {
             $page->getJazzeePage()->setApplicant($applicant);
             $page->getJazzeePage()->setController($this->_controller);
             $page->getJazzeePage()->renderPdfSection($this);
         }
     }
     $this->write();
     $this->pdf->end_page_ext("");
     $this->attachPdfs();
     $this->pdf->end_document("");
     return $this->pdf->get_buffer();
 }
Esempio n. 4
0
 /**
  * Test each page to see if it is complete
  * @param FormInput $input
  * @return bool
  */
 public function validateInput($input)
 {
     if (!($input = $this->getForm()->processInput($input))) {
         return false;
     }
     if (!$input->get('lock')) {
         $this->getForm()->getElementByName('lock')->addMessage('You must answer yes to submit your application.');
         return false;
     }
     $error = false;
     foreach ($this->_applicant->getApplication()->getApplicationPages(\Jazzee\Entity\ApplicationPage::APPLICATION) as $page) {
         //dont check the lock page (this page), it will never be complete
         if ($page != $this->_applicationPage) {
             if ($page->getJazzeePage()->getStatus() == self::INCOMPLETE) {
                 $error = true;
                 $this->_controller->addMessage('error', 'You have not completed the ' . $page->getTitle() . ' page');
             }
         }
     }
     return !$error;
 }
Esempio n. 5
0
 /**
  * PDF a full single applicant
  * @param \Jazzee\Entity\Applicant $applicant
  * @return string the PDF buffer suitable for display
  */
 public function pdf(\Jazzee\Entity\Applicant $applicant)
 {
     $this->pdf->set_info("Title", $this->pdf->convert_to_unicode('utf8', $applicant->getFullName(), '') . ' Application');
     $this->addText($applicant->getFullName() . "\n", 'h1');
     $this->addText('Email Address: ' . $applicant->getEmail() . "\n", 'p');
     if ($applicant->isLocked()) {
         switch ($applicant->getDecision()->status()) {
             case 'finalDeny':
                 $status = 'Denied';
                 break;
             case 'finalAdmit':
                 $status = 'Admited';
                 break;
             case 'acceptOffer':
                 $status = 'Accepted';
                 break;
             case 'declineOffer':
                 $status = 'Declined';
                 break;
             default:
                 $status = 'No Decision';
         }
     } else {
         $status = 'Not Locked';
     }
     $this->addText("Admission Status: {$status}\n", 'p');
     $this->write();
     foreach ($applicant->getApplication()->getApplicationPages(\Jazzee\Entity\ApplicationPage::APPLICATION) as $page) {
         if ($page->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) {
             $page->getJazzeePage()->setApplicant($applicant);
             $page->getJazzeePage()->setController($this->_controller);
             $page->getJazzeePage()->renderPdfSection($this);
         }
     }
     $this->write();
     $this->pdf->end_page_ext("");
     foreach ($applicant->getAttachments() as $attachment) {
         $this->addPdf($attachment->getAttachment());
     }
     $this->attachPdfs();
     $this->pdf->end_document("");
     return $this->pdf->get_buffer();
 }
Esempio n. 6
0
 /**
  * Get application pages
  * @param \Jazzee\Entity\Applicant $applicant
  */
 protected function getPages(\Jazzee\Entity\Applicant $applicant)
 {
     $pages = array('pages' => array(), 'allowAddAnswer' => $this->checkIsAllowed($this->controllerName, 'addAnswer'), 'allowEditAnswer' => $this->checkIsAllowed($this->controllerName, 'editAnswer'), 'allowDeleteAnswer' => $this->checkIsAllowed($this->controllerName, 'deleteAnswer'));
     $applicationPages = $this->_em->getRepository('\\Jazzee\\Entity\\ApplicationPage')->findBy(array('application' => $applicant->getApplication()->getId(), 'kind' => \Jazzee\Entity\ApplicationPage::APPLICATION), array('weight' => 'asc'));
     foreach ($applicationPages as $applicationPage) {
         if ($applicationPage->getJazzeePage()->showReviewPage()) {
             $params = array($applicant->getId(), $applicationPage->getPage()->getId());
             $content = $this->getActionOutput('refreshPage', $params);
             $content = str_replace(array("\n", "\r"), '', $content);
             $pages['pages'][] = array('id' => $applicationPage->getPage()->getId(), 'content' => $content);
         }
     }
     return $pages;
 }
Esempio n. 7
0
 /**
  * PDF a full single applicant
  * @param \Jazzee\Entity\Applicant $applicant
  * @return string the PDF buffer suitable for display
  */
 public function pdf(\Jazzee\Entity\Applicant $applicant)
 {
     $elements = array('applicant' => array(), 'pages' => array());
     $elements['applicant']['firstName'] = $applicant->getFirstName();
     $elements['applicant']['lastName'] = $applicant->getLastName();
     $elements['applicant']['middleName'] = $applicant->getMiddleName();
     $elements['applicant']['fullName'] = $applicant->getFullName();
     $elements['applicant']['suffix'] = $applicant->getSuffix();
     $elements['applicant']['email'] = $applicant->getEmail();
     $elements['applicant']['id'] = $applicant->getId();
     $elements['applicant']['externalid'] = $applicant->getExternalId();
     if ($applicant->isLocked()) {
         switch ($applicant->getDecision()->status()) {
             case 'finalDeny':
                 $status = 'Denied';
                 break;
             case 'finalAdmit':
                 $status = 'Admited';
                 break;
             case 'acceptOffer':
                 $status = 'Accepted';
                 break;
             case 'declineOffer':
                 $status = 'Declined';
                 break;
             default:
                 $status = 'No Decision';
         }
     } else {
         $status = 'Not Locked';
     }
     $elements['applicant']['status'] = $status;
     foreach ($applicant->getApplication()->getApplicationPages() as $applicationPage) {
         if ($applicationPage->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) {
             $applicationPage->getJazzeePage()->setApplicant($applicant);
             $applicationPage->getJazzeePage()->setController($this->_controller);
             $elements['pages'][$applicationPage->getPage()->getId()] = $applicationPage->getJazzeePage()->getPdfTemplateValues();
         }
     }
     return $this->generatePDF($elements);
 }