✏️ 正在编辑: OportunidadesNegociosForm.php
路径:
/srv/systems_dir/yuppiecred/application/Modules/Automatizacao/Form/OportunidadesNegociosForm.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php namespace Modules\Automatizacao\Form; use Modules\Automatizacao\Model\DbTable\OportunidadesNegocioTable; class OportunidadesNegociosForm extends \Core_Form { /** @var string */ public const ACTION = '/public/automatizacao/oportunidades-negocios'; /** @var string[] */ public const REQUIREDS = [ 'descricao', 'limite_higienizar' ]; /** * @throws \Zend_Form_Exception */ public function __construct(?int $oportunidade = null) { parent::__construct(); $this->setMethod('post'); $this->setName('automatizacao-oportunidade-negocios'); $this->setAction(domain() . self::ACTION . '-save'); if ($oportunidade) { $dto = (new OportunidadesNegocioTable())->findOrThrow($oportunidade); $dto->especies_invalidas = unserialize($dto->especies_invalidas); $this->populate($dto->toArray()); } } public function init() { $this->addHidden('id') ->addElementWith('descricao', $this->getOptions('Nome do filtro:', 30, 20)) ->addVal('margem_de', 'Margem consig inicial:') ->addVal('margem_cartao_de', 'Margem cartão inicial:') ->addVal('limite_cartao_rcc_de', 'Limite cartão inicial:') ->addVal('parcela_minima', 'Parcela mínima:') ->addTwoOptionsElement('possui_telefone', 'Possui telefone:') ->addMultiOptionElement("especies_invalidas", "Espécies Inválidas:", 'multi_callcenter', \Core_Combos::getEspeciesConsignaveisOptions()) ->addInt('faixa_etaria_de', 'Idade inicial:') ->addInt('faixa_etaria_ate', 'Idade final:') ->addInt('limite_higienizar', 'Qtd. Clientes:') ->buttons(); $this->getElement('faixa_etaria_de') ->addDecorator('Label', array( 'tag' => 'dt', 'tagClass' => 'clear' )); $this->setRequireds(self::REQUIREDS); } protected function buttons() { $this->addElement('button', 'btn_back', [ 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => sprintf(self::WLOCATION, domain(self::ACTION)) ]); $this->addElement('submit', 'btn_save', [ 'label' => 'Salvar', 'class' => 'bt_save' ]); $this->addDisplayGroup(['btn_back', 'btn_save', 'btn_new'], 'buttons'); } /** * @return \Core_Form * @throws \Zend_Form_Exception */ public static function filtro(): \Core_Form { $form = new \Core_Form(); $form->addElement('button', 'btn_new', [ 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => sprintf(self::WLOCATION, domain(self::ACTION . '-save')) ]); return $form; } /** * @param array $values * @return OportunidadesNegociosForm */ public function populate(array $values) { return parent::populate($values); } }
💾 保存文件
← 返回文件管理器