✏️ 正在编辑: Setor.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/forms/Setor.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_Setor extends Core_Form { public function init() { $this->setName('f_save_setor'); $this->addElement('hidden', 'id', array( 'class' => 'invisivel' )); $this->addElement('text', 'nome', array( 'label' => 'Nome:', 'size' => 35, 'required' => true )); $select = new Zend_Form_Element_Select('setor_pai'); $select->setLabel('Setor Pai:') ->addMultiOptions(Core_Combos::getSetoresCadastroOptions()); $this->addElement($select); $this->addElement('button', 'btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->baseUrl() . "/setor'" )); $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() . "/setor/save'" )); $this->addDisplayGroup(array( 'btn_back', 'btn_save', 'btn_new' ), 'buttons'); } protected function _getSetorPaiOptions2() { //verifica se está editando para retirar a própria setor da listagem $front = Zend_Controller_Front::getInstance(); $id = (int) $front->getRequest()->getParam('id'); $model = new Model_Setor(); $options = array( "" => "" ); foreach ( $model->listar("id <> " . $id, 'nome ASC') as $setor ) { $options[$setor->id] = $setor->nome; } return $options; } }
💾 保存文件
← 返回文件管理器