예제 #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);
 }
예제 #2
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);
 }
예제 #3
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);
 }
예제 #4
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);
 }