Exemplo n.º 1
0
 /**
  * Handle adding the position form to the person page view page.
  * @param iHRIS_PageView $page
  * @return boolean
  */
 public function action_position($page)
 {
     if (!$page instanceof iHRIS_PageView) {
         return false;
     }
     return $page->addChildForms('position', 'siteContent');
 }
 /**
  * Method to display the dependent child forms on the view person page.
  * @param iHRIS_PageView $pageObject
  **/
 public function show_nextofkin($pageObject)
 {
     if (!$pageObject instanceof iHRIS_PageView) {
         return;
     }
     $pageObject->addChildForms('nextofkin');
     return true;
 }
 /**
  * Handle adding the training form to the person page view page.
  * @param iHRIS_PageView $page
  * @return boolean
  */
 public function action_training($page)
 {
     if (!$page instanceof iHRIS_PageView) {
         return false;
     }
     $page->getPerson()->populateChildren(array("training"), array("training" => "intake_date"));
     if (!array_key_exists("training", $page->getPerson()->children) || !is_array($page->getPerson()->children["training"])) {
         return true;
     }
     $factory = I2CE_FormFactory::instance();
     foreach ($page->getPerson()->children["training"] as $obj) {
         $node = $page->getTemplate()->appendFileById("view_training.html", "div", "training");
         $page->getTemplate()->setForm($obj, $node);
         $obj->populateChildren(array("registration", "license"), array("registration" => "registration_date", "license" => "-start_date"));
         if (array_key_exists("registration", $obj->children)) {
             $page->getTemplate()->setForm(current($obj->children["registration"]), $node);
         } else {
             $page->getTemplate()->setForm($factory->createContainer("registration"), $node);
         }
         if (array_key_exists("license", $obj->children)) {
             $page->getTemplate()->setForm(current($obj->children["license"]), $node);
         } else {
             $page->getTemplate()->setForm($factory->createContainer("license"), $node);
         }
     }
     return true;
 }
 /**
  * Method to display the dependent child forms on the view person page.
  * @param iHRIS_PageView $pageObject
  **/
 public function show_dependents($pageObject)
 {
     $pageObject->addChildForms('dependent');
     return true;
 }