Exemplo n.º 1
1
 /**
  * Constructor Method
  * Creates the page, the search form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::setTitle(AdiantiCoreTranslator::translate('Search record'));
     parent::setSize(0.7, 640);
     // creates a new form
     $this->form = new TForm('form_standard_seek');
     // creates a new table
     $table = new TTable();
     $table->{'width'} = '100%';
     // adds the table into the form
     $this->form->add($table);
     // create the form fields
     $display_field = new TEntry('display_field');
     $display_field->setSize('90%');
     // keeps the field's value
     $display_field->setValue(TSession::getValue('tstandardseek_display_value'));
     // create the action button
     $find_button = new TButton('busca');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), AdiantiCoreTranslator::translate('Search'));
     $find_button->setImage('fa:search blue');
     // add a row for the filter field
     $table->addRowSet(new TLabel(_t('Search') . ': '), $display_field, $find_button);
     // define wich are the form fields
     $this->form->setFields(array($display_field, $find_button));
     // creates a new datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->{'style'} = 'width: 100%';
     // create two datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right', '16%');
     $display = new TDataGridColumn('display_field', AdiantiCoreTranslator::translate('Field'), 'left');
     // add the columns to the datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($display);
     // create a datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel(AdiantiCoreTranslator::translate('Select'));
     $action1->setImage('fa:check-circle-o green');
     $action1->setUseButton(TRUE);
     $action1->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the paginator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $panel = new TPanelGroup();
     $panel->add($this->form);
     // creates the container
     $vbox = new TVBox();
     $vbox->add($panel);
     $vbox->add($this->datagrid);
     $vbox->add($this->pageNavigation);
     $vbox->{'style'} = 'width: 100%';
     // add the container to the page
     parent::add($vbox);
 }
Exemplo n.º 2
1
 function __construct()
 {
     parent::__construct();
     //cria os containers
     $this->form_requisicao = new TForm('form_requisicao');
     $this->form_requisicao->class = 'tform';
     $this->form_itens = new TForm('form_itens');
     $this->form_itens->class = 'tform';
     $table_requisicao = new TTable();
     $table_requisicao->width = '100%';
     $table_itens = new TTable();
     $table_itens->width = '100%';
     //empacota os dados
     $this->form_requisicao->add($table_requisicao);
     $this->form_itens->add($table_itens);
     //campos da requisicao;
     $numeroSRP = new TSeekButton('numeroSRP');
     $nome = new TEntry('nome');
     $numeroProcessoOrigem = new TEntry('numeroProcessoOrigem');
     $uasg = new TEntry('uasg');
     $validadeAta = new TEntry('validade');
     $numeroProcesso = new TEntry('numeroProcesso');
     $emissao = new TDate('emissao');
     //campos do itens
     $numeroItem = new TSeekButton('numeroItem');
     $item_id = new THidden('item_id');
     $descricaoSumaria = new TEntry('descricaoSumaria');
     $valorUnitario = new TEntry('valorUnitario');
     $quantidade = new TEntry('quantidade');
     $prazoEntrega = new TEntry('prazoEntrega');
     $justificativa = new TEntry('justificativa');
     $addItem = new TButton('addItem');
     $save = new TButton('save');
     $new = new TButton('new');
     $list = new TButton('list');
     //ações dos campos
     $numeroSRP->setAction(new TAction(array(new SrpSeekRequisicao(), 'onReload')));
     $numeroProcesso->setExitAction(new TAction(array($this, 'onExitNumeroProcesso')));
     $emissao->setExitAction(new TAction(array($this, 'onExitEmissao')));
     $numeroItem->setAction(new TAction(array(new ItemSeekRequisicao(), 'onReload')));
     $addItem->setAction(new TAction(array($this, 'onAddItem')), 'Adicionar');
     $addItem->setImage('fa:plus-square-o');
     $save->setAction(new TAction(array($this, 'onSave')), 'Salvar');
     $save->setImage('ico_save.png');
     $new->setAction(new TAction(array($this, 'onEdit')), 'Novo');
     $new->setImage('ico_new.png');
     $list->setAction(new TAction(array('RequisicaoList', 'onReload')), 'Voltar para listagem');
     $list->setImage('ico_datagrid.png');
     //$onProductChange = new TAction(array($this, 'onProductChange'));
     //$item_id->setExitAction($onProductChange);
     $quantidade->setExitAction(new TAction(array($this, 'onValidaQuantidade')));
     //validadores
     $numeroSRP->addValidation('Nº SRP', new TRequiredValidator());
     $emissao->addValidation('Emissão', new TRequiredValidator());
     $numeroItem->addValidation('Item', new TRequiredValidator());
     $valorUnitario->addValidation('Preço', new TRequiredValidator());
     $quantidade->addValidation('Quantidade', new TRequiredValidator());
     $quantidade->addValidation('Quantidade', new TMinValueValidator(), array(1));
     $quantidade->addValidation('Quantidade', new TMaxLengthValidator(), array(11));
     $justificativa->addValidation('Justificativa', new TRequiredValidator());
     $justificativa->addValidation('Justificativa', new TMaxLengthValidator(), array(100));
     $prazoEntrega->addValidation('Prazo de entrega', new TRequiredValidator());
     $prazoEntrega->addValidation('Prazo de entrega', new TMaxLengthValidator(), array(20));
     $numeroProcesso->addValidation('Nº Processo', new TRequiredValidator());
     $numeroProcesso->addValidation('Nº Processo', new TMaxLengthValidator(), array(30));
     //outras propriedades
     $descricaoSumaria->setEditable(false);
     $nome->setEditable(false);
     $numeroProcessoOrigem->setEditable(false);
     $uasg->setEditable(false);
     $validadeAta->setEditable(false);
     $valorUnitario->setEditable(false);
     $numeroSRP->setSize(80);
     $numeroSRP->setMaxLength(10);
     $emissao->setProperty('style', 'margin-right: 0px;', false);
     $nome->setSize(300);
     $nome->setProperty('style', 'margin-right: 10px', false);
     $numeroProcessoOrigem->setSize(160);
     $uasg->setSize(70);
     $validadeAta->setSize(85);
     $numeroProcesso->setMaxLength(30);
     $numeroProcesso->setTip('Número do processo gerado no SIGA');
     $numeroItem->setSize(60);
     $numeroItem->setMaxLength(11);
     $descricaoSumaria->setSize(490);
     $descricaoSumaria->setProperty('style', 'margin-right: 10px', false);
     $prazoEntrega->setSize(90);
     $justificativa->setSize(400);
     $justificativa->setMaxLength(100);
     $emissao->setSize(90);
     $emissao->setMask('dd/mm/yyyy');
     $emissao->setValue(date('d/m/Y'));
     $validadeAta->setMask('dd/mm/yyyy');
     $quantidade->class = 'frm_number_only';
     $quantidade->setMaxLength(11);
     $prazoEntrega->setValue('60 Dias');
     $prazoEntrega->setMaxLength(20);
     //$addItem->setProperty('style', 'margin: 0 0 10px 10px;', false);
     $row = $table_requisicao->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $cell = $row->addCell(new TLabel('Requisição de quantitativo'));
     $cell->colspan = 4;
     $row = $table_requisicao->addRow();
     $row->addCell(new TLabel('Nº SRP:'))->width = '150px';
     $row->addCell($numeroSRP);
     $row->addCell(new TLabel('Nome Licitação:'))->width = '150px';
     $row->addCell($nome);
     $table_requisicao->addRowSet(new TLabel('Proc. Orig:'), $numeroProcessoOrigem, new TLabel('UASG:'), $uasg);
     $table_requisicao->addRowSet(new TLabel('Validade da Ata:'), $validadeAta, new TLabel('Nº Processo:'), $numeroProcesso);
     $table_requisicao->addRowSet(new TLabel('Data Emissão:'), $emissao);
     $row = $table_itens->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $cell = $row->addCell(new TLabel('Itens'));
     $cell->colspan = 4;
     $row = $table_itens->addRow();
     $row->addCell(new TLabel('Item:'));
     $box = new THBox();
     $box->add($numeroItem);
     $box->add($descricaoSumaria)->style = 'width : 75%;display:inline-block;';
     $row->addCell($box);
     //->style = 'width : 85%';
     $table_itens->addRowSet($item_id);
     $table_itens->addRowSet(new TLabel('Preço:'), $valorUnitario);
     $table_itens->addRowSet(new TLabel('Quantidade:'), $quantidade);
     $table_itens->addRowSet(new TLabel('Prazo de entrega:'), $prazoEntrega);
     $table_itens->addRowSet(new TLabel('Justificativa:'), $justificativa);
     $row = $table_itens->addRow();
     $row->class = 'tformaction';
     $row->addCell($addItem)->colspan = 2;
     //$table_itens->addRowSet($addItem);
     parent::include_css('app/resources/custom-table.css');
     $this->datagrid = new TDataGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(175);
     $this->datagrid->makeScrollable();
     $this->datagrid->disableDefaultClick();
     $GnumeroItem = new TDataGridColumn('numeroItem', 'Item', 'center', 50);
     $GdescricaoSumaria = new TDataGridColumn('descricaoSumaria', 'Descrição', 'left', 230);
     $Gquantidade = new TDataGridColumn('quantidade', 'Quantidade', 'right', 110);
     $GvalorUnitario = new TDataGridColumn('valorUnitario', 'Preço', 'right', 110);
     $Gtotal = new TDataGridColumn('total', 'Total', 'right', 160);
     //transformers
     $GvalorUnitario->setTransformer(array($this, 'formatValor'));
     $Gtotal->setTransformer(array($this, 'formatValor'));
     $edit = new TDataGridAction(array($this, 'onEditItem'));
     $edit->setLabel('Editar');
     $edit->setImage('ico_edit.png');
     $edit->setField('numeroItem');
     $delete = new TDataGridAction(array($this, 'onDeleteItem'));
     $delete->setLabel('Deletar');
     $delete->setImage('ico_delete.png');
     $delete->setField('numeroItem');
     $this->datagrid->addAction($edit);
     $this->datagrid->addAction($delete);
     $this->datagrid->addColumn($GnumeroItem);
     $this->datagrid->addColumn($GdescricaoSumaria);
     $this->datagrid->addColumn($Gquantidade);
     $this->datagrid->addColumn($GvalorUnitario);
     $this->datagrid->addColumn($Gtotal);
     $this->datagrid->createModel();
     $this->form_requisicao->setFields(array($numeroSRP, $nome, $numeroProcessoOrigem, $uasg, $validadeAta, $numeroProcesso, $emissao, $new, $save, $list));
     $this->form_itens->setFields(array($item_id, $numeroItem, $descricaoSumaria, $valorUnitario, $quantidade, $prazoEntrega, $justificativa, $addItem));
     $hbox = new THBox();
     $hbox->add($save);
     $hbox->add($new);
     $hbox->add($list);
     $table_grid = new TTable();
     $table_grid->style = 'width: 100%;border-spacing: 0px;';
     $table_grid->addRowSet($this->datagrid);
     $row = $table_grid->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($hbox)->colspan = 2;
     $vbox = new TVBox();
     $vbox->add($this->form_requisicao);
     $vbox->add($this->form_itens);
     $vbox->add($table_grid);
     $vbox->add(new TLabel(' '));
     parent::add($vbox);
 }
Exemplo n.º 3
0
 function __construct()
 {
     parent::__construct();
     parent::setSize(850, 500);
     parent::setTitle('Busca de SRP');
     new TSession();
     //cria o formulario
     $this->form = new TQuickForm('form_busca_srp');
     //cria os campos de busca do formulario
     $numeroSRP = new TEntry('numeroSRP');
     $numeroProcesso = new TEntry('numeroProcesso');
     $nome = new TEntry('nome');
     //valors da sessao
     $numeroSRP->setValue(TSession::getValue('srp_numeroSRP'));
     $numeroProcesso->setValue(TSession::getValue('srp_numeroProcesso'));
     $nome->setValue(TSession::getValue('srp_nome'));
     //adiciona os campos no formulario
     $this->form->addQuickField('Nº SRP', $numeroSRP);
     $this->form->addQuickField('Proc. Orig.', $numeroProcesso);
     $this->form->addQuickField('Nome', $nome);
     //adiciona a acao ao formulario
     $this->form->addQuickAction('Buscar', new TAction(array($this, 'onSearch')), 'ico_find.png');
     //criar a datagrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(300);
     //criar as colunas da datagrid
     $this->datagrid->addQuickColumn('Nº SRP', 'numeroSRP', 'left', 45);
     $this->datagrid->addQuickColumn('Proc. Orig.', 'numeroProcesso', 'left', 140);
     $this->datagrid->addQuickColumn('UASG', 'uasg', 'left', 50);
     $this->datagrid->addQuickColumn('Validade', 'validade', 'left', 70);
     $this->datagrid->addQuickColumn('Nome', 'nome', 'left', 280);
     //criar acao da coluna
     $this->datagrid->addQuickAction('Select', new TDataGridAction(array($this, 'onSelect')), 'numeroSRP', 'ico_apply.png');
     //cria o modelo
     $this->datagrid->createModel();
     //criar o navegador de pagina
     $this->navegadorPagina = new TPageNavigation();
     $this->navegadorPagina->setAction(new TAction(array($this, 'onReload')));
     $this->navegadorPagina->setWidth($this->datagrid->getWidth());
     // criar a estrutura da pagina usando uma tabela
     $table = new TTable();
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->navegadorPagina);
     // add the table inside the page
     parent::add($table);
 }
Exemplo n.º 4
0
 /**
  * Class constructor
  * Creates the page, the search form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::setSize(700, 500);
     parent::setTitle('Search record');
     new TSession();
     // creates the form
     $this->form = new TQuickForm('form_busca_tipocontato');
     $this->form->class = 'tform';
     $this->form->setFormTitle('Tipos Contato');
     // create the form fields
     $name = new TEntry('descricao');
     $name->setValue(TSession::getValue('tipocontato_descricao'));
     // add the form fields
     $this->form->addQuickField('Descricao', $name, 200);
     // define the form action
     $this->form->addQuickAction('Buscar', new TAction(array($this, 'onSearch')), 'ico_find.png');
     // creates a DataGrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->setHeight(230);
     //$this->datagrid->enablePopover('Title', 'Name {name}');
     // creates the datagrid columns
     $this->datagrid->addQuickColumn('Id', 'idtipocontato', 'right', 40);
     $this->datagrid->addQuickColumn('Descrição', 'descricao', 'left', 340);
     // creates two datagrid actions
     $this->datagrid->addQuickAction('Seleciona', new TDataGridAction(array($this, 'onSelect')), 'idtipocontato', 'ico_apply.png');
     // 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());
     // creates a container
     $container = new TVBox();
     $container->style = 'width: 100%';
     $container->add($this->form);
     $container->add($this->datagrid);
     $container->add($this->pageNavigation);
     // add the container inside the page
     parent::add($container);
 }
Exemplo n.º 5
0
 function __construct()
 {
     parent::__construct();
     parent::setSize(850, 750);
     parent::setTitle('Busca de Itens');
     new TSession();
     if (!TSession::getValue('SRP_id')) {
         $this->continue = false;
     } else {
         $this->continue = true;
     }
     //cria o formulario
     $this->form = new TQuickForm('form_busca_item');
     //cria os campos de busca do formulario
     $numeroItem = new TEntry('numeroItem');
     $descricaoSumaria = new TEntry('descricaoSumaria');
     $fabricante = new TEntry('fabricante');
     //valors da sessao
     $descricaoSumaria->setValue(TSession::getValue('item_descricaoSumaria'));
     //adiciona os campos no formulario
     //if ((TSession::getValue('Item_filter_data')!== NULL) && (TSession::getValue('Item_filter_data'))){
     //    var_dump(TSession::getValue('Item_filter_data'));
     //    $this->form->setData( TSession::getValue('Item_filter_data'));
     //}
     $this->form->addQuickField('Nº Item:', $numeroItem, 70);
     $this->form->addQuickField('Descrição Sumária:', $descricaoSumaria, 250);
     $this->form->addQuickField('Fabricante:', $fabricante, 150);
     //adiciona a acao ao formulario
     $this->form->addQuickAction('Buscar', new TAction(array($this, 'onSearch')), 'ico_find.png');
     //criar a datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->makeScrollable();
     //$this->datagrid->width = '100%';
     $this->datagrid->setHeight(400);
     //criar as colunas da datagrid
     $GnumeroItem = new TDataGridColumn('numeroItem', 'Nº Item', 'left', 50);
     $GdescricaoSumaria = new TDataGridColumn('descricaoSumaria', 'Descrição Sumária', 'left', 500);
     $Gquantidade = new TDataGridColumn('estoqueDisponivel', 'Quantidade', 'right', 70);
     $GunidadeMedida = new TDataGridColumn('unidadeMedida', 'Unidade', 'left', 50);
     $GvalorUnitario = new TDataGridColumn('valorUnitario', 'Valor Unit.', 'right', 70);
     // add the columns to the DataGrid
     $this->datagrid->addColumn($GnumeroItem);
     $this->datagrid->addColumn($GdescricaoSumaria);
     $this->datagrid->addColumn($Gquantidade);
     $this->datagrid->addColumn($GunidadeMedida);
     $this->datagrid->addColumn($GvalorUnitario);
     //criar acao da coluna
     $action = new TDataGridAction(array($this, 'onSelect'));
     $action->setLabel('Select');
     $action->setImage('ico_apply.png');
     $action->setField('numeroItem');
     $this->datagrid->addAction($action);
     //cria o modelo
     $this->datagrid->createModel();
     //criar o navegador de pagina
     //$this->navegadorPagina = new TPageNavigation();
     //$this->navegadorPagina->setAction(new TAction(array($this, 'onReload')));
     //$this->navegadorPagina->setWidth($this->datagrid->getWidth());
     // criar a estrutura da pagina usando uma tabela
     $table = new TTable();
     $table->style = "width = 100%";
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     //$table->addRow()->addCell($this->navegadorPagina);
     // add the table inside the page
     parent::add($table);
 }
Exemplo n.º 6
0
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // Cria o form
     $this->form = new TForm('form_search_Funcionalidade');
     $this->form->class = 'tform';
     // cria a tabela
     $table = new TTable();
     $table->style = 'width:100%';
     $table->addRowSet(new TLabel('Consulta Funcionalidades'), '')->class = 'tformtitle';
     // adiciona a tabela no form
     $this->form->add($table);
     // cria os campos de pesquisa do form
     $nome = new TEntry('nome');
     $nome->setValue(TSession::getValue('Funcionalidade_nome'));
     $nome->setSize(500);
     $control = new TEntry('classe');
     $control->setValue(TSession::getValue('Funcionalidade_control'));
     $control->setSize(500);
     // adiciona linha para os campos de filtro
     $row = $table->addRowSet(new TLabel('Nome: '), $nome);
     $row = $table->addRowSet(new TLabel('Classe de Controle: '), $control);
     // cria dois botoes de acao para o form
     $find_button = new TButton('find');
     $new_button = new TButton('new');
     // define as acoes dos botoes
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Buscar');
     $find_button->setImage('ico_find.png');
     $new_button->setAction(new TAction(array('FuncionalidadeForm', 'onEdit')), 'Novo');
     $new_button->setImage('ico_new.png');
     // define quais sao os campos do form
     $this->form->setFields(array($nome, $control, $find_button, $new_button));
     $container = new THBox();
     $container->add($find_button);
     $container->add($new_button);
     //$container->style = "float: right";
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($container);
     $cell->colspan = 2;
     parent::include_css('app/resources/custom-table.css');
     // cria o datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     // cria as colunas do datagrid
     $id = new TDataGridColumn('id', 'ID', 'right');
     $nome = new TDataGridColumn('nome', 'Nome', 'left');
     $classe = new TDataGridColumn('classe', 'Classe de Controle', 'left');
     // adiciona as colunas ao datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($classe);
     // cria as acoes das colunas do datagrid
     $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_classe = new TAction(array($this, 'onReload'));
     $order_classe->setParameter('order', 'classe');
     $classe->setAction($order_classe);
     // edicao inline
     $nome_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $nome_edit->setField('id');
     $nome->setEditAction($nome_edit);
     $classe_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $classe_edit->setField('id');
     $classe->setEditAction($classe_edit);
     // cria 2 acoes do datagrid
     $action1 = new TDataGridAction(array('FuncionalidadeForm', 'onEdit'));
     $action1->setLabel('Editar');
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel('Excluir');
     $action2->setImage('ico_delete.png');
     $action2->setField('id');
     // adiciona as acoes ao datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     // cria o modelo do datagrid
     $this->datagrid->createModel();
     // cria o navegador de paginas
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // cria a estrutura da pagina usando tabela
     $table = new TTable();
     $table->style = 'width: 80%';
     $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->pageNavigation);
     // adiciona a tabela $table dentro da pagina
     parent::add($table);
 }
Exemplo n.º 7
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_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);
 }
Exemplo n.º 8
0
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/custom-table.css');
     // Cria o form
     $this->form = new TForm('form_search_Usuario');
     $this->form->class = 'tform';
     // cria a tabela
     $table = new TTable();
     $table->style = 'width:100%';
     $table->addRowSet(new TLabel('Consulta Usuários'), '')->class = 'tformtitle';
     // adiciona a tabela no form
     $this->form->add($table);
     // cria os campos de pesquisa do form
     //$id = new TEntry('id');
     //$id->setValue(TSession::getValue('Usuario_id'));
     $nome = new TEntry('nome');
     $nome->setValue(TSession::getValue('Usuario_nome'));
     $nome->setSize(300);
     // add a row for the filter field
     //$table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('Nome: '), $nome);
     // cria dois botoes de acao para o form
     $find_button = new TButton('find');
     $new_button = new TButton('new');
     // define as acoes dos botoes
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Buscar');
     $find_button->setImage('ico_find.png');
     $new_button->setAction(new TAction(array('UsuarioForm', 'onEdit')), 'Novo');
     $new_button->setImage('ico_new.png');
     // add a row for the form actions
     $container = new THBox();
     $container->add($find_button);
     $container->add($new_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($container);
     $cell->colspan = 2;
     // define wich are the form fields
     $this->form->setFields(array($nome, $find_button, $new_button));
     // creates a DataGrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->setHeight(320);
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->style = 'width: 100%';
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right');
     $nome = new TDataGridColumn('nome', 'Nome', 'left');
     $prontuario = new TDataGridColumn('prontuario', 'Prontuario', 'left');
     $email = new TDataGridColumn('email', 'Email', 'left');
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($prontuario);
     $this->datagrid->addColumn($email);
     // 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);
     // inline editing
     $nome_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $nome_edit->setField('id');
     $nome->setEditAction($nome_edit);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array('UsuarioForm', 'onEdit'));
     $action1->setLabel('Editar');
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel('Excluir');
     $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());
     // creates the page structure using a table
     $table = new TTable();
     //$table->style = 'width: 80%';
     $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
Exemplo n.º 9
0
 /**
  * 
  */
 public function makeTEntry($properties)
 {
     $widget = new TEntry((string) $properties->{'name'});
     $widget->setValue((string) $properties->{'value'});
     $widget->setMask((string) $properties->{'mask'});
     $widget->setSize((int) $properties->{'width'});
     if (isset($properties->{'maxlen'})) {
         $widget->setMaxLength((int) $properties->{'maxlen'});
     }
     if (isset($properties->{'tip'})) {
         $widget->setTip((string) $properties->{'tip'});
     }
     if (isset($properties->{'required'}) and $properties->{'required'} == '1') {
         $widget->addValidation((string) $properties->{'name'}, new TRequiredValidator());
     }
     $widget->setEditable((string) $properties->{'editable'});
     $this->fields[] = $widget;
     $this->fieldsByName[(string) $properties->{'name'}] = $widget;
     return $widget;
 }
Exemplo n.º 10
0
 /**
  * Construtor
  * 
  * Criação da listagem de grupos
  */
 public function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/custom-table.css');
     // Cria o form
     $this->form = new TForm('form_search_Grupo');
     $this->form->class = 'tform';
     // cria a tabela
     $table = new TTable();
     $table->style = 'width:100%';
     //cria o titulo
     $table->addRowSet(new TLabel('Consulta Grupos'), '')->class = 'tformtitle';
     // Adiciona a tabela no form
     $this->form->add($table);
     // Cria os campos para filtro
     $nome = new TEntry('nome');
     $nome->setValue(TSession::getValue('s_nome'));
     $nome->setSize(300);
     $sigla = new TEntry('sigla');
     $sigla->setValue(TSession::getValue('s_sigla'));
     $sigla->setSize(100);
     // Adiciona linha na tabela para inserir o campos
     $row = $table->addRow();
     $row->addCell(new TLabel('Nome: '));
     $row->addCell($nome);
     $row = $table->addRow();
     $row->addCell(new TLabel('Sigla: '));
     $row->addCell($sigla);
     // cria os dois botoes de ações do form
     $find_button = new TButton('find');
     $new_button = new TButton('new');
     // define o botao de acao
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Buscar');
     $find_button->setImage('ico_find.png');
     $new_button->setAction(new TAction(array('GrupoForm', 'onEdit')), 'Novo');
     $new_button->setImage('ico_new.png');
     $container = new THBox();
     $container->add($find_button);
     $container->add($new_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($container);
     $cell->colspan = 2;
     // define qual é os campos do form
     $this->form->setFields(array($nome, $sigla, $find_button, $new_button));
     // cria o datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->setHeight(320);
     // cria as colunas do datagrid
     $id = new TDataGridColumn('id', 'ID', 'center');
     $nome = new TDataGridColumn('nome', 'Nome', 'center');
     $sigla = new TDataGridColumn('sigla', 'Sigla', 'center');
     // adiciona as colunas ao datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($sigla);
     // cria as acoes das colunas do datagrid (quando clica no titulo do grid)
     $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_sigla = new TAction(array($this, 'onReload'));
     $order_sigla->setParameter('order', 'sigla');
     $sigla->setAction($order_sigla);
     // edição em linha
     $nome_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $nome_edit->setField('id');
     $nome->setEditAction($nome_edit);
     $sigla_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $sigla_edit->setField('id');
     $sigla->setEditAction($sigla_edit);
     // cria duas acoes do datagrid
     $action1 = new TDataGridAction(array('GrupoForm', 'onEdit'));
     $action1->setLabel('Editar');
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel('Excluir');
     $action2->setImage('ico_delete.png');
     $action2->setField('id');
     // adiciona as acoes ao datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     // cria o modelo do datagrid
     $this->datagrid->createModel();
     // cria o navegador de paginas
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // cria a estrutura da tela usando tabelas
     $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);
 }