/**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the table container
     $table = new TTable();
     $table->style = 'width:100%';
     $frame_programs = new TFrame();
     $frame_programs->setLegend(_t('Programs'));
     // creates the form
     $this->form = new TForm('form_System_group');
     $this->form->class = 'tform';
     // add the notebook inside the form
     $this->form->add($table);
     $table->addRowSet(new TLabel(_t('Group')), '')->class = 'tformtitle';
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $multifield = new TMultiField('programs');
     $program_id = new TDBSeekButton('program_id', 'permission', 'form_System_group', 'SystemProgram', 'name', 'programs_id', 'programs_name');
     $program_name = new TEntry('program_name');
     $frame_programs->add($multifield);
     $multifield->setHeight(140);
     $multifield->setClass('SystemProgram');
     $multifield->addField('id', _t('Program') . ' ID', $program_id, 100, true);
     $multifield->addField('name', _t('Name'), $program_name, 250);
     $multifield->setOrientation('horizontal');
     // define the sizes
     $program_id->setSize(70);
     $id->setSize(100);
     $name->setSize(200);
     // validations
     $name->addValidation('name', new TRequiredValidator());
     // outras propriedades
     $id->setEditable(false);
     $program_name->setEditable(false);
     // add a row for the field id
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel(_t('Name') . ': '), $name);
     // add a row for the field name
     $row = $table->addRow();
     $cell = $row->addCell($frame_programs);
     $cell->colspan = 2;
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('ico_new.png');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('SystemGroupList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('ico_datagrid.png');
     // define the form fields
     $this->form->setFields(array($id, $name, $multifield, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $container = new TTable();
     $container->width = '80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemGroupList'));
     $container->addRow()->addCell($this->form);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 2;
     // add the form to the page
     parent::add($container);
 }
 /**
  * 
  */
 public function makeTFrame($properties)
 {
     $width = PHP_SAPI == 'cli' ? (int) $properties->{'width'} - 2 : (int) $properties->{'width'} - 12;
     $height = PHP_SAPI == 'cli' ? (int) $properties->{'height'} - 2 : (int) $properties->{'height'} - 12;
     $widget = new TFrame($width, $height);
     $class = get_class($this);
     // for inheritance
     $panel = new $class($width, $height);
     // pass the controller and form ahead.
     $panel->setController($this->controller);
     $panel->setForm($this->form);
     if ($properties->{'child'}) {
         foreach ($properties->{'child'} as $child) {
             $panel->parseElement($child);
             // integrate the frame' fields
             $this->fieldsByName = array_merge((array) $this->fieldsByName, (array) $panel->getWidgets());
             $this->fields = array_merge((array) $this->fields, (array) $panel->getFields());
         }
     }
     $widget->setLegend((string) $properties->{'title'});
     $widget->add($panel);
     $this->fieldsByName[(string) $properties->{'name'}] = $widget;
     return $widget;
 }
Esempio n. 3
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_System_user');
     $this->form->class = 'tform';
     // creates the table container
     $table = new TTable();
     $table1 = new TTable();
     $table2 = new TTable();
     $hbox1 = new THBox();
     $hbox2 = new THBox();
     $table->style = 'width: 100%';
     $table1->style = 'width: 100%';
     $table2->style = 'width: 100%';
     $this->form->add($table);
     $table->addRowSet(new TLabel(_t('User')), '', '', '')->class = 'tformtitle';
     $table->addRowSet($hbox1);
     $table->addRowSet($hbox2);
     $hbox1->add($table1);
     $hbox1->add($table2);
     // add the table inside the form
     $this->form->add($table);
     $frame_groups = new TFrame(NULL, 280);
     $frame_groups->setLegend(_t('Groups'));
     $frame_groups->style .= ';margin: 4px';
     $frame_programs = new TFrame(NULL, 280);
     $frame_programs->setLegend(_t('Programs'));
     $frame_programs->style .= ';margin: 4px';
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $login = new TEntry('login');
     $password = new TPassword('password');
     $repassword = new TPassword('repassword');
     $email = new TEntry('email');
     $multifield_programs = new TMultiField('programs');
     $program_id = new TDBSeekButton('program_id', 'permission', 'form_System_user', 'SystemProgram', 'name', 'programs_id', 'programs_name');
     $program_name = new TEntry('program_name');
     $groups = new TDBCheckGroup('groups', 'permission', 'SystemGroup', 'id', 'name');
     $frontpage_id = new TDBSeekButton('frontpage_id', 'permission', 'form_System_user', 'SystemProgram', 'name', 'frontpage_id', 'frontpage_name');
     $frontpage_name = new TEntry('frontpage_name');
     $scroll = new TScroll();
     $scroll->setSize(290, 240);
     $scroll->add($groups);
     $frame_groups->add($scroll);
     $frame_programs->add($multifield_programs);
     // define the sizes
     $id->setSize('50%');
     $name->setSize('100%');
     $login->setSize('100%');
     $password->setSize('100%');
     $repassword->setSize('100%');
     $email->setSize('100%');
     $frontpage_id->setSize('20%');
     $multifield_programs->setHeight(140);
     // outros
     $id->setEditable(false);
     $program_name->setEditable(false);
     $frontpage_name->setEditable(false);
     // validations
     $name->addValidation(_t('Name'), new TRequiredValidator());
     $login->addValidation('Login', new TRequiredValidator());
     $email->addValidation('Email', new TEmailValidator());
     $program_id->setSize(50);
     $program_name->setSize(200);
     // configuracoes multifield
     $multifield_programs->setClass('SystemProgram');
     $multifield_programs->addField('id', 'ID', $program_id, 60);
     $multifield_programs->addField('name', _t('Name'), $program_name, 250);
     $multifield_programs->setOrientation('horizontal');
     // add a row for the field id
     $row = $table1->addRow();
     $row->addCell(new TLabel('ID:'))->style = 'width:150px';
     $row->addCell($id);
     $table1->addRowSet(new TLabel(_t('Login') . ': '), $login);
     $table1->addRowSet(new TLabel(_t('Password') . ': '), $password);
     $table1->addRowSet(new TLabel(_t('Password confirmation') . ': '), $repassword);
     $row = $table2->addRow();
     $row->addCell(new TLabel('Name:'))->style = 'width:150px';
     $row->addCell($name);
     $table2->addRowSet(new TLabel(_t('Email') . ': '), $email);
     $table2->addRowSet(new TLabel(_t('Front page') . ': '), $frontpage_id);
     $table2->addRowSet(new TLabel(_t('Page name') . ': '), $frontpage_name);
     $hbox2->add($frame_groups);
     $hbox2->add($frame_programs);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('fa:floppy-o');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('fa:plus-square green');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('SystemUserList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('fa:table blue');
     // define the form fields
     $this->form->setFields(array($id, $name, $login, $password, $repassword, $multifield_programs, $frontpage_id, $frontpage_name, $groups, $email, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 4;
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemUserList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
Esempio n. 4
0
 function __construct()
 {
     parent::__construct();
     $table = new TTable();
     $table->style = "width:100%";
     $frame_proprietarios = new TFrame();
     $frame_proprietarios->setLegend('Proprietarios');
     $frame_inf = new TFrame();
     $frame_inf->setLegend('Informações do Logradouro');
     $this->form = new TForm('form_Imovel');
     $this->form->class = 'tform';
     $this->form->add($table);
     $table->addRowSet(new TLabel('Imóvel'), '', '', '')->class = 'tformtitle';
     $imovel_id = new TEntry('imovel_id');
     $logradouro = new TEntry('logradouro');
     $numero = new TEntry('numero');
     $quadra = new TEntry('quadra');
     $lote = new TEntry('lote');
     $multifield1 = new TMultiField('proprietarios');
     $proprietarios_id = new TDBSeekButton('proprietarios_id', 'liger', 'form_Imovel', 'Contribuinte', 'contribuinte_nome', 'proprietarios_proprietarios_id', 'proprietarios_contribuinte_nome');
     $contribuinte_nome = new TEntry('contribuinte_nome');
     $inflogradouro = new TCheckGroup('inflogradouro');
     $inflogradouro->addItems(array('1' => 'Pavimentação   ', '2' => 'Meio Fio   ', '3' => 'Galerias Pluviais   ', '4' => 'Arborização   ', '5' => 'Rede Elétrica   ', '6' => 'Inluminação Pública   ', '7' => 'Rede D\'Água   ', '8' => 'Rede de Esgoto   ', '9' => 'Coleta de Lixo   '));
     $inflogradouro->setLayout('horizontal');
     $tipopropriedade = new TCombo('tipopropriedade');
     $tipopropriedade->addItems(array('1' => 'Particular', '2' => 'Municipal', '3' => 'Estadual', '4' => 'Federal', '5' => 'Religiosa'));
     $situacaojuridica = new TCombo('situacaojuridica');
     $situacaojuridica->addItems(array('1' => 'Plena', '2' => 'Poseiro', '3' => 'Aforamento', '4' => 'Litigiosa'));
     $localizacao = new TCombo('localizacao');
     $localizacao->addItems(array('1' => 'Esquina', '2' => 'Encravado', '3' => 'Meio de Quadra', '4' => 'Toda Quadra', '5' => 'Gleba'));
     $ocupacao = new TCombo('ocupacao');
     $ocupacao->addItems(array('1' => 'Vago', '2' => 'Edificado', '3' => 'Edificação Temporaria', '4' => 'Edificação em Construção', '5' => 'Construção Paralizada', '6' => 'Edificação em Demolição', '7' => 'Edificação em Ruinas', '8' => 'Praça'));
     $numfrentes = new TEntry('numfrentes');
     $utilizacao = new TCombo('utilizacao');
     $utilizacao->addItems(array('1' => 'Própria', '2' => 'Alugada', '3' => 'Cedida', '4' => 'Desocupada', '5' => 'Fechada'));
     $tipo = new TCombo('tipo');
     $tipo->addItems(array('1' => 'Casa', '2' => 'Apartamento', '3' => 'Sala', '4' => 'Loja', '5' => 'Galpão'));
     $douso = new TCombo('douso');
     $douso->addItems(array('1' => 'Residencial', '2' => 'Comercial', '3' => 'Industrial', '4' => 'Religioso', '5' => 'Administração Pública', '6' => 'Serviços'));
     $agua = new TCombo('agua');
     $agua->addItems(array('1' => 'Sem', '2' => 'Cisterna', '3' => 'Com Pena DÁgua', '4' => 'Hidrometro'));
     $esgoto = new TCombo('esgoto');
     $esgoto->addItems(array('1' => 'Sem', '2' => 'Fossa Negra', '3' => 'Fossa Septica', '4' => 'Rede Pública'));
     $areaterreno = new TEntry('areaterreno');
     $testada = new TEntry('testada');
     $areaedificada = new TEntry('areaedificada');
     $areatotaledificada = new TEntry('areatotaledificada');
     $imgimovel = new TEntry('imgimovel');
     $frame_proprietarios->add($multifield1);
     $multifield1->setHeight(140);
     $multifield1->setClass('Proprietarios');
     $multifield1->addField('proprietarios_id', 'Contribuinte' . ' ID', $proprietarios_id, 100, true);
     $multifield1->addField('contribuinte_nome', 'Nome', $contribuinte_nome, 250);
     $multifield1->setOrientation('horizontal');
     $imovel_id->setEditable(false);
     $contribuinte_nome->setEditable(false);
     $imovel_id->setSize(100);
     $logradouro->setSize(250);
     $quadra->setSize(100);
     $lote->setSize(100);
     $numero->setSize(100);
     $numfrentes->setSize(100);
     $table->addRowSet(new TLabel('ID:'), $imovel_id, new TLabel('Logradouro: '), $logradouro);
     $table->addRowSet(new TLabel('Quadra: '), $quadra, new TLabel('Lote: '), $lote);
     $table->addRowSet(new TLabel('Número: '), $numero, new TLabel('Nº de Frentes: '), $numfrentes);
     $table->addRowSet(new TLabel('Propriedade: '), $tipopropriedade, new TLabel('Situação Juridica: '), $situacaojuridica);
     $table->addRowSet(new TLabel('Localização: '), $localizacao, new TLabel('Ocupação: '), $ocupacao);
     $table->addRowSet(new TLabel('Utilização: '), $utilizacao, new TLabel('Tipo: '), $tipo);
     $table->addRowSet(new TLabel('Do Uso: '), $douso, new TLabel('Água: '), $agua);
     $table->addRowSet(new TLabel('Esgoto: '), $esgoto);
     $table->addRowSet(new TLabel('Área do Terreno: '), $areaterreno);
     $table->addRowSet(new TLabel('Testada: '), $testada);
     $table->addRowSet(new TLabel('Área Edificada: '), $areaedificada);
     $table->addRowSet(new TLabel('Área Total Edificada: '), $areatotaledificada);
     $table->addRowSet(new TLabel('Imagem do Imóvel: '), $imgimovel);
     $frame_inf->add($inflogradouro);
     $row1 = $table->addRow();
     $cell = $row1->addCell($frame_inf);
     $cell->colspan = 4;
     $row = $table->addRow();
     $cell = $row->addCell($frame_proprietarios);
     $cell->colspan = 4;
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('ico_new.png');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('ImovelList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('ico_datagrid.png');
     $this->form->setFields(array($imovel_id, $logradouro, $multifield1, $inflogradouro, $tipopropriedade, $situacaojuridica, $localizacao, $ocupacao, $numero, $quadra, $lote, $numfrentes, $utilizacao, $tipo, $douso, $agua, $esgoto, $areaterreno, $testada, $areaedificada, $areatotaledificada, $imgimovel, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $container = new TTable();
     $container->width = '80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'ImovelList'));
     $container->addRow()->addCell($this->form);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 2;
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_System_user');
     $this->form->class = 'tform';
     // creates the table container
     $table = new TTable();
     $table->style = 'width: 100%';
     $table->addRowSet(new TLabel('Usuário'), '', '', '')->class = 'tformtitle';
     // add the table inside the form
     $this->form->add($table);
     $frame_groups = new TFrame(NULL, 280);
     $frame_groups->setLegend('Grupos');
     $frame_groups->style .= ';margin: 4px';
     $frame_programs = new TFrame(NULL, 280);
     $frame_programs->setLegend('Programas');
     $frame_programs->style .= ';margin: 15px';
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $login = new TEntry('login');
     $password = new TPassword('password');
     $repassword = new TPassword('repassword');
     $email = new TEntry('email');
     $multifield_programs = new TMultiField('programs');
     $program_id = new TDBSeekButton('program_id', 'esales', 'form_System_user', 'SystemProgram', 'name', 'programs_id', 'programs_name');
     $program_name = new TEntry('program_name');
     $groups = new TDBCheckGroup('groups', 'esales', 'SystemGroup', 'id', 'name');
     $frontpage_id = new TDBSeekButton('frontpage_id', 'esales', 'form_System_user', 'SystemProgram', 'name', 'frontpage_id', 'frontpage_name');
     $frontpage_name = new TEntry('frontpage_name');
     $scroll = new TScroll();
     $scroll->setSize(290, 230);
     $scroll->add($groups);
     $frame_groups->add($scroll);
     $frame_programs->add($multifield_programs);
     // define the sizes
     $id->setSize(100);
     $name->setSize(200);
     $login->setSize(150);
     $password->setSize(150);
     $email->setSize(200);
     $frontpage_id->setSize(100);
     $multifield_programs->setHeight(140);
     // outros
     $id->setEditable(false);
     $program_name->setEditable(false);
     $frontpage_name->setEditable(false);
     // validations
     $name->addValidation('Nome', new TRequiredValidator());
     $login->addValidation('Login', new TRequiredValidator());
     $email->addValidation('Email', new TEmailValidator());
     $program_id->setSize(50);
     $program_name->setSize(200);
     // configuracoes multifield
     $multifield_programs->setClass('SystemProgram');
     $multifield_programs->addField('id', 'ID', $program_id, 60);
     $multifield_programs->addField('name', 'Nome', $program_name, 250);
     $multifield_programs->setOrientation('horizontal');
     // add a row for the field id
     $table->addRowSet(new TLabel('ID:'), $id, new TLabel('Nome' . ': '), $name);
     $table->addRowSet(new TLabel('login' . ': '), $login, new TLabel('Email' . ': '), $email);
     $table->addRowSet(new TLabel('Senha' . ': '), $password, new TLabel('Confirmar senha' . ': '), $repassword);
     $table->addRowSet(new TLabel('Página inicial' . ': '), $frontpage_id, new TLabel('Nome página' . ': '), $frontpage_name);
     $row = $table->addRow();
     $cell = $row->addCell($frame_groups);
     $cell->colspan = 2;
     $row = $table->addRow();
     $cell = $row->addCell($frame_programs);
     $cell->colspan = 2;
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), 'Salvar');
     $save_button->setImage('ico_save.png');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), 'Novo');
     $new_button->setImage('ico_new.png');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('SystemUserList', 'onReload')), 'Voltar para listagem');
     $list_button->setImage('ico_datagrid.png');
     // define the form fields
     $this->form->setFields(array($id, $name, $login, $password, $repassword, $multifield_programs, $frontpage_id, $frontpage_name, $groups, $email, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 4;
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemUserList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the notebook
     $this->notebook = new TNotebook();
     $this->notebook->setSize(700, 390);
     // creates the table container
     $tableCampos = new TTable();
     // creates the form
     $this->form = new TForm('form_System_user');
     $this->notebook->appendPage(_t('User'), $tableCampos);
     // add the notebook inside the form
     $this->form->add($this->notebook);
     $frame_groups = new TFrame(300, 250);
     $frame_groups->setLegend(_t('Groups'));
     $frame_groups->style = 'margin: 4px';
     $frame_programs = new TFrame(340, 250);
     $frame_programs->setLegend(_t('Programs'));
     $frame_programs->style = 'margin: 4px';
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $login = new TEntry('login');
     $password = new TPassword('password');
     $repassword = new TPassword('repassword');
     $email = new TEntry('email');
     $multifield_programs = new TMultiField('programs');
     $program_id = new TDBSeekButton('program_id', 'permission', 'form_System_user', 'SystemProgram', 'name', 'programs_id', 'programs_name');
     $program_name = new TEntry('program_name');
     $groups = new TDBCheckGroup('groups', 'permission', 'SystemGroup', 'id', 'name');
     $frontpage_id = new TDBSeekButton('frontpage_id', 'permission', 'form_System_user', 'SystemProgram', 'name', 'frontpage_id', 'frontpage_name');
     $frontpage_name = new TEntry('frontpage_name');
     $scroll = new TScroll();
     $scroll->setSize(290, 230);
     $scroll->add($groups);
     $frame_groups->add($scroll);
     $frame_programs->add($multifield_programs);
     // define the sizes
     $id->setSize(100);
     $name->setSize(200);
     $login->setSize(150);
     $password->setSize(150);
     $email->setSize(200);
     $frontpage_id->setSize(100);
     $multifield_programs->setHeight(140);
     // outros
     $id->setEditable(false);
     $program_name->setEditable(false);
     $frontpage_name->setEditable(false);
     // validations
     $name->addValidation(_t('Name'), new TRequiredValidator());
     $login->addValidation('Login', new TRequiredValidator());
     $email->addValidation('Email', new TEmailValidator());
     $program_id->setSize(50);
     $program_name->setSize(200);
     // configuracoes multifield
     $multifield_programs->setClass('SystemProgram');
     $multifield_programs->addField('id', 'ID', $program_id, 60);
     $multifield_programs->addField('name', _t('Name'), $program_name, 250);
     $multifield_programs->setOrientation('horizontal');
     // add a row for the field id
     $tableCampos->addRowSet(new TLabel('ID:'), $id, new TLabel(_t('Name') . ': '), $name);
     $tableCampos->addRowSet(new TLabel(_t('Login') . ': '), $login, new TLabel(_t('Email') . ': '), $email);
     $tableCampos->addRowSet(new TLabel(_t('Password') . ': '), $password, new TLabel(_t('Password confirmation') . ': '), $repassword);
     $tableCampos->addRowSet(new TLabel(_t('Front page') . ': '), $frontpage_id, new TLabel(_t('Page name') . ': '), $frontpage_name);
     $row = $tableCampos->addRow();
     $cell = $row->addCell($frame_groups);
     $cell->colspan = 2;
     $cell = $row->addCell($frame_programs);
     $cell->colspan = 2;
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('ico_new.png');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('SystemUserList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('ico_datagrid.png');
     // define the form fields
     $this->form->setFields(array($id, $name, $login, $password, $repassword, $multifield_programs, $frontpage_id, $frontpage_name, $groups, $email, $save_button, $new_button, $list_button));
     $table_buttons = new TTable();
     $row_buttons = $table_buttons->addRow();
     $row_buttons->addCell($save_button);
     $row_buttons->addCell($new_button);
     $row_buttons->addCell($list_button);
     $container = new TTable();
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemUserList'));
     $container->addRow()->addCell($this->form);
     $container->addRow()->addCell($table_buttons);
     // add the form to the page
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_FreqServForm');
     $this->form->class = 'tform';
     // creates the table container
     $table = new TTable();
     $table->style = 'width: 100%';
     $table->addRowSet(new TLabel('Frequência'), '', '', '')->class = 'tformtitle';
     // add the table inside the form
     $this->form->add($table);
     $frame_horarios = new TFrame(NULL, 210);
     $frame_horarios->setLegend('Horários');
     $frame_horarios->style .= ';margin: 15px';
     $frame_ausencia = new TFrame(NULL, 210);
     $frame_ausencia->setLegend('Ausência');
     $frame_ausencia->style .= ';margin: 15px';
     // create the form fields
     $id = new TEntry('id');
     $servidor_id = new TDBSeekButton('servidor_id', 'lacenrh', 'form_FreqServForm', 'Servidor', 'servidor', 'servidor_id', 'servidor_nome');
     $servidor_nome = new TEntry('servidor_nome');
     $diames = new TDate('diames');
     $entrada = new TEntry('entrada');
     $intervalo_inicio = new TEntry('intervalo_inicio');
     $intervalo_fim = new TEntry('intervalo_fim');
     $saida = new TEntry('saida');
     $ausencia_id = new TDBSeekButton('ausencia_id', 'lacenrh', 'form_FreqServForm', 'Ausencia', 'ausencia', 'ausencia_id', 'ausencia_desc');
     $ausencia_desc = new TEntry('ausencia_desc');
     $horas_justificadas = new TEntry('horas_justificadas');
     $justificativa = new TText('justificativa');
     $horas_trabalhadas = new TEntry('horas_trabalhadas');
     // define the sizes
     $id->setSize(40);
     $servidor_id->setSize(40);
     $servidor_nome->setSize(300);
     $diames->setSize(100);
     $entrada->setSize(50);
     $intervalo_inicio->setSize(50);
     $intervalo_fim->setSize(50);
     $saida->setSize(50);
     $ausencia_id->setSize(40);
     $ausencia_desc->setSize(200);
     $horas_justificadas->setSize(50);
     $justificativa->setSize(200, 50);
     $horas_trabalhadas->setSize(200, 50);
     // outras propriedades
     $id->setEditable(false);
     $servidor_nome->setEditable(false);
     $diames->setMask('dd/mm/yyyy');
     $entrada->setMask('99:99');
     $entrada->setValue('00:00');
     $intervalo_inicio->setMask('99:99');
     $intervalo_inicio->setValue('00:00');
     $intervalo_fim->setMask('99:99');
     $intervalo_fim->setValue('00:00');
     $saida->setMask('99:99');
     $saida->setValue('00:00');
     $ausencia_desc->setEditable(false);
     $horas_justificadas->setMask('99:99');
     $horas_justificadas->setValue('00:00');
     $horas_trabalhadas->setMask('99:99');
     // validations
     $servidor_id->addValidation('Servidor', new TRequiredValidator());
     $servidor_nome->addValidation('Nome', new TRequiredValidator());
     $diames->addValidation('Data', new TRequiredValidator());
     $table_horarios = new TTable();
     $table_horarios->addRowSet(new TLabel('Data ' . ': '), $diames);
     $table_horarios->addRowSet(new TLabel('Entrada ' . ': '), $entrada);
     $table_horarios->addRowSet(new TLabel('Intervalo - Início ' . ': '), $intervalo_inicio);
     $table_horarios->addRowSet(new TLabel('Intervalo - Fim' . ': '), $intervalo_fim);
     $table_horarios->addRowSet(new TLabel('Saída' . ': '), $saida);
     $frame_horarios->add($table_horarios);
     $table_ausencia = new TTable();
     $table_ausencia->addRowSet(new TLabel('Motivo ' . ': '), $ausencia_id);
     $table_ausencia->addRowSet(new TLabel('Descrição ' . ': '), $ausencia_desc);
     $table_ausencia->addRowSet(new TLabel('Horas Justificadas ' . ': '), $horas_justificadas);
     $table_ausencia->addRowSet(new TLabel('Justificativa ' . ': '), $justificativa);
     $frame_ausencia->add($table_ausencia);
     // add a row for the field id
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('Servidor' . ': '), $servidor_id);
     $table->addRowSet(new TLabel('Nome' . ': '), $servidor_nome);
     $row = $table->addRow();
     $cell = $row->addCell($frame_horarios);
     $cell->colspan = 2;
     $cell = $row->addCell($frame_ausencia);
     $cell->colspan = 2;
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('fa:floppy-o fa-lg');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('fa:plus-square green fa-lg');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('FrequenciaServidorList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('fa:table blue fa-lg');
     // define the form fields
     $this->form->setFields(array($id, $servidor_id, $servidor_nome, $diames, $entrada, $intervalo_inicio, $intervalo_fim, $saida, $ausencia_id, $ausencia_desc, $horas_justificadas, $justificativa, $horas_trabalhadas, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 4;
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'FrequenciaServidorList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
 public function __construct()
 {
     parent::__construct();
     parent::include_css('app/resources/myframe.css');
     $vbox = new TVBox();
     $bt1a = new TButton('bt1a');
     $bt1b = new TButton('bt1b');
     $bt1c = new TButton('bt1c');
     $bt1a->setLabel('BS disk');
     $bt1b->setLabel('BS edit');
     $bt1c->setLabel('BS remove');
     $bt1a->setImage('bs:floppy-disk red');
     $bt1b->setImage('bs:edit green');
     $bt1c->setImage('bs:remove-circle blue');
     $hbox1 = new THBox();
     $hbox1->addRowSet($bt1a, $bt1b, $bt1c);
     $frame1 = new TFrame();
     $frame1->setLegend('Bootstrap Glyphicons');
     $frame1->add($hbox1);
     $bt2a = new TButton('bt2a');
     $bt2b = new TButton('bt2b');
     $bt2c = new TButton('bt2c');
     $bt2a->setLabel('FA save');
     $bt2b->setLabel('FA edit');
     $bt2c->setLabel('FA trash');
     $bt2a->setImage('fa:save red');
     $bt2b->setImage('fa:edit green');
     $bt2c->setImage('fa:trash-o blue');
     $hbox2 = new THBox();
     $hbox2->addRowSet($bt2a, $bt2b, $bt2c);
     $frame2 = new TFrame();
     $frame2->setLegend('Font awesome icons');
     $frame2->add($hbox2);
     $bt3a = new TButton('bt3a');
     $bt3b = new TButton('bt3b');
     $bt3c = new TButton('bt3c');
     $bt3a->setLabel('Warning');
     $bt3b->setLabel('Info');
     $bt3c->setLabel('Success');
     $bt3a->class = 'btn btn-warning btn-sm';
     $bt3b->class = 'btn btn-info';
     $bt3c->class = 'btn btn-success btn-lg';
     $hbox3 = new THBox();
     $hbox3->addRowSet($bt3a, $bt3b, $bt3c);
     $frame3 = new TFrame();
     $frame3->setLegend('Bootstrap styles and sizes');
     $frame3->add($hbox3);
     $bt4a = new TButton('bt4a');
     $bt4b = new TButton('bt4b');
     $bt4c = new TButton('bt4c');
     $bt4a->setLabel('Popover 1');
     $bt4b->setLabel('Popover 2');
     $bt4c->setLabel('Popover 3');
     $bt4a->popover = 'true';
     $bt4a->poptitle = 'Pop title 1';
     $bt4a->popcontent = 'This is the <br>popover for button 1';
     $bt4b->popover = 'true';
     $bt4b->poptitle = 'Pop title 2';
     $bt4b->popcontent = 'This is the <br>popover for button 2';
     $bt4c->popover = 'true';
     $bt4c->poptitle = 'Pop title 3';
     $bt4c->popcontent = 'This is the <br>popover for button 3';
     $hbox4 = new THBox();
     $hbox4->addRowSet($bt4a, $bt4b, $bt4c);
     $frame4 = new TFrame();
     $frame4->setLegend('Buttons with popover');
     $frame4->add($hbox4);
     $bt5a = new TButton('bt5a');
     $bt5b = new TButton('bt5b');
     $bt5c = new TButton('bt5c');
     $bt5a->setLabel('Action 1');
     $bt5b->setLabel('Action 2');
     $bt5c->setLabel('Action 3');
     $bt5a->addFunction("alert('action 1');");
     $bt5b->addFunction("alert('going to another page');__adianti_load_page('index.php?class=FormQuickView');");
     $bt5c->addFunction("if (confirm('Want to go?') == true) { __adianti_load_page('index.php?class=ContainerWindowView'); }");
     $hbox5 = new THBox();
     $hbox5->addRowSet($bt5a, $bt5b, $bt5c);
     $frame5 = new TFrame();
     $frame5->setLegend('Buttons with Javascript actions');
     $frame5->add($hbox5);
     $vbox->add($frame1);
     $vbox->add($frame2);
     $vbox->add($frame3);
     $vbox->add($frame4);
     $vbox->add($frame5);
     parent::add($vbox);
 }
Esempio n. 9
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Sale');
     $this->form->class = 'tform';
     // CSS class
     parent::include_css('app/resources/custom-frame.css');
     $table_master = new TTable();
     $table_master->width = '100%';
     $table_master->addRowSet(new TLabel('Sale'), '', '')->class = 'tformtitle';
     // add a table inside form
     $table_general = new TTable();
     $table_general->width = '100%';
     $tableProduct = new TTable();
     $tableProduct->width = '100%';
     $frame_general = new TFrame();
     $frame_general->setLegend('General data');
     $frame_general->style = 'background:whiteSmoke';
     $frame_general->add($table_general);
     $table_master->addRow()->addCell($frame_general)->colspan = 2;
     $row = $table_master->addRow();
     $row->addCell($tableProduct);
     $this->form->add($table_master);
     // master fields
     $id = new TEntry('id');
     $date = new TDate('date');
     $customer_id = new TDBSeekButton('customer_id', 'samples', $this->form->getName(), 'Customer', 'name', 'customer_id', 'customer_name');
     $customer_name = new TEntry('customer_name');
     $obs = new TText('obs');
     // detail fields
     $product_id = new TDBSeekButton('product_id', 'samples', $this->form->getName(), 'Product', 'description', 'product_id', 'product_name');
     $product_name = new TEntry('product_name');
     $sale_price = new TEntry('product_price');
     $amount = new TEntry('product_amount');
     $discount = new TEntry('product_discount');
     $total = new TEntry('product_total');
     $product_id->setExitAction(new TAction(array($this, 'onProductChange')));
     $id->setSize(40);
     $date->setSize(100);
     $obs->setSize(400, 100);
     $product_id->setSize(50);
     $customer_id->setSize(50);
     $id->setEditable(false);
     $product_name->setEditable(false);
     $customer_name->setEditable(false);
     $date->addValidation('Date', new TRequiredValidator());
     $customer_id->addValidation('Customer', new TRequiredValidator());
     // pedido
     $table_general->addRowSet(new TLabel('ID'), $id);
     $table_general->addRowSet($label_date = new TLabel('Date (*)'), $date);
     $table_general->addRowSet($label_customer = new TLabel('Customer (*)'), array($customer_id, $customer_name));
     $table_general->addRowSet(new TLabel('Obs'), $obs);
     $label_date->setFontColor('#FF0000');
     // products
     $frame_product = new TFrame();
     $frame_product->setLegend('Products');
     $row = $tableProduct->addRow();
     $row->addCell($frame_product);
     $add_product = new TButton('add_product');
     $action_product = new TAction(array($this, 'onProductAdd'));
     $add_product->setAction($action_product, 'Register');
     $add_product->setImage('fa:save');
     $subtable_product = new TTable();
     $frame_product->add($subtable_product);
     $subtable_product->addRowSet($label_product = new TLabel('Product (*)'), array($product_id, $product_name));
     $subtable_product->addRowSet($label_sale_price = new TLabel('Price (*)'), $sale_price);
     $subtable_product->addRowSet($label_amount = new TLabel('Amount(*)'), $amount);
     $subtable_product->addRowSet(new TLabel('Discount'), $discount);
     $subtable_product->addRowSet($add_product);
     $label_product->setFontColor('#FF0000');
     $label_amount->setFontColor('#FF0000');
     $label_sale_price->setFontColor('#FF0000');
     $this->product_list = new TQuickGrid();
     $this->product_list->setHeight(175);
     $this->product_list->makeScrollable();
     $this->product_list->disableDefaultClick();
     $this->product_list->addQuickColumn('', 'edit', 'left', 50);
     $this->product_list->addQuickColumn('', 'delete', 'left', 50);
     $this->product_list->addQuickColumn('ID', 'product_id', 'center', 40);
     $this->product_list->addQuickColumn('Product', 'product_name', 'left', 200);
     $this->product_list->addQuickColumn('Amount', 'product_amount', 'left', 60);
     $this->product_list->addQuickColumn('Price', 'product_price', 'right', 80);
     $this->product_list->addQuickColumn('Discount', 'product_discount', 'right', 80);
     $this->product_list->createModel();
     $row = $tableProduct->addRow();
     $row->addCell($this->product_list);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onClear')), _t('New'));
     $new_button->setImage('ico_new.png');
     // define form fields
     $this->formFields = array($id, $date, $customer_id, $customer_name, $obs, $product_id, $product_name, $sale_price, $amount, $discount, $total, $add_product, $save_button, $new_button);
     $this->form->setFields($this->formFields);
     $table_master->addRowSet(array($save_button, $new_button), '', '')->class = 'tformaction';
     // CSS class
     // create the page container
     $container = new TVBox();
     $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->add($this->form);
     parent::add($container);
 }
Esempio n. 10
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the table container
     $table = new TTable();
     $table->style = 'width:100%';
     $frame_programs = new TFrame();
     $frame_programs->setLegend(_t('Programs'));
     // creates the form
     $this->form = new TForm('form_System_group');
     $this->form->class = 'tform';
     // add the notebook inside the form
     $this->form->add($table);
     $table->addRowSet(new TLabel(_t('Notes')), '')->class = 'tformtitle';
     // create the form fields
     $hour = new TEntry('hour');
     $place = new TEntry('place');
     $description = new TEntry('description');
     $multifield = new TMultiField('programs');
     $program_id = new TDBSeekButton('program_hour', 'permission', 'form_System_group', 'SystemProgram', 'place', 'description', 'programs_hour', 'programs_place', 'programs_description');
     $program_place = new TEntry('program_place');
     $frame_programs->add($multifield);
     $multifield->setHeight(200);
     $multifield->setClass('SystemProgram');
     $multifield->addField('hour', ' Hour', $program_hour, 80, true);
     $multifield->addField('place', _t('Place'), $program_place, 350);
     $multifield->addField('description', _t('Description'), $program_description, 350);
     $multifield->setOrientation('horizontal');
     // define the sizes
     $program_hour->setSize(70);
     $hour->setSize(100);
     $place->setSize(200);
     // validations
     $place->addValidation('place', new TRequiredValidator());
     // outras propriedades
     $hour->setEditable(false);
     $program_place->setEditable(false);
     // add a row for the field id
     $table->addRowSet(new TLabel('Hour:'), $hour);
     $table->addRowSet(new TLabel(_t('place') . ': '), $place);
     // add a row for the field name
     $row = $table->addRow();
     $cell = $row->addCell($frame_programs);
     $cell->colspan = 2;
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('fa:floppy-o');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('fa:plus-square green');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('CalendarView', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('fa:table blue');
     // define the form fields
     $this->form->setFields(array($id, $name, $multifield, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $container = new TTable();
     $container->width = '80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'CalendarView'));
     $container->addRow()->addCell($this->form);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 2;
     // add the form to the page
     parent::add($container);
 }