✏️ 正在编辑: ProspectoContato.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/forms/ProspectoContato.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_ProspectoContato extends Core_Form { public function init() { $this->setName('f_save_contato'); $this->addElement('hidden', 'id', array( 'class' => 'invisivel' )); $this->_addComboCliente(); $select = new Zend_Form_Element_Select('classificacao'); $select->setLabel('Classificação:') ->setRequired(true) ->addMultiOptions(Core_Combos::getPropectoClassificacoesOptions()); $this->addElement($select); $this->addElement(Form_DatePicker::getDatePicker('data_retorno', 'Data Retorno:', '', true)); $select = new Zend_Form_Element_Select('nota'); $select->setLabel('Nota do Atendimento:') ->setRequired(true) ->addMultiOptions([ '' => '', '0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10' ]); $this->addElement($select); $this->getElement('nota')->addDecorator('Label', ['tag' => 'dt', 'tagClass' => 'clear']); $select = new Zend_Form_Element_Select('corretor_id'); $select->setLabel('Corretor:') ->setRequired(true) ->addMultiOptions(Core_Combos::getCorretoresOptions()); $this->addElement($select); $this->getElement('corretor_id')->addDecorator('Label', ['tag' => 'dt', 'tagClass' => 'clear']); $this->addElement('textarea', 'motivo', array( 'label' => 'Motivo:', 'rows' => 5, 'cols' => 50 )); $this->addElement('textarea', 'comentario', array( 'label' => 'Comentário:', 'rows' => 5, 'cols' => 50 )); $this->addElement('button', 'btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.close()" )); $this->addElement('submit', 'btn_save', array( 'label' => 'Salvar', 'class' => 'bt_save' )); $this->addDisplayGroup(array( 'btn_back', 'btn_save' ), 'buttons'); $this->addElement('hidden', 'contrato_id', [ 'class' => 'invisivel' ]); $this->_setDefaultDecorators(); } protected function _setDefaultDecorators() { $this->setDecorators( array( 'FormElements', array( 'HtmlTag', array( 'tag' => 'dl', 'class' => 'form_contato' ) ), 'Form' )); } protected function _addComboCliente() { $front = Zend_Controller_Front::getInstance(); //pega o id do cliente $id = (int) $front->getRequest()->getParam('prospecto_id'); //verifica se passou o id por parâmetro if( $id <= 0 ){ $select = new Zend_Form_Element_Select('prospecto_id'); $select->setLabel('Prospecto/Cliente:') ->setRequired(true) ->addMultiOptions($this->_getClientesOptions()); $this->addElement($select); } } protected function _getClientesOptions() { $dbtable = new Model_DbTable_Cliente(); $values = $dbtable->fetchAllClientesProspectos(null, "nome ASC"); $options = array("" => ""); foreach( $values as $value ){ $options[$value['id']] = $value['nome']; } return $options; } }
💾 保存文件
← 返回文件管理器