Пример #1
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'id_budget_category')->setDecorators(array('ViewHelper'));
     $mapperExpenseType = new Fefop_Model_Mapper_ExpenseType();
     $expenseTypes = $mapperExpenseType->fetchAll();
     $optExpenseTypes[''] = '';
     foreach ($expenseTypes as $expenseType) {
         $optExpenseTypes[$expenseType['id_budget_category_type']] = $expenseType['description'];
     }
     $elements[] = $this->createElement('select', 'fk_id_budget_category_type')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Komponente')->addMultiOptions($optExpenseTypes)->setRequired(true);
     $elements[] = $this->createElement('text', 'description')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->setAttrib('maxlength', 300)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Naran Rúbrica')->setRequired(true);
     $this->addElements($elements);
     App_Form_Toolbar::build($this, self::ID);
     $this->setDecorators($this->getDefaultFormDecorators());
 }
Пример #2
0
 /**
  * 
  */
 public function removeExpenseTypeAction()
 {
     $json = $this->_mapper->removeExpenseType($this->_getAllParams());
     $this->_helper->json($json);
 }
Пример #3
0
 /**
  * 
  * @param Zend_Form $form
  * @param int $contract
  */
 protected function _populateTypeBudgetForm($form, $contract)
 {
     $mapperContract = new Fefop_Model_Mapper_Contract();
     $rows = $mapperContract->listComponentsContract($contract);
     $optBudgetCategoryType[''] = '';
     foreach ($rows as $row) {
         $optBudgetCategoryType[$row['id_budget_category_type']] = $row['description'];
     }
     $mapperExpenseType = new Fefop_Model_Mapper_ExpenseType();
     $additionalCost = $mapperExpenseType->fetchRow(Fefop_Model_Mapper_ExpenseType::ADDITIONALS);
     $optBudgetCategoryType[Fefop_Model_Mapper_ExpenseType::ADDITIONALS] = $additionalCost->description;
     $form->getElement('fk_id_budget_category_type')->addMultiOptions($optBudgetCategoryType);
 }