public function init() { // Makes Combo $ccm_makes = new Model_CcmMakes(); $result1 = $ccm_makes->getAllMakesForAddForm(); $this->_list["ccm_make_id"][''] = "Select"; if ($result1 != false) { foreach ($result1 as $rs) { $this->_list["ccm_make_id"][$rs['pkId']] = $rs['ccmMakeName']; } } //Refrigerant Gas Type Combo /*$list_master = new Model_ListMaster(); $list_master->form_values = array('pk_id' => Model_ListMaster::REFRRIGERATOR_GAS_TYPE); $result2 = $list_master->getListDetailByType(); $this->_list["gas_type"][''] = "Select"; if ($result2 != false) { foreach ($result2 as $rs) { $this->_list["gas_type"][$rs['pkId']] = $rs['listValue']; } }*/ //Generate Asset Types Combo $asset_type = new Model_CcmAssetTypes(); // $asset_type->form_values['parent_id'] = 0; $result3 = $asset_type->getAssetSubTypes(); $this->_list["ccm_asset_type_id_popup"][''] = "Select"; $this->_list["ccm_asset_type_id_update"][''] = "Select"; foreach ($result3 as $rs) { $this->_list["ccm_asset_type_id_popup"][$rs['pkId']] = $rs['assetTypeName']; $this->_list["ccm_asset_type_id_update"][$rs['pkId']] = $rs['assetTypeName']; } //Generate Asset Sub Types Combo $asset_type2 = new Model_CcmAssetTypes(); $asset_type2->form_values['parent_id'] = 'childs'; $result4 = $asset_type2->getAssetSubTypes(); $this->_list["ccm_asset_sub_type"][''] = "Select"; foreach ($result4 as $rs) { $this->_list["ccm_asset_sub_type"][$rs['pkId']] = $rs['assetTypeName']; $this->_list["ccm_asset_sub_type_update"][$rs['pkId']] = $rs['assetTypeName']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "ccm_model_name": case "catalogue_id": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "asset_dimension_length": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "asset_dimension_width": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Width"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "asset_dimension_height": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "gross_capacity_4": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 4"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option")))))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "gross_capacity_20": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option")))))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "gross_capacity_20": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option")))))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "net_capacity_4": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap 4"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option")))))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "net_capacity_20": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option")))))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => 'form-control'), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } if (in_array($col, array_keys($this->_radio))) { $this->addElement("radio", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_radio[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } } }