/**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Aprovar_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('Aprovar 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('Aprovar Cessao');
     $action1->setImage('fa:check 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);
     parent::add($container);
 }
Beispiel #2
0
 function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/custom-table.css');
     //cria o formulario
     $this->form = new TForm('SrpFormView');
     $this->form->class = 'tform';
     //$this->form->style = 'max-width: 500px';
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     $row = $table->addRow();
     $row->class = 'tformtitle';
     $row->addCell(new TLabel('Listagem de Itens da SRP'))->colspan = 2;
     //cria os campos do formulário
     $id = new TEntry('id');
     $numeroSRP = new TEntry('numeroSRP');
     $numeroIRP = new TEntry('numeroIRP');
     $numeroProcesso = new TEntry('numeroProcesso');
     $nome = new TEntry('nome');
     $uasg = new TEntry('uasg');
     $validade = new TDate('validade');
     $natureza = new TEntry('natureza');
     // define os tamanhos
     $id->setSize(70);
     $numeroSRP->setSize(90);
     $numeroIRP->setSize(90);
     $numeroProcesso->setSize(120);
     $nome->setSize(350);
     $uasg->setSize(70);
     $validade->setSize(90);
     $natureza->setSize(200);
     //desabilitando os campos
     $id->setEditable(false);
     $numeroSRP->setEditable(false);
     $numeroIRP->setEditable(false);
     $numeroProcesso->setEditable(false);
     $nome->setEditable(false);
     $uasg->setEditable(false);
     $validade->setEditable(false);
     $natureza->setEditable(false);
     // adiciona uma linha para cada campo no formulario
     $table->addRowSet(new TLabel('id:'), $id);
     $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);
     $table->addRowSet(new TLabel('Natureza:'), $natureza);
     $this->form->setFields(array($id, $numeroSRP, $numeroIRP, $numeroProcesso, $nome, $uasg, $validade, $natureza));
     //criar a datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->class = 'tdatagrid_table customized-table';
     $this->datagrid->makeScrollable();
     $this->datagrid->disableDefaultClick();
     $this->datagrid->setHeight(180);
     //criar as colunas da datagrid
     $GnumeroItem = new TDataGridColumn('numeroItem', 'Nº Item', 'left', 50);
     $GdescricaoSumaria = new TDataGridColumn('descricaoSumaria', 'Descrição Sumária', 'left', 400);
     $GquantidadeEstimada = new TDataGridColumn('quantidadeDisponivel', 'Qtd. Estimada', 'right', 100);
     $GquantidadeDisponivel = new TDataGridColumn('estoqueDisponivel', 'Qtd. Disponível', 'right', 100);
     $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($GquantidadeEstimada);
     $this->datagrid->addColumn($GquantidadeDisponivel);
     $this->datagrid->addColumn($GunidadeMedida);
     $this->datagrid->addColumn($GvalorUnitario);
     /*
             $viewDetalhe = new TDataGridAction(array($this, 'onShowDetail'));
             $viewDetalhe->setLabel('Detalhes');
             $viewDetalhe->setImage('ico_view.png');
             $viewDetalhe->setField('id');
     
             $this->datagrid->addAction($viewDetalhe);
     */
     // cria o modelo no datagrid
     $this->datagrid->createModel();
     $back_button = new TButton('back');
     $back_button->setAction(new TAction(array('SrpList', 'onReload')), 'Voltar');
     $back_button->setImage('ico_back.png');
     $this->form->addField($back_button);
     $buttons_box = new THBox();
     $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;
     // cria o container da pagina
     $container = TVBox::pack($this->form, $this->datagrid);
     parent::add($container);
 }
Beispiel #3
0
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_home');
     $this->form->class = 'tform';
     // CSS class
     $this->form->width = '100%';
     $this->form->style = "background-color:rgba(0,0,0,0)!important;";
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     $table->style = 'background-color:rgba(0, 0, 0, 0);box-shadow: none !important;border: none !important;';
     $row = $table->addRow();
     $lbUI = new TLabel('<B>Últimas importações</B>');
     $lbUR = new TLabel('<B>Últimas requisições</B>');
     $lbUC = new TLabel('<B>Últimas cessões</B>');
     $lbSV = new TLabel('<B>SRP à vencer</B>');
     $lbUI->setFontSize(16);
     $lbUR->setFontSize(16);
     $lbUC->setFontSize(16);
     $lbSV->setFontSize(16);
     $lbUI->style = "padding-top : 10px;";
     $lbUR->style = "padding-top : 10px;";
     $lbUC->style = "padding-top : 10px;";
     $lbSV->style = "padding-top : 10px;";
     $row->addCell($lbUI);
     $row->addCell(new TLabel('&nbsp;'));
     $row->addCell($lbUR);
     parent::include_css('app/resources/custom-table.css');
     $this->dg_UltImportacao = new TDataGrid();
     $this->dg_UltRequisicao = new TDataGrid();
     $this->dg_UltCesssao = new TDataGrid();
     $this->dg_SRPAVencer = new TDataGrid();
     $this->dg_UltImportacao->class = 'tdatagrid_table customized-table';
     $this->dg_UltRequisicao->class = 'tdatagrid_table customized-table';
     $this->dg_UltCesssao->class = 'tdatagrid_table customized-table';
     $this->dg_SRPAVencer->class = 'tdatagrid_table customized-table';
     //$this->dg_UltImportacao->style = 'width : 100%';
     //$this->dg_UltRequisicao->style = 'width : 100%';
     //$this->dg_UltCesssao->style = 'width : 100%';
     //$this->dg_AtasAVencer->style = 'width : 100%';
     $this->dg_UltImportacao->setHeight(320);
     $this->dg_UltRequisicao->setHeight(320);
     $this->dg_UltCesssao->setHeight(320);
     $this->dg_SRPAVencer->setHeight(320);
     $this->dg_UltImportacao->makeScrollable();
     $this->dg_UltRequisicao->makeScrollable();
     $this->dg_UltCesssao->makeScrollable();
     $this->dg_SRPAVencer->makeScrollable();
     //$this->dg_UltImportacao->disableDefaultClick();
     //$this->dg_UltRequisicao->disableDefaultClick();
     //$this->dg_UltCesssao->disableDefaultClick();
     //$this->dg_SRPAVencer->disableDefaultClick();
     //Ultimas Importações
     $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);
     $actUltImp = new TDataGridAction(array('SrpFormView', 'onViewSrp'));
     $actUltImp->setLabel('Visualizar');
     $actUltImp->setImage('fa:search fa-fw');
     $actUltImp->setField('id');
     $this->dg_UltImportacao->addAction($actUltImp);
     $this->dg_UltImportacao->addColumn($numeroSRP);
     $this->dg_UltImportacao->addColumn($numeroIRP);
     $this->dg_UltImportacao->addColumn($numeroProcesso);
     $this->dg_UltImportacao->addColumn($nome);
     $this->dg_UltImportacao->addColumn($uasg);
     $this->dg_UltImportacao->addColumn($validade);
     $this->dg_UltImportacao->createModel();
     //Ultimas Requisições
     $srp = new TDataGridColumn('numeroSRP', 'Nº SRP', 'left', 100);
     $numeroProcesso = new TDataGridColumn('numeroProcesso', 'Nº do processo', 'left', 250);
     $data = new TDataGridColumn('emissao', 'Data', 'left', 100);
     $aprovado = new TDataGridColumn('aprovado', 'Aprovado', 'left', 100);
     $actUltReq = new TDataGridAction(array('RequisicaoList', 'onReload'));
     $actUltReq->setLabel('Visualizar');
     $actUltReq->setImage('fa:search fa-fw');
     $actUltReq->setField('id');
     $this->dg_UltRequisicao->addAction($actUltReq);
     $this->dg_UltRequisicao->addColumn($srp);
     $this->dg_UltRequisicao->addColumn($numeroProcesso);
     $this->dg_UltRequisicao->addColumn($data);
     $this->dg_UltRequisicao->addColumn($aprovado);
     $this->dg_UltRequisicao->createModel();
     //Atas a Vencer
     $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);
     $actSrpVen = new TDataGridAction(array('SrpFormView', 'onViewSrp'));
     $actSrpVen->setLabel('Visualizar');
     $actSrpVen->setImage('fa:search fa-fw');
     $actSrpVen->setField('id');
     $this->dg_SRPAVencer->addAction($actSrpVen);
     $this->dg_SRPAVencer->addColumn($numeroSRP);
     $this->dg_SRPAVencer->addColumn($numeroIRP);
     $this->dg_SRPAVencer->addColumn($numeroProcesso);
     $this->dg_SRPAVencer->addColumn($nome);
     $this->dg_SRPAVencer->addColumn($uasg);
     $this->dg_SRPAVencer->addColumn($validade);
     $this->dg_SRPAVencer->createModel();
     //Ultimas Cessões
     $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);
     $aprovado = new TDataGridColumn('aprovado', 'Aprovado', 'left', 100);
     $actUltCes = new TDataGridAction(array('CessaoList', 'onReload'));
     $actUltCes->setLabel('Visualizar');
     $actUltCes->setImage('fa:search fa-fw');
     $actUltCes->setField('id');
     $this->dg_UltCesssao->addAction($actUltCes);
     $this->dg_UltCesssao->addColumn($srp);
     $this->dg_UltCesssao->addColumn($numeroCessao);
     $this->dg_UltCesssao->addColumn($data);
     $this->dg_UltCesssao->addColumn($aprovado);
     $this->dg_UltCesssao->createModel();
     $table->addRowSet($this->dg_UltImportacao, new TLabel('&nbsp;'), $this->dg_UltRequisicao);
     $row = $table->addRow();
     $row->addCell(new TLabel('&nbsp;'))->colspan = 3;
     $row = $table->addRow();
     $row->addCell($lbSV);
     $row->addCell(new TLabel('&nbsp;'));
     $row->addCell($lbUC);
     $table->addRowSet($this->dg_SRPAVencer, new TLabel('&nbsp;'), $this->dg_UltCesssao);
     $container = TVBox::pack($this->form);
     parent::add($container);
     //parent::add($this->form);
 }