예제 #1
0
 public function alterAction()
 {
     $equipmentModel = new EquipmentModel();
     $documentModel = new DocumentModel();
     $supplyModel = new SupplyModel();
     $equipmentData = $equipmentModel->fetchAll($equipmentModel->getShortEquipmentData());
     $documentData = $documentModel->fetchAll($documentModel->getShortDocumentData());
     $supplyData = $supplyModel->fetchAll('cdsupply = "1"');
     $this->view->equipmentdata = $equipmentData;
     $this->view->documentdata = $documentData;
     $this->view->supplydata = $supplyData;
     $cdmethod = $this->_request->getParam("cdmethod");
     if (isset($cdmethod)) {
         $methodModel = new MethodModel();
         $dataMethod = $methodModel->fetchRow($methodModel->getMethodByCd($cdmethod));
         $this->view->dataMethod = $dataMethod;
     }
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     $equipmentModel = new EquipmentModel();
     $documentModel = new DocumentModel();
     $supplyModel = new SupplyModel();
     $equipmentData = $equipmentModel->fetchAll($equipmentModel->getShortEquipmentData());
     $arrayEquipmentData = array();
     $arrayEquipmentData[0] = "Selecione";
     foreach ($equipmentData as $equipmentdata) {
         $arrayEquipmentData[$equipmentdata->cdequipment] = $equipmentdata->nmequipment;
     }
     $documentData = $documentModel->fetchAll($documentModel->getShortDocumentData());
     $arrayDocumentData = array();
     $arrayDocumentData[0] = "Selecione";
     foreach ($documentData as $documentdata) {
         $arrayDocumentData[$documentdata->cddocument] = $documentdata->nmdocument;
     }
     $supplyData = $supplyModel->fetchAll();
     $arraysupplyData = array();
     $arraysupplyData[0] = "Selecione";
     foreach ($supplyData as $supplydata) {
         $arraysupplyData[$supplydata->cdsupply] = $supplydata->nmsupply;
     }
     $this->_cdmethod = new Zend_Form_Element_Hidden('cdmethod');
     $this->_cdmethod->setAttrib("id", "method_cdmethod");
     //        $this->_cdmethod->setDecorators($this->_decoratorsDefault);
     $this->_cdmethod->setRequired(false);
     $this->_idmethod = new Zend_Form_Element_Text('idmethod');
     $this->_idmethod->setAttrib("id", "method_idmethod");
     $this->_idmethod->setAttrib("size", "15");
     $this->_idmethod->setLabel("ID do Método");
     $this->_idmethod->setDecorators($this->_decoratorsRequired);
     $this->_idmethod->setRequired(true);
     $this->_nmmethod = new Zend_Form_Element_Text('nmmethod');
     $this->_nmmethod->setAttrib("id", "method_nmmethod");
     $this->_nmmethod->setAttrib("size", "58");
     $this->_nmmethod->setLabel("Nome/Descrição do Método");
     $this->_nmmethod->setDecorators($this->_decoratorsRequired);
     $this->_nmmethod->setRequired(true);
     $this->_selectequipment = new Zend_Form_Element_Select('cdequipment');
     $this->_selectequipment->setAttrib("id", "method_select_equipment");
     $this->_selectequipment->setMultiOptions($arrayEquipmentData);
     $this->_selectequipment->setLabel("Equipamento");
     $this->_selectequipment->setDecorators($this->_decoratorsDefault);
     $this->_selectequipment->setRegisterInArrayValidator(true);
     $this->_selectequipment->setRequired(true);
     $this->_selectdocument = new Zend_Form_Element_Select('cddocument');
     $this->_selectdocument->setAttrib("id", "method_select_document");
     $this->_selectdocument->setMultiOptions($arrayDocumentData);
     $this->_selectdocument->setLabel("Documento Relacionado");
     $this->_selectdocument->setDecorators($this->_decoratorsDefault);
     $this->_selectdocument->setRegisterInArrayValidator(true);
     $this->_selectdocument->setRequired(true);
     $this->_samplesize = new Zend_Form_Element_Text('nrsamplesize');
     $this->_samplesize->setAttrib("id", "method_nmsamplesize");
     $this->_samplesize->setAttrib("size", "15");
     $this->_samplesize->setLabel("Tamanho do Ciclo");
     $this->_samplesize->setDecorators($this->_decoratorsDefault);
     $this->_samplesize->setRequired(false);
     $this->_procediment = new Zend_Form_Element_Textarea('dsmethodprocedure');
     $this->_procediment->setAttrib("id", "method_procediment");
     $this->_procediment->setLabel("Procedimento do Método");
     $this->_procediment->setDecorators($this->_decoratorsDefault);
     $this->_procediment->setRequired(false);
     //        $this->_procediment->setValue("boo");
     // Formulário da Grid
     $this->_typecenter = new Zend_Form_Element_Select('typecenter');
     $this->_typecenter->setAttrib("id", "methodsupply_select");
     $this->_typecenter->setMultiOptions($arraysupplyData);
     $this->_typecenter->setLabel("Item (Kit de Exame) ");
     $this->_typecenter->setDecorators($this->_decoratorsDefault);
     $this->_typecenter->setRegisterInArrayValidator(true);
     $this->_typecenter->setRequired(true);
     $this->_nrpriority = new Zend_Form_Element_Text('nrpriority');
     $this->_nrpriority->setAttrib("id", "methodsupply_nrpriority");
     $this->_nrpriority->setAttrib("size", "15");
     $this->_nrpriority->setLabel("Prioridade");
     $this->_nrpriority->setDecorators($this->_decoratorsDefault);
     $this->_nrpriority->setRequired(false);
 }