Ejemplo n.º 1
0
 /**
  * Get page properties
  *
  * Lists all the properties of a page in an array so it can be compared to other
  * pages and accross cycles
  *
  * @return array
  */
 public function listProperties()
 {
     $properties = array();
     $arr = array('title', 'name', 'min', 'max', 'weight', 'instructions', 'leadingText', 'trailingText');
     foreach ($arr as $name) {
         $func = 'get' . ucfirst($name);
         $properties[$name] = $this->_applicationPage->{$func}();
     }
     if ($this->_applicationPage->isRequired()) {
         $properties['isRequired'] = true;
     } else {
         $properties['isRequired'] = false;
     }
     if ($this->_applicationPage->showAnswerStatus()) {
         $properties['answerStatusDisplay'] = true;
     } else {
         $properties['answerStatusDisplay'] = false;
     }
     $properties['variables'] = array();
     foreach ($this->_applicationPage->getPage()->getVariables() as $var) {
         $properties['variables'][$var->getName()] = $var->getValue();
     }
     $properties['elements'] = array();
     foreach ($this->_applicationPage->getPage()->getElements() as $element) {
         $properties['elements'][$element->getTitle()] = $element->getJazzeeElement()->listProperties();
     }
     return $properties;
 }
Ejemplo n.º 2
0
 /**
  * Skip an optional page
  *
  */
 public function do_skip()
 {
     if ($this->_applicant->getExternalId()) {
         $this->_controller->addMessage('error', 'You have already set your external ID, you must delete it before you can skip this page.');
         return false;
     }
     if (!$this->_applicationPage->isRequired()) {
         $answer = new \Jazzee\Entity\Answer();
         $answer->setPage($this->_applicationPage->getPage());
         $this->_applicant->addAnswer($answer);
         $answer->setPageStatus(self::SKIPPED);
         $this->_controller->getEntityManager()->persist($answer);
     }
 }