✏️ 正在编辑: Convenio.php
路径:
/srv/systems_dir/yuppiecred/application/forms/Convenio.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_Convenio extends Core_Form { public function init() { $this->setName('f_save_convenio'); $this->addElement('hidden', 'id', [ 'class' => 'invisivel' ]); $this->addElement('text', 'nome', [ 'label' => 'Nome:', 'size' => 35, 'required' => true ]); $this->addElement('text', 'codigo', [ 'label' => 'Código:', 'size' => 15, 'readonly' => true, 'title' => "Campo bloqueado porque é alimentado pelas importações" ]); $select = new Zend_Form_Element_Select('parent_id'); $select->setLabel('Convênio pai:') ->addMultiOptions(Core_Combos::getConveniosOptions()); $this->addElement($select); $this->addElement('text', 'valor_base', [ 'label' => 'Teto Anti-fraude (R$):', 'onkeypress' => 'mascara(this, mvalor)', 'size' => 15 ]); $this->addElement('select', 'aumento_salarial', [ 'label' => 'Aumento Salarial:', 'multiOptions' => Core_Combos::getSimNaoOptions(), 'title' => 'Selecionando essa opção, ao cadastrar uma proposta ' . 'do tipo NOVO o sistema irá exibir uma mensagem de confirmação pergutando se ' . 'deseja que essa proposta seja salva também com o tipo AUMENTO SALARIAL' ]); $this->getElement('aumento_salarial')->addDecorator('Label', ['tag' => 'dt', 'tagClass' => 'clear']); $this->addElement('select', 'exibir_simulacao_aberta', [ 'label' => 'Simulação Aberta:', 'multiOptions' => Core_Combos::getSimNaoOptions() ]); $this->getElement('exibir_simulacao_aberta')->addDecorator('Label', ['tag' => 'dt', 'tagClass' => 'clear']); $this->addElement('select', 'permitir_digitacao_automatica', [ 'label' => 'Digitação Em Lote:', 'multiOptions' => Core_Combos::getSimNaoOptions() ]); $this->_initButtons(); } protected function _initButtons() { $this->addElement('button', 'btn_back', [ 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/convenio'" ]); $this->addElement('submit', 'btn_save', [ 'label' => 'Salvar', 'class' => 'bt_save' ]); $this->addElement('button', 'btn_new', [ 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/convenio/save'" ]); $this->addDisplayGroup(['btn_back', 'btn_save', 'btn_new'], 'buttons'); } public function populate(array $values) { if( isset($values['id']) && $values['id'] ){ $multiOptions = $this->getElement('parent_id')->getMultiOptions(); unset($multiOptions[$values['id']]); $this->getElement('parent_id')->setMultiOptions($multiOptions); } if( isset($values['valor_base']) && $values['valor_base'] ){ $values['valor_base'] = number_format($values['valor_base'], 2, ',', '.'); } return parent::populate($values); } }
💾 保存文件
← 返回文件管理器