Example #1
0
 public function init()
 {
     parent::init();
     // initialize form
     $this->setName('editLinkageForm')->setAction('/register/linkage/edit')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
 }
Example #2
0
 private function PopulateInstitutionsField(C3op_Form_LinkageCreate $form, $currentInstitution = 0)
 {
     $institutionField = $form->getElement('institution');
     if (!isset($this->linkageMapper)) {
         $this->linkageMapper = new C3op_Register_LinkageMapper($this->db);
     }
     if (!isset($this->institutionMapper)) {
         $this->institutionMapper = new C3op_Register_InstitutionMapper($this->db);
     }
     if ($currentInstitution > 0) {
         $linkageInstitution = $this->institutionMapper->findById($currentInstitution);
         $this->view->institutionName = $linkageInstitution->GetName();
         $this->view->linkInstitutionDetail = "/register/institution/detail/?id=" . $currentInstitution;
     }
     $allInstitutions = $this->institutionMapper->getAllIds();
     while (list($key, $institutionId) = each($allInstitutions)) {
         $eachInstitution = $this->institutionMapper->findById($institutionId);
         $institutionField->addMultiOption($institutionId, $eachInstitution->GetName());
     }
     $institutionField->setValue($currentInstitution);
 }