✏️ 正在编辑: Chamado.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/forms/Chamado.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_Chamado extends Core_Form { public function init() { $this->setName('f_save_chamado'); $this->setAttrib('onsubmit', 'return validarForm(this);'); if( Yuppie_Auth::getIdentity()->grupo != 'Corretor' ){ $this->addElement('select', 'corretor_id', array( 'label' => 'Corretor:', 'class' => 'require', 'multiOptions' => Core_Combos::getCorretoresOptions(), 'required' => 'required' )); } else { $this->addElement('hidden', 'corretor_id', array( 'value' => Yuppie_auth::getIdentity()->id, 'required' => 'required' )); } $multiOptions = Core_Combos::getAssuntosChamadosOptions(); $this->addElement('select', 'assunto', array( 'label' => 'Assunto:', 'multiOptions' => $multiOptions, 'required' => true )); $this->getElement('assunto')->setAttrib('style', 'width: 200px')->setAttrib('required', true); $this->addElement('textarea', 'descricao', array( 'label' => 'Descrição:', 'rows' => 5, 'cols' => 80, 'required' => true )); $this->getElement('descricao')->setAttrib('required', true); $file = new Zend_Form_Element_File('arquivo'); $file->setLabel('Anexar arquivo:') ->setRequired(false) ->addValidator('Size', false, '2MB') ->addValidator('Extension', false, 'xls,xlsx,csv,txt,png,pdf,jpg,jpeg,zip'); $this->addElement($file); $this->addElement('button', 'btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/chamado'" )); $this->addElement('submit', 'btn_save', array( 'label' => 'Salvar', 'class' => 'bt_save', )); $this->addElement('button', 'btn_new', array( 'label' => 'Novo Chamado', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/chamado/save'" )); $ns = new Zend_Session_Namespace(); $chamadoAssunto = $ns->acl->isAllowed(Yuppie_Auth::getIdentity()->grupo, 'chamado-assunto', 'assunto-listar'); if ($chamadoAssunto) { $this->addElement('button', 'btn-novo-assunto-chamado', array( 'label' => 'Assuntos', 'class' => 'bt_new btn-novo-assunto-chamado', )); } $this->addDisplayGroup(array( 'btn_back', 'btn_save', 'btn_new', 'btn-novo-assunto-chamado' ), 'buttons'); $this->_setDefaultDecorators(); } protected function _setDefaultDecorators() { $this->setDecorators( array( 'FormElements', array( 'HtmlTag', array( 'tag' => 'dl', 'class' => 'f_save_chamado' ) ), 'Form' )); } }
💾 保存文件
← 返回文件管理器