コード例 #1
0
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Desaprovar_Cessao');
     $this->form->class = 'tform';
     // CSS class
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // add a row for the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $row->addCell(new TLabel('Desaprovar Cessao'))->colspan = 2;
     // create the form fields
     $numeroCessao = new TEntry('numeroCessao');
     $numeroCessao->setTip('Número do processo gerado no SIGA');
     // define the sizes
     $numeroCessao->setSize(200);
     // add one row for each form field
     $table->addRowSet(new TLabel('Nº da Cessão:'), $numeroCessao);
     $this->form->setFields(array($numeroCessao));
     // keep the form filled during navigation with session data
     $this->form->setData(TSession::getValue('Cessao_filter_data'));
     // create two action buttons to the form
     $find_button = TButton::create('find', array($this, 'onSearch'), 'Buscar', 'ico_find.png');
     //$new_button  = TButton::create('new',  array('CessaoForm', 'onEdit'), 'Novo', 'ico_new.png');
     $this->form->addField($find_button);
     //$this->form->addField($new_button);
     $buttons_box = new THBox();
     $buttons_box->add($find_button);
     //$buttons_box->add($new_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     // creates a Datagrid
     parent::include_css('app/resources/custom-table.css');
     $this->datagrid = new TDataGrid();
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     $this->datagrid->makeScrollable();
     $this->datagrid->disableDefaultClick();
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right', 80);
     $srp = new TDataGridColumn('numeroSRP', 'Nº SRP', 'left', 100);
     $numeroCessao = new TDataGridColumn('numeroCessao', 'Nº da Cessão', 'left', 250);
     $data = new TDataGridColumn('emissao', 'Data', 'left', 100);
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($srp);
     $this->datagrid->addColumn($numeroCessao);
     $this->datagrid->addColumn($data);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array($this, 'onQuestionAprovarCessao'));
     $action1->setLabel('Desaprovar Cessao');
     $action1->setImage('fa:history fa-fw');
     $action1->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     //limpar a sessao com detalhes de itens e cessao
     TSession::delValue('cessao_itens');
     TSession::delValue('SRP_id');
     TSession::delValue('form_cessao');
     // create the page container
     //$container = TVBox::pack( $this->form, $this->datagrid);
     $container = new TTable();
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->addRow()->addCell($this->form);
     $container->addRow()->addCell($this->datagrid);
     //$container->addRow()->addCell($this->pageNavigation);
     parent::add($container);
 }
コード例 #2
0
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/custom-table.css');
     // creates the form
     $this->form = new TForm('form_search_Subelemento');
     $this->form->class = 'tform';
     // CSS class
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // add a row for the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     $row->addCell(new TLabel('Consulta SubElemento'))->colspan = 2;
     //$table->addRowSet( new TLabel('Consulta SubElemento') ,'')->class = 'tformtitle'; // CSS class
     // create the form fields
     $descricao = new TEntry('descricao');
     // define the sizes
     $descricao->setSize(350);
     // add one row for each form field
     $table->addRowSet(new TLabel('Descrição:'), $descricao);
     $this->form->setFields(array($descricao));
     // keep the form filled during navigation with session data
     $this->form->setData(TSession::getValue('Subelemento_filter_data'));
     // create two action buttons to the form
     $find_button = TButton::create('find', array($this, 'onSearch'), _t('Find'), 'ico_find.png');
     $this->form->addField($find_button);
     $buttons_box = new THBox();
     $buttons_box->add($find_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     // creates a Datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right', 100);
     $descricao = new TDataGridColumn('descricao', 'Descrição', 'left');
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($descricao);
     // creates the datagrid column actions
     $order_id = new TAction(array($this, 'onReload'));
     $order_id->setParameter('order', 'id');
     $id->setAction($order_id);
     $order_descricao = new TAction(array($this, 'onReload'));
     $order_descricao->setParameter('order', 'descricao');
     $descricao->setAction($order_descricao);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create the page container
     $container = new TTable();
     //$container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->addRow()->addCell($this->form);
     $container->addRow()->addCell($this->datagrid);
     $container->addRow()->addCell($this->pageNavigation);
     parent::add($container);
 }
コード例 #3
0
ファイル: SrpReport.class.php プロジェクト: andermall/tcc
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Srp_report');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // creates the table container
     $table = new TTable();
     $table->width = '100%';
     // add the table inside the form
     $this->form->add($table);
     // define the form title
     $row = $table->addRow();
     //Set( new TLabel('Relatório de Srp'), '', '','', '' )->class = 'tformtitle';
     $row->class = 'tformtitle';
     $row->addCell(new TLabel('Relatório de Srp'))->colspan = 2;
     // create the form fields
     $numeroSRPI = new TEntry('numeroSRPI');
     $numeroSRPF = new TEntry('numeroSRPF');
     $numeroIRPI = new TEntry('numeroIRPI');
     $numeroIRPF = new TEntry('numeroIRPF');
     $numeroProcessoI = new TEntry('numeroProcessoI');
     $numeroProcessoF = new TEntry('numeroProcessoF');
     $validadeI = new TDate('validadeI');
     $validadeF = new TDate('validadeF');
     $nomeI = new TEntry('nomeI');
     $nomeF = new TEntry('nomeF');
     $itensZero = new TRadioGroup('itensZero');
     // define the sizes
     $numeroSRPI->setSize(150);
     $numeroSRPF->setSize(150);
     $numeroIRPI->setSize(150);
     $numeroIRPF->setSize(150);
     $numeroProcessoI->setSize(150);
     $numeroProcessoF->setSize(150);
     $validadeI->setSize(85);
     $validadeI->setProperty('style', 'margin-right : 0px');
     $validadeF->setSize(85);
     $validadeF->setProperty('style', 'margin-right : 0px');
     //$aprovado->setSize(90);
     //mask
     $validadeI->setMask('dd/mm/yyyy');
     $validadeF->setMask('dd/mm/yyyy');
     $validadeF->setValue(date('d/m/Y'));
     //$validadeI->setNumericMask(0, '', '');
     // validations
     //$aprovado->addValidation('Aprovado', new TRequiredValidator);
     $validadeF->addValidation('Validade - Até', new TDateValidator(), array('dd/mm/yyyy'));
     $itensZero->addItems(array('1' => 'Sim', '0' => 'Não'));
     $itensZero->setValue('0');
     $itensZero->setLayout('horizontal');
     // add one row for each form field
     $table->addRowSet(new TLabel('Nº SRP'), array($numeroSRPI, new TLabel('Até'), $numeroSRPF));
     $table->addRowSet(new TLabel('Nº IRP'), array($numeroIRPI, new TLabel('Até'), $numeroIRPF));
     $table->addRowSet(new TLabel('Nº Processo'), array($numeroProcessoI, new TLabel('Até'), $numeroProcessoF));
     $table->addRowSet(new TLabel('Emissão'), array($validadeI, new TLabel('Até'), $validadeF));
     $table->addRowSet(new TLabel('Lista itens zerado?'), $itensZero);
     $this->form->setFields(array($numeroProcessoI, $numeroProcessoF, $numeroIRPI, $numeroIRPF, $nomeI, $nomeF, $validadeI, $validadeF, $numeroSRPI, $numeroSRPF, $itensZero));
     //$aprovado->addItems(array('1' => 'Sim', '0' => 'Não', '%' => 'Todos'));
     //$aprovado->setValue('%');
     //$aprovado->setLayout('horizontal');
     $generate_button = TButton::create('generate', array($this, 'onGenerate'), _t('Generate'), 'ico_apply.png');
     $this->form->addField($generate_button);
     // add a row for the form action
     $table->addRowSet($generate_button, '')->class = 'tformaction';
     $container = new TTable();
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->addRow()->addCell($this->form);
     parent::add($container);
 }
コード例 #4
0
ファイル: CampusList.class.php プロジェクト: andermall/tcc
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/custom-table.css');
     // creates the form
     $this->form = new TForm('form_search_Campus');
     $this->form->class = 'tform';
     // CSS class
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     // add a row for the form title
     $table->addRowSet(new TLabel('Consulta Câmpus'), '')->class = 'tformtitle';
     // CSS class
     $this->form->add($table);
     // create the form fields
     $nome = new TEntry('nome');
     $nome->setValue(TSession::getValue('s_nome'));
     $uasg = new TEntry('uasg');
     $uasg->setValue(TSession::getValue('s_uasg'));
     $sigla = new TEntry('sigla');
     $sigla->setValue(TSession::getValue('s_sigla'));
     // define the sizes
     $nome->setSize(500);
     $uasg->setSize(100);
     $sigla->setSize(150);
     // add one row for each form field
     $table->addRowSet(new TLabel('Nome:'), $nome);
     $table->addRowSet(new TLabel('UASG:'), $uasg);
     $table->addRowSet(new TLabel('Sigla:'), $sigla);
     $this->form->setFields(array($nome, $uasg, $sigla));
     // keep the form filled during navigation with session data
     $this->form->setData(TSession::getValue('Campus_filter_data'));
     // create two action buttons to the form
     $find_button = TButton::create('find', array($this, 'onSearch'), 'Buscar', 'ico_find.png');
     $new_button = TButton::create('new', array('CampusForm', 'onEdit'), 'Novo', 'ico_new.png');
     $this->form->addField($find_button);
     $this->form->addField($new_button);
     $buttons_box = new THBox();
     $buttons_box->add($find_button);
     $buttons_box->add($new_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     // creates a Datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right');
     $nome = new TDataGridColumn('nome', 'Nome', 'left');
     $uasg = new TDataGridColumn('uasg', 'UASG', 'left');
     $sigla = new TDataGridColumn('sigla', 'Sigla', 'left');
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($uasg);
     $this->datagrid->addColumn($sigla);
     // creates the datagrid column actions
     $order_id = new TAction(array($this, 'onReload'));
     $order_id->setParameter('order', 'id');
     $id->setAction($order_id);
     $order_nome = new TAction(array($this, 'onReload'));
     $order_nome->setParameter('order', 'nome');
     $nome->setAction($order_nome);
     $order_uasg = new TAction(array($this, 'onReload'));
     $order_uasg->setParameter('order', 'uasg');
     $uasg->setAction($order_uasg);
     $order_sigla = new TAction(array($this, 'onReload'));
     $order_sigla->setParameter('order', 'sigla');
     $sigla->setAction($order_sigla);
     // inline editing
     $nome_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $nome_edit->setField('id');
     $nome->setEditAction($nome_edit);
     /*
             $uasg_edit = new TDataGridAction(array($this, 'onInlineEdit'));
             $uasg_edit->setField('id');
             $uasg->setEditAction($uasg_edit);
     
             $sigla_edit = new TDataGridAction(array($this, 'onInlineEdit'));
             $sigla_edit->setField('id');
             $sigla->setEditAction($sigla_edit);
     */
     // creates two datagrid actions
     $action1 = new TDataGridAction(array('CampusForm', 'onEdit'));
     $action1->setLabel(_t('Edit'));
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel(_t('Delete'));
     $action2->setImage('ico_delete.png');
     $action2->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $container = new TTable();
     //$container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->addRow()->addCell($this->form);
     $container->addRow()->addCell($this->datagrid);
     $container->addRow()->addCell($this->pageNavigation);
     // add the container inside the page
     parent::add($container);
 }
コード例 #5
0
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_search_Requisicao');
     $this->form->class = 'tform';
     // CSS class
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // add a row for the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $row->addCell(new TLabel('Consulta Requisicao'))->colspan = 2;
     // create the form fields
     $numeroProcesso = new TEntry('numeroProcesso');
     // define the sizes
     $numeroProcesso->setSize(200);
     $numeroProcesso->setMaxLength(30);
     $numeroProcesso->setTip('Número do processo gerado no SIGA');
     // add one row for each form field
     $table->addRowSet(new TLabel('Nº do Processo:'), $numeroProcesso);
     $this->form->setFields(array($numeroProcesso));
     // keep the form filled during navigation with session data
     $this->form->setData(TSession::getValue('Requisicao_filter_data'));
     // create two action buttons to the form
     $find_button = TButton::create('find', array($this, 'onSearch'), 'Buscar', 'ico_find.png');
     $new_button = TButton::create('new', array('RequisicaoForm', 'onEdit'), 'Novo', 'ico_new.png');
     $this->form->addField($find_button);
     $this->form->addField($new_button);
     $buttons_box = new THBox();
     $buttons_box->add($find_button);
     $buttons_box->add($new_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     // creates a Datagrid
     parent::include_css('app/resources/custom-table.css');
     $this->datagrid = new TDataGrid();
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right', 80);
     $srp = new TDataGridColumn('numeroSRP', 'Nº SRP', 'left', 100);
     $numeroProcesso = new TDataGridColumn('numeroProcesso', 'Nº do processo', 'left', 250);
     $data = new TDataGridColumn('emissao', 'Data', 'left', 100);
     $id->setTransformer(array($this, 'rowFormat'));
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($srp);
     $this->datagrid->addColumn($numeroProcesso);
     $this->datagrid->addColumn($data);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array('RequisicaoForm', 'onEdit'));
     //$action1 = new TDataGridAction(array($this, 'onCheckValidadeSRP'));
     $action1->setLabel('Editar');
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action1->setDisplayCondition(array($this, 'onDisplayConditionEdit'));
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel('Excluir');
     $action2->setImage('ico_delete.png');
     $action2->setField('id');
     $actAprovar = new TDataGridAction(array($this, 'onQuestionAprovarRequisicao'));
     $actAprovar->setLabel('Aprovar Requisição');
     $actAprovar->setImage('fa:check fa-fw');
     $actAprovar->setField('id');
     $actAprovar->setDisplayCondition(array($this, 'onDisplayConditionEdit'));
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     $this->datagrid->addAction($actAprovar);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     //limpar a sessao com detalhes de itens e requisicao
     TSession::delValue('requisicao_itens');
     TSession::delValue('SRP_id');
     TSession::delValue('form_requisicao');
     // create the page container
     //$container = TVBox::pack($this->form, $this->datagrid, $this->pageNavigation);
     $container = new TTable();
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->addRow()->addCell($this->form);
     $container->addRow()->addCell($this->datagrid);
     $container->addRow()->addCell($this->pageNavigation);
     parent::add($container);
 }
コード例 #6
0
ファイル: DocCessaoForm.class.php プロジェクト: andermall/tcc
 function __construct()
 {
     parent::__construct();
     $this->form = new TForm('doc_cessao_form');
     $this->form->style = 'width : 500px;';
     $this->form->class = 'tform';
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     $row = $table->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $row->addCell(new TLabel('Gerar Documentos da Cessão'))->colspan = 2;
     // cria os campos do formulário
     $memorando = new TEntry('memorando');
     //$cidade = new TEntry('cidade');
     $emissao = new TDate('emissao');
     $campusID = new TEntry('campusID');
     //TDBSeekButton('campusID', 'saciq', 'doc_cessao_form', 'Campus', 'nome', 'campusID', 'campusNome');
     $campusNome = new TEntry('campusNome');
     $gerente = new TEntry('gerente');
     $diretor = new TEntry('diretor');
     $cessao_id = new THidden('cessao_id');
     // define the sizes
     $memorando->setSize(300);
     //$cidade->setSize(200);
     $emissao->setSize(90);
     $emissao->setProperty('style', 'margin-right : 0px');
     $campusID->setSize(50);
     $campusID->setEditable(false);
     $campusNome->setSize(226);
     $campusNome->setEditable(false);
     $gerente->setSize(300);
     $diretor->setSize(300);
     //mascara
     $emissao->setMask('dd/mm/yyyy');
     $emissao->setValue(date('d/m/Y'));
     //validadores
     $memorando->addValidation('Memorando', new TRequiredValidator());
     $memorando->addValidation('Memorando', new TMaxLengthValidator(), array(70));
     $emissao->addValidation('Emissão', new TRequiredValidator());
     $campusID->addValidation('Destino', new TRequiredValidator());
     $gerente->addValidation('Gerente Administrativo(a)', new TRequiredValidator());
     $gerente->addValidation('Gerente Administrativo(a)', new TMaxLengthValidator(), array(70));
     $diretor->addValidation('Diretor(a) Geral', new TRequiredValidator());
     $diretor->addValidation('Diretor(a) Geral', new TMaxLengthValidator(), array(70));
     $memorando->setTip('Descrição do Memorando que aparecerá no início do documento.');
     $gerente->setTip('Nome do gerente em exercício');
     $diretor->setTip('Nome do diretor geral em exercício');
     $value = TSession::getValue('doc_cessao_form_cessao_id');
     if (isset($value)) {
         $cessao_id->setValue($value);
     }
     // add one row for each form field
     $table->addRowSet(new TLabel('Memorando:'), $memorando);
     //$table->addRowSet(new TLabel('Cidade:'), $cidade);
     $table->addRowSet(new TLabel('Emissão:'), $emissao);
     //$table->addRowSet(new TLabel('Destino:'), $destino);
     //$row = $table->addRow();
     $box = new THBox();
     $box->add($campusID);
     $box->add($campusNome)->style = 'width: 75%; display : inline-block;';
     //$row->addCell($box)->colspan = 2;
     $table->addRowSet(new TLabel('Destino:'), $box);
     $table->addRowSet(new TLabel('Gerente Administrativo(a):'), $gerente);
     $table->addRowSet(new TLabel('Diretor(a):'), $diretor);
     $table->addRowSet($cessao_id);
     $this->form->setFields(array($memorando, $emissao, $campusID, $campusNome, $gerente, $diretor, $cessao_id));
     // keep the form filled during navigation with session data
     $this->form->setData(TSession::getValue('Cessao_filter_data'));
     // create two action buttons to the form
     $generate_button = TButton::create('generate', array($this, 'onGenerate'), 'Gerar', 'fa:file-pdf-o');
     $back_button = TButton::create('back', array('DocCessaoList', 'onReload'), 'Voltar', 'ico_back.png');
     //$new_button  = TButton::create('new',  array('CessaoForm', 'onEdit'), 'Novo', 'ico_new.png');
     $this->form->addField($generate_button);
     $this->form->addField($back_button);
     $buttons_box = new THBox();
     $buttons_box->add($generate_button);
     $buttons_box->add($back_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     // create the page container
     //$container = TVBox::pack($this->form);
     parent::add($this->form);
 }
コード例 #7
0
ファイル: SrpList.class.php プロジェクト: andermall/tcc
 function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/custom-table.css');
     //criar o form
     $this->form = new TForm('form_consulta_srp');
     $this->form->class = 'tform';
     //cria a tabela
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     //adiciona uma linha na tabela para o titulo
     $row = $table->addRow();
     $row->class = 'tformtitle';
     $row->addCell(new TLabel('Consulta SRP'))->colspan = 2;
     // cria os campos do formulario
     $numeroSRP = new TEntry('numeroSRP');
     $numeroIRP = new TEntry('numeroIRP');
     $numeroProcesso = new TEntry('numeroProcesso');
     $uasg = new TEntry('uasg');
     $validade = new TDate('validade');
     $nome = new TEntry('nome');
     // define os tamanhos
     $numeroSRP->setSize(70);
     $numeroIRP->setSize(70);
     $numeroProcesso->setSize(150);
     $uasg->setSize(70);
     $validade->setSize(100);
     $validade->setProperty('style', 'margin-right : 0px');
     $nome->setSize(400);
     $validade->setMask('dd/mm/yyyy');
     // adiciona uma linha na tabela para cada campo
     $table->addRowSet(new TLabel('Nº SRP:'), $numeroSRP);
     $table->addRowSet(new TLabel('Nº IRP:'), $numeroIRP);
     $table->addRowSet(new TLabel('Proc. Orig.:'), $numeroProcesso);
     $table->addRowSet(new TLabel('Nome:'), $nome);
     $table->addRowSet(new TLabel('UASG:'), $uasg);
     $table->addRowSet(new TLabel('Validade:'), $validade);
     $this->form->setFields(array($numeroSRP, $numeroIRP, $numeroProcesso, $uasg, $validade, $nome));
     // manter o formulario preenchido durante navegação com os dados da sessao
     $this->form->setData(TSession::getValue('Srp_filter_data'));
     //cria o botão de ação
     $find_button = TButton::create('find', array($this, 'onSearch'), 'Consultar', 'ico_find.png');
     $this->form->addField($find_button);
     // adiciona uma linha para a acao do formulario
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($find_button)->colspan = 2;
     // cria o datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     // cria as colunas do datagrid
     $numeroSRP = new TDataGridColumn('numeroSRP', 'Nº SRP', 'left', 70);
     $numeroIRP = new TDataGridColumn('numeroIRP', 'Nº IRP', 'left', 70);
     $numeroProcesso = new TDataGridColumn('numeroProcesso', 'Proc. Orig.', 'left', 150);
     $uasg = new TDataGridColumn('uasg', 'UASG', 'left', 50);
     $validade = new TDataGridColumn('validade', 'Validade', 'left', 100);
     $nome = new TDataGridColumn('nome', 'Nome', 'left', 300);
     $validade->setTransformer(array($this, 'rowFormat'));
     // adiciona as colunas ao datagrid
     $this->datagrid->addColumn($numeroSRP);
     $this->datagrid->addColumn($numeroIRP);
     $this->datagrid->addColumn($numeroProcesso);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($uasg);
     $this->datagrid->addColumn($validade);
     $srpViewAction = new TDataGridAction(array('SrpFormView', 'onViewSrp'));
     $srpViewAction->setLabel('Itens');
     $srpViewAction->setImage('fa:th-list');
     $srpViewAction->setField('id');
     $this->datagrid->addAction($srpViewAction);
     // cria o modelo no datagrid
     $this->datagrid->createModel();
     // cria o navegador de pagina
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $container = new TTable();
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->addRow()->addCell($this->form);
     $container->addRow()->addCell($this->datagrid);
     $container->addRow()->addCell($this->pageNavigation);
     parent::add($container);
 }
コード例 #8
0
ファイル: CampusForm.class.php プロジェクト: andermall/tcc
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Campus');
     $this->form->class = 'tform';
     // CSS class
     //$this->form->style = 'width: 500px';
     // add a table inside form
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // add a row for the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $row->addCell(new TLabel('Cadastro de Câmpus'))->colspan = 2;
     // create the form fields
     $id = new TEntry('id');
     $nome = new TEntry('nome');
     $uasg = new TEntry('uasg');
     $sigla = new TEntry('sigla');
     $id->setEditable(FALSE);
     // define the sizes
     $id->setSize(50);
     $nome->setSize(400);
     $uasg->setSize(150);
     $sigla->setSize(100);
     // validations
     $nome->addValidation('Nome', new TRequiredValidator());
     $uasg->addValidation('UASG', new TRequiredValidator());
     $sigla->addValidation('Sigla', new TRequiredValidator());
     $nome->addValidation('Nome', new TMaxLengthValidator(), array(50));
     $uasg->addValidation('UASG', new TMaxLengthValidator(), array(10));
     $sigla->addValidation('Sigla', new TMaxLengthValidator(), array(3));
     // add one row for each form field
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet($label_nome = new TLabel('Nome:'), $nome);
     //$label_nome->setFontColor('#FF0000');
     $table->addRowSet($label_uasg = new TLabel('UASG:'), $uasg);
     //$label_uasg->setFontColor('#FF0000');
     $table->addRowSet($label_sigla = new TLabel('Sigla:'), $sigla);
     //$label_sigla->setFontColor('#FF0000');
     $this->form->setFields(array($id, $nome, $uasg, $sigla));
     // create the form actions
     $save_button = TButton::create('save', array($this, 'onSave'), 'Salvar', 'ico_save.png');
     $new_button = TButton::create('new', array($this, 'onEdit'), 'Novo', 'ico_new.png');
     $back_button = TButton::create('back', array('CampusList', 'onReload'), 'Voltar para a listagem', 'ico_datagrid.png');
     $this->form->addField($save_button);
     $this->form->addField($new_button);
     $this->form->addField($back_button);
     $buttons_box = new THBox();
     $buttons_box->add($save_button);
     $buttons_box->add($new_button);
     $buttons_box->add($back_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     $container = new TTable();
     //$container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'CampusList'));
     $container->addRow()->addCell($this->form);
     parent::add($container);
 }