✏️ 正在编辑: LayoutComissaoPrevista.php
路径:
/srv/systems_dir/yuppiecred/application/forms/LayoutComissaoPrevista.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_LayoutComissaoPrevista extends Core_Form { public function init() { $this->setName('f_layout'); $this->addElement('text', 'codigo_convenio', array( 'label' => 'Cod. Convênio', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'convenio', array( 'label' => 'Nome Convênio', 'required' => true, 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'codigo_tabela', array( 'label' => 'Cod. Tabela', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'tabela', array( 'label' => 'Nome Tabela', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'tipo_formalizacao', array( 'label' => 'Tipo Formalização', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'codigo_produto', array( 'label' => 'Cod. Produto', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'produto', array( 'label' => 'Descrição Produto', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'tipo', array( 'label' => 'Tipo de Contrato', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'base_comissao', array( 'label' => 'Base Comissão', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'base_bonus', array( 'label' => 'Base Bônus', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'base_adiantamento', array( 'label' => 'Base Adiantamento', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'base_diferimento', array( 'label' => 'Base Diferimento', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'prazo_de', array( 'label' => 'Prazo Inicial', 'size' => 2, 'maxLength' => 2, 'required' => true, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'prazo_a', array( 'label' => 'Prazo Final', 'size' => 2, 'maxLength' => 2, 'required' => true, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'valor_fixo', array( 'label' => 'Valor Fixo', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'valor_de', array( 'label' => 'Valor Inicial', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'valor_a', array( 'label' => 'Valor Final', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'validar_faixa_por', array( 'label' => 'Validar Faixa Por', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'comissao', array( 'label' => '% Comissão', 'size' => 2, 'maxLength' => 2, 'required' => true, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'bonus', array( 'label' => '% Bônus', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'adiantamento', array( 'label' => '% Adiantamento', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'diferimento', array( 'label' => '% Diferimento', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'data_inicial', array( 'label' => 'Data Inicial', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'data_base', array( 'label' => 'Data Base (E=emissão ou L=liberação)', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'banco', array( 'label' => 'Banco', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->getElement('banco') ->addDecorator('Label', array( 'tag' => 'dt', 'tagClass' => 'clear' )); $this->addElement('text', 'corretor_id', array( 'label' => 'Corretor ID', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'grupo_comissao', array( 'label' => 'Grupo Comissão', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'taxa_contrato_de', array( 'label' => 'Taxa Inicial', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'taxa_contrato_a', array( 'label' => 'Taxa Final', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'idade_inicial', array( 'label' => 'Idade Inicial', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'idade_final', array( 'label' => 'Idade Final', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'incidir_sobre', array( 'label' => 'Incidir Sobre (Contrato / Empresa)', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); $this->addElement('text', 'especie', array( 'label' => 'Espécie', 'size' => 2, 'maxLength' => 2, 'attribs' => array( 'layout' => true ) )); foreach ( $this->getElements() as $elementName => $element ) { $this->addDisplayGroup(array( $elementName), "group_{$elementName}"); $group = $this->getDisplayGroup("group_{$elementName}"); $group->setDecorators(array( 'FormElements', array( 'HtmlTag', array( 'tag' => 'div', 'class' => 'layout' ) ) )); } $this->addElement('text', 'descricao', array( 'label' => 'Descrição:', 'required' => true, 'size' => 45 )); $this->addElement('select', 'banco_id', [ 'label' => 'Banco (opcional):', 'multiOptions' => Core_Combos::getBancosOptions() ]); $this->addElement('hidden', 'id'); $this->addDisplayGroup(array( 'descricao', 'banco_id', 'id' ), 'layout_nome', array( 'legend' => 'Nome do Layout' )); $this->addElement('button', 'btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->baseUrl('layout-comissao-prevista') . "'" )); $this->addElement('submit', 'btn_save', array( 'label' => 'Salvar', 'class' => 'bt_save' )); $this->addElement('button', 'btn_new', array( 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->baseUrl('layout-comissao-prevista/save') . "'" )); $this->addDisplayGroup(['btn_back', 'btn_save', 'btn_new'], 'buttons'); foreach ( $this->getElements() as $elements ) { if( $elements->getAttrib('layout') ){ $elements->setBelongsTo('layout'); //função para preencher só letras $elements->setAttrib('onKeypress', "return soLetras(event)"); } } foreach ( $this->getDisplayGroups() as $displayGroup ) { $displayGroup->removeDecorator('DtDdWrapper'); if( $displayGroup->getName() == "layout_nome" ){ $displayGroup->removeDecorator('HtmlTag'); } if( $displayGroup->getName() == 'buttons' ){ foreach ( $displayGroup->getElements() as $element ) { $element->setDecorators(array( 'ViewHelper' )); } } } } public function isValid($data) { $valid = true; if (empty($data['layout']['codigo_tabela']) && empty($data['layout']['tabela'])) { $this->getElement('codigo_tabela')->addError("Informe um código OU nome para a tabela."); $valid = false; } return $valid && parent::isValid($data); } }
💾 保存文件
← 返回文件管理器