/** * 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); }
/** * 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); }
/** * método construtor * Cria a página e o formulário de cadastro */ function __construct() { parent::__construct(); $this->form = new TForm('form_person'); $this->form->{'class'} = 'tform'; // CSS class $this->form->{'style'} = 'width:570px'; $vbox = new TVBox(); $this->form->add($vbox); $table = new TTable(); $table_buttons = new TTable(); $table->{'width'} = '100%'; $vbox->add($table); //TSession::freeSession(); $row = $table->addRow(); $row->class = 'tformtitle'; $cell = $row->addCell(new TLabel('TESTE')); $cell->colspan = 2; $id = new TEntry('id'); $name = new TEntry('name'); $address = new TEntry('address'); $code = new TEntry('code'); $description = new TEntry('description'); $value = new TEntry('value'); $code->setSize(40); $value->setSize(140); $table->addRowSet(new TLabel('ID'), $id); $table->addRowSet(new TLabel('Name'), $name); $table->addRowSet(new TLabel('Address'), $address); $frame = new TFrame(460, 70); $frame->setLegend('Itens'); $row = $table->addRow(); $row->addCell($frame)->colspan = 2; $add_button = new TButton('add'); $delAction = new TAction(array($this, 'onAddDado')); $add_button->setAction($delAction, 'Save'); $add_button->setImage('ico_save.png'); $subtable = new TTable(); $frame->add($subtable); $subtable->addRowSet(new TLabel('Code'), new TLabel('Descrição'), new TLabel('Valor')); $subtable->addRowSet($code, $description, $value, $add_button); $this->lista = new TQuickGrid(); $this->lista->setHeight(200); $this->lista->makeScrollable(); $this->lista->addQuickColumn('', 'edit', 'left', 40); $this->lista->addQuickColumn('', 'delete', 'left', 40); $this->lista->addQuickColumn('Código', 'code', 'left', 40); $this->lista->addQuickColumn('Descricao', 'description', 'left', 300); $this->lista->addQuickColumn('Valor', 'value', 'left', 100); $this->lista->createModel(); $vbox->add($this->lista); $row = $table->addRow(); $row->addCell($this->lista)->colspan = 2; // cria um botão de ação (salvar) $save_button = new TButton('save'); $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save')); $save_button->setImage('ico_save.png'); // cria um botão de ação (novo) $new_button = new TButton('new'); $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New')); $new_button->setImage('ico_new.png'); // define quais são os campos do formulário $this->formFields = array($id, $name, $address, $code, $description, $value, $save_button, $new_button, $add_button); $this->form->setFields($this->formFields); // add a row for the form action $row = $table_buttons->addRow(); $row->addCell($save_button); $row->addCell($new_button); // add a row for the form action $row = $table->addRow(); $row->class = 'tformaction'; $cell = $row->addCell($table_buttons); $cell->colspan = 2; $this->form->add($table); parent::add($this->form); }
/** * 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); }
/** * */ 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; }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TForm('form_Ticket'); $this->form->class = 'tform'; // CSS class $this->form->style = 'width: 500px'; // creates the table container $table = new TTable(); $table->width = '110%'; // add the table inside the form $this->form->add($table); // define the form title $row = $table->addRow(); $row->class = 'tformtitle'; // CSS class $row->addCell(new TLabel('Resumo de Tickets e Atividades'))->colspan = 3; // create the form fields $ticket = new TEntry('ticket_id'); $ticket->setMask('99999'); $solicitante_id = new TSeekButton('solicitante_id'); $solicitante_nome = new TEntry('solicitante_nome'); $obj = new TicketPessoaSeek(); $action = new TAction(array($obj, 'onReload')); $solicitante_id->setAction($action); $solicitante_nome->setEditable(FALSE); $criteria = new TCriteria(); $criteria->add(new TFilter("origem", "=", 1)); $criteria->add(new TFilter("ativo", "=", 1)); $criteria->add(new TFilter("codigo_cadastro_origem", "=", 100)); $responsavel_id = new TDBCombo('responsavel_id', 'atividade', 'Pessoa', 'pessoa_codigo', 'pessoa_nome', 'pessoa_nome', $criteria); $criteria = new TCriteria(); $criteria->add(new TFilter('enttipent', '=', 1)); $entcodent = new TDBComboMultiValue('entcodent', 'atividade', 'Entidade', 'entcodent', array(0 => 'entcodent', 1 => 'entrazsoc'), 'entcodent', $criteria); $status_ticket_id = new TDBCombo('status_ticket_id', 'atividade', 'StatusTicket', 'id', 'nome'); $prioridade_id = new TDBCombo('prioridade_id', 'atividade', 'Prioridade', 'id', 'nome'); $tipo_ticket_id = new TDBCombo('tipo_ticket_id', 'atividade', 'TipoTicket', 'id', 'nome'); $ticket_sistema_id = new TDBCombo('ticket_sistema_id', 'atividade', 'Sistema', 'id', 'nome'); $atividade_sistema_id = new TDBCombo('atividade_sistema_id', 'atividade', 'Sistema', 'id', 'nome'); $saldo = new TCombo('saldo'); $combo_saldo = array(); $combo_saldo['c'] = 'Com saldo'; $saldo->addItems($combo_saldo); $data_prevista = new TDate('data_prevista'); $data_prevista->setMask('dd/mm/yyyy'); $dataAtividadeInicio = new TDate('data_atividade_inicio'); $dataAtividadeInicio->setMask('dd/mm/yyyy'); $dataAtividadeInicio->setValue('01/' . date('m/Y')); $dataAtividadeFinal = new TDate('data_atividade_final'); $dataAtividadeFinal->setMask('dd/mm/yyyy'); $dataAtividadeFinal->setValue(date('d/m/Y')); $criteria = new TCriteria(); $criteria->add(new TFilter("origem", "=", 1)); $criteria->add(new TFilter("ativo", "=", 1)); $criteria->add(new TFilter("codigo_cadastro_origem", "=", 100)); $colaborador_id = new TDBCombo('colaborador_id', 'atividade', 'Pessoa', 'pessoa_codigo', 'pessoa_nome', 'pessoa_nome', $criteria); $tipo_atividade_id = new TDBCombo('tipo_atividade_id', 'atividade', 'TipoAtividade', 'id', 'nome', 'nome'); $pesquisa_master = new TEntry('pesquisa_master'); $tipo = new TRadioGroup('tipo'); $output_type = new TRadioGroup('output_type'); // define the sizes $ticket->setSize(100); $solicitante_id->setSize(30); $solicitante_nome->setSize(245); $responsavel_id->setSize(300); $colaborador_id->setSize(300); $entcodent->setSize(300); $status_ticket_id->setSize(100); $prioridade_id->setSize(100); $tipo_ticket_id->setSize(200); $ticket_sistema_id->setSize(200); $atividade_sistema_id->setSize(200); $saldo->setSize(100); $data_prevista->setSize(100); $dataAtividadeInicio->setSize(100); $dataAtividadeFinal->setSize(100); $tipo->setSize(100); $output_type->setSize(100); // validations $output_type->addValidation('Output', new TRequiredValidator()); // add one row for each form field // creates a frame $frame = new TFrame(); $frame->oid = 'frame-measures'; $frame->setLegend('Tickets:'); $row = $table->addRow(); $cell = $row->addCell($frame); $cell->colspan = 2; $frame1 = new TTable(); $frame->add($frame1); $frame1->addRowSet(new TLabel('Ticket inicial:'), $ticket); $frame1->addRowSet(new TLabel('Solicitante:'), array($solicitante_id, $solicitante_nome)); $frame1->addRowSet(new TLabel('Responsável:'), $responsavel_id); $frame1->addRowSet(new TLabel('Cliente:'), $entcodent); $frame1->addRowSet(new TLabel('Tipo:'), $tipo_ticket_id); $frame1->addRowSet(new TLabel('Sistema:'), $ticket_sistema_id); $frame1->addRowSet(new TLabel('Status:'), $status_ticket_id); $frame1->addRowSet(new TLabel('Prioridade:'), $prioridade_id); $frame1->addRowSet(new TLabel('Saldo:'), $saldo); $frame1->addRowSet(new TLabel('Dt. Prevista limite:'), $data_prevista); // creates a frame $frame = new TFrame(); $frame->oid = 'frame-measures'; $frame->setLegend('Atividades:'); $row = $table->addRow(); $cell = $row->addCell($frame); $cell->colspan = 2; $frame2 = new TTable(); $frame->add($frame2); $frame2->addRowSet(new TLabel('Dt. Atividades inicio:'), array($dataAtividadeInicio, $label_data_fim = new TLabel('Fim:'), $dataAtividadeFinal)); $label_data_fim->setSize(48); $frame2->addRowSet(new TLabel('Atividades colaborador:'), $colaborador_id); $frame2->addRowSet(new TLabel('Tipo atividade:'), $tipo_atividade_id); $frame2->addRowSet(new TLabel('Sistema:'), $atividade_sistema_id); // creates a frame $frame = new TFrame(); $frame->oid = 'frame-measures'; $frame->setLegend('Pesquisa Master:'); $row = $table->addRow(); $cell = $row->addCell($frame); $cell->colspan = 2; $frame3 = new TTable(); $frame->add($frame3); $frame3->addRowSet(new TLabel('<nobr>Por palavra:</nobr>'), $pesquisa_master); $frame3->addRowSet(new TLabel(''), new TLabel('Essa pesquisa busca pelo titulo do ticket e da descrição da atividade')); $table->addRowSet(new TLabel('Relatório'), $tipo); $table->addRowSet(new TLabel('Output:'), $output_type); $this->form->setFields(array($ticket, $solicitante_id, $solicitante_nome, $responsavel_id, $entcodent, $status_ticket_id, $prioridade_id, $saldo, $tipo_ticket_id, $ticket_sistema_id, $data_prevista, $dataAtividadeInicio, $dataAtividadeFinal, $colaborador_id, $tipo_atividade_id, $atividade_sistema_id, $pesquisa_master, $tipo, $output_type)); $tipo->addItems(array('s' => 'Sintético', 'a' => 'Analitico')); $tipo->setValue('s'); $tipo->setLayout('horizontal'); //$output_type->addItems(array('html'=>'HTML', 'pdf'=>'PDF', 'rtf'=>'RTF')); $output_type->addItems(array('html' => 'HTML')); $output_type->setValue('html'); $output_type->setLayout('horizontal'); $generate_button = TButton::create('generate', array($this, 'onGenerate'), _t('Generate'), 'fa:check-circle-o green'); $this->form->addField($generate_button); $change_data = new TAction(array($this, 'onChangeData')); $dataAtividadeInicio->setExitAction($change_data); $dataAtividadeFinal->setExitAction($change_data); // add a row for the form action $table->addRowSet($generate_button, '')->class = 'tformaction'; parent::add($this->form); }
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_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); }
/** * 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); }
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); }
/** * 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); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TForm('form_Ticket'); $this->form->class = 'tform'; // CSS class $table = new TTable(); $table->style = 'width: 600px'; $tablePagamento = new TTable(); $tablePagamento->style = 'width: 600px'; $notebook = new TNotebook(600, 650); $notebook->appendPage('Ticket - Cadastramento', $table); $notebook->appendPage('Ticket - Orçamento / Pagamento', $tablePagamento); // create the form fields $id = new TEntry('id'); $id->setEditable(FALSE); $titulo = new TEntry('titulo'); $origem = new TCombo('origem'); $combo_origem = array(); $combo_origem['I'] = 'Interno'; $combo_origem['E'] = 'Externo'; $origem->addItems($combo_origem); $origem->setDefaultOption(FALSE); $solicitacao_descricao = new TText('solicitacao_descricao'); $providencia = new TText('providencia'); $orcamento_horas = new TEntry('orcamento_horas'); $orcamento_horas->setMask('999999'); $orcamento_valor_hora = new TEntry('orcamento_valor_hora'); $orcamento_valor_hora->setNumericMask(2, ',', '.'); $valor_desconto = new TEntry('valor_desconto'); $valor_desconto->setNumericMask(2, ',', '.'); $valor_total = new TEntry('valor_total'); $valor_total->setNumericMask(2, ',', '.'); $valor_total->setEditable(FALSE); $forma_pagamento = new TEntry('forma_pagamento'); $data_ultimo_pgto = new TEntry('data_ultimo_pgto'); $data_ultimo_pgto->setEditable(FALSE); $valor_ultimo_pgto = new TEntry('valor_ultimo_pgto'); $valor_ultimo_pgto->setNumericMask(2, ',', '.'); $valor_ultimo_pgto->setEditable(FALSE); $valor_total_pago = new TEntry('valor_total_pago'); $valor_total_pago->setNumericMask(2, ',', '.'); $valor_total_pago->setEditable(FALSE); $data_pagamento = new TDate('data_pagamento'); $data_pagamento->setMask('dd/mm/yyyy'); $valor_pagamento = new TEntry('valor_pagamento'); $valor_pagamento->setNumericMask(2, ',', '.'); $valor_total_parcial = new TEntry('valor_total_parcial'); $valor_total_parcial->setNumericMask(2, ',', '.'); $valor_total_parcial->setEditable(FALSE); $valor_saldo = new TEntry('valor_saldo'); $valor_saldo->setNumericMask(2, ',', '.'); $valor_saldo->setEditable(FALSE); $data_cadastro = new TEntry('data_cadastro'); $data_cadastro->setEditable(FALSE); $data_cadastro->setMask('dd/mm/yyyy'); $data_cadastro->setValue(date('d/m/Y')); $data_inicio = new TDate('data_inicio'); $data_inicio->setMask('dd/mm/yyyy'); $data_inicio_oculta = new THidden('data_inicio_oculta'); $data_cancelamento = new TDate('data_cancelamento'); $data_cancelamento->setMask('dd/mm/yyyy'); $data_encerramento = new TDate('data_encerramento'); $data_encerramento->setMask('dd/mm/yyyy'); $data_prevista = new TDate('data_prevista'); $data_prevista->setMask('dd/mm/yyyy'); $data_aprovacao = new TDate('data_aprovacao'); $data_aprovacao->setMask('dd/mm/yyyy'); $observacao = new TText('observacao'); $nome_dtr = new TEntry('nome_dtr'); $nome_dtr->setEditable(FALSE); $criteria = new TCriteria(); $criteria->add(new TFilter("origem", "=", 1)); $criteria->add(new TFilter("ativo", "=", 1)); $criteria->add(new TFilter("codigo_cadastro_origem", "=", 100)); $responsavel_id = new TDBCombo('responsavel_id', 'atividade', 'Pessoa', 'pessoa_codigo', 'pessoa_nome', 'pessoa_nome', $criteria); $tipo_ticket_id = new TDBCombo('tipo_ticket_id', 'atividade', 'TipoTicket', 'id', 'nome'); $tipo_ticket_id->setDefaultOption(FALSE); $sistema_id = new TDBCombo('sistema_id', 'atividade', 'Sistema', 'id', 'nome'); $status_ticket_id = new TDBCombo('status_ticket_id', 'atividade', 'StatusTicket', 'id', 'nome'); $status_ticket_id->setValue(2); $status_ticket_id->setEditable(FALSE); $prioridade_id = new TDBCombo('prioridade_id', 'atividade', 'Prioridade', 'id', 'nome'); $prioridade_id->setDefaultOption(FALSE); $prioridade_id->setValue(3); $combo_tipo_origens = new TCombo('tipo_origens'); $combo_tipo_origens->addItems(array(1 => 'Entidade', 2 => 'Estabelecimento', 3 => 'Empresa')); $combo_codigo_origem = new TCombo('codigo_cadastro_origem'); $combo_solicitante_id = new TCombo('solicitante_id'); try { TTransaction::open('atividade'); $logado = Pessoa::retornaUsuario(); TTransaction::close(); } catch (Exception $e) { new TMessage('error', '<b>Error</b> ' . $e->getMessage()); // shows the exception error message } $logado_id = new THidden('logado_id'); $logado_id->setValue($logado->pessoa_codigo); // define the sizes $id->setSize(100); $origem->setSize(200); $solicitacao_descricao->setSize(400, 180); $data_inicio->setSize(90); $data_encerramento->setSize(90); $data_cancelamento->setSize(90); $providencia->setSize(400, 80); $orcamento_horas->setSize(100); $orcamento_valor_hora->setSize(100); $valor_desconto->setSize(100); $valor_total->setSize(100); $valor_saldo->setSize(121); $forma_pagamento->setSize(400); $data_ultimo_pgto->setSize(100); $data_pagamento->setSize(100); $valor_pagamento->setSize(121); $valor_ultimo_pgto->setSize(100); $valor_total_pago->setSize(100); $valor_total_parcial->setSize(121); $data_cadastro->setSize(100); $data_prevista->setSize(100); $data_aprovacao->setSize(100); $observacao->setSize(400, 80); $nome_dtr->setSize(400); $titulo->setSize(390); $responsavel_id->setSize(390); $tipo_ticket_id->setSize(200); $sistema_id->setSize(200); $status_ticket_id->setSize(200); $prioridade_id->setSize(200); $combo_tipo_origens->setSize(135); $combo_codigo_origem->setSize(250); $combo_solicitante_id->setSize(390); // validações $titulo->addValidation('Titulo', new TRequiredValidator()); $combo_solicitante_id->addValidation('Solicitante', new TRequiredValidator()); $responsavel_id->addValidation('Responsável', new TRequiredValidator()); $sistema_id->addValidation('Sistema', new TRequiredValidator()); $gerar_dr = TButton::create('gerar_dr', array('RequisitoDesenvolvimentoForm', 'onEdit'), 'Gerar DTR', 'ico_add.png'); $link_dtr = new TButton('link_dtr'); $link_dtr->setImage('bs:edit green'); $link_dtr->setLabel('ir para DTR'); $link_dtr->addFunction("__adianti_load_page('index.php?class=RequisitoDesenvolvimentoForm&method=onBuscaDTR&key={$_REQUEST['key']}');"); $this->form->addField($gerar_dr); $this->form->addField($link_dtr); TButton::disableField('form_Ticket', 'gerar_dr'); TButton::disableField('form_Ticket', 'link_dtr'); // add one row for each form field // notebook Cadastramento $table->addRowSet(new TLabel('Ticket:'), array($id, new TLabel('Data Cadastro'), $data_cadastro)); $table->addRowSet($label_combo_origem = new TLabel('Origem:'), array($combo_tipo_origens, $combo_codigo_origem)); $label_combo_origem->setFontColor('#FF0000'); $table->addRowSet($label_solicitante = new TLabel('Solicitante:'), $combo_solicitante_id); $label_solicitante->setFontColor('#FF0000'); $table->addRowSet($label_responsavel = new TLabel('Responsável:'), $responsavel_id); $label_responsavel->setFontColor('#FF0000'); $table->addRowSet($label_titulo = new TLabel('Título:'), $titulo); $label_titulo->setFontColor('#FF0000'); $table->addRowSet(new TLabel('Data Inicio'), array($data_inicio, $label_status = new TLabel('Status:'), $status_ticket_id)); $label_status->setSize(70); $table->addRowSet(new TLabel('Data Encerramento:'), array($data_encerramento, $label_data_cancelamento = new TLabel('Data Cancelamento:'), $data_cancelamento)); $label_data_cancelamento->setSize(160); $table->addRowSet(new TLabel('Prioridade:'), $prioridade_id); $table->addRowSet(new TLabel('Origem:'), $origem); $table->addRowSet(new TLabel('Tipo Ticket:'), $tipo_ticket_id); $table->addRowSet($label_sistema = new TLabel('Sistema:'), $sistema_id); $label_sistema->setFontColor('#FF0000'); $table->addRowSet(new TLabel('Descrição Solicitação:'), $solicitacao_descricao); $table->addRowSet(new TLabel('DR.:'), $nome_dtr); $table->addRowSet(new TLabel(''), array($gerar_dr, $link_dtr)); $table->addRowSet(new TLabel(''), $data_inicio_oculta); // notebook Pagamento $tablePagamento->addRowSet(new TLabel('Data Prevista:'), $data_prevista); $tablePagamento->addRowSet(new TLabel('Data Aprovação:'), $data_aprovacao); $tablePagamento->addRowSet(new TLabel('Qte Horas:'), $orcamento_horas); $tablePagamento->addRowSet(new TLabel('Valor Hora:'), $orcamento_valor_hora); $tablePagamento->addRowSet(new TLabel('Valor Desconto:'), $valor_desconto); $tablePagamento->addRowSet(new TLabel('Valor Total:'), $valor_total); $tablePagamento->addRowSet(new TLabel('Forma de Pgto:'), $forma_pagamento); $tablePagamento->addRowSet(new TLabel('Descrição Providência:'), $providencia); $tablePagamento->addRowSet(new TLabel('Observação:'), $observacao); // creates a frame $frame = new TFrame(); $frame->oid = 'frame-measures'; $frame->setLegend('Pagamentos:'); $row = $tablePagamento->addRow(); $cell = $row->addCell($frame); $cell->colspan = 2; $page2 = new TTable(); $frame->add($page2); $page2->addRowSet(new TLabel('Valor Pgto:'), array($valor_pagamento, $tamanho_label = new TLabel('Valor Ultimo Pgto:'), $valor_ultimo_pgto)); $tamanho_label->setSize(150); $page2->addRowSet(new TLabel('Data Pgto:'), array($data_pagamento, $tamanho_label = new TLabel('Data Ultimo Pgto:'), $data_ultimo_pgto)); $tamanho_label->setSize(150); $page2->addRowSet(new TLabel('Valor Total:'), array($valor_total_parcial, $tamanho_label = new TLabel('Valor Total Pago: '), $valor_total_pago)); $tamanho_label->setSize(150); $page2->addRowSet(new TLabel('Saldo a pagar:'), $valor_saldo); $tablePagamento->addRowSet(new TLabel(''), $logado_id); // Envia campos para o formulario $this->form->setFields(array($id, $titulo, $data_inicio, $data_inicio_oculta, $data_encerramento, $data_cancelamento, $origem, $solicitacao_descricao, $nome_dtr, $providencia, $orcamento_horas, $orcamento_valor_hora, $valor_desconto, $valor_total, $forma_pagamento, $data_ultimo_pgto, $valor_ultimo_pgto, $valor_total_pago, $data_cadastro, $data_prevista, $data_aprovacao, $observacao, $tipo_ticket_id, $sistema_id, $status_ticket_id, $prioridade_id, $responsavel_id, $valor_total_parcial, $valor_pagamento, $data_pagamento, $valor_saldo, $combo_tipo_origens, $combo_codigo_origem, $combo_solicitante_id, $logado_id)); // create the form actions $save_button = TButton::create('save', array($this, 'onSave'), _t('Save'), 'fa:floppy-o'); $new_button = TButton::create('new', array($this, 'onEdit'), _t('New'), 'fa:plus-square green'); $del_button = TButton::create('delete', array($this, 'onDelete'), _t('Delete'), 'fa:trash-o red fa-lg'); $list_button = TButton::create('list', array('TicketList', 'onReload'), _t('List'), 'fa:table blue'); $enviar_email = TButton::create('email', array($this, 'onEnviaEmail'), 'Enviar Email', 'ico_email.png'); $sincronizar = TButton::create('sincronizar', array($this, 'onSincronizarContatos'), 'Sincronizar Contatos', 'sincronizar.png'); $this->form->addField($save_button); $this->form->addField($new_button); $this->form->addField($del_button); $this->form->addField($list_button); $this->form->addField($enviar_email); $this->form->addField($sincronizar); $subtable = new TTable(); $row = $subtable->addRow(); $row->addCell($save_button); $row->addCell($new_button); $row->addCell($del_button); $row->addCell($list_button); $row->addCell($enviar_email); $row->addCell($sincronizar); $pretable = new TTable(); $pretable->style = 'width: 100%'; $row = $pretable->addRow(); $row->class = 'tformtitle'; // CSS class $row->addCell(new TLabel('Cadastro de Ticket'))->colspan = 2; $change_action = new TAction(array($this, 'onCalculaValorTotal')); $orcamento_horas->setExitAction($change_action); $orcamento_valor_hora->setExitAction($change_action); $valor_desconto->setExitAction($change_action); $change_data_action = new TAction(array($this, 'onChangeDataAction')); $data_aprovacao->setExitAction($change_data_action); $change_data_prev = new TAction(array($this, 'onChangeDataPrevista')); $data_prevista->setExitAction($change_data_prev); $change_data_pagamento = new TAction(array($this, 'onChangeDataPagamento')); $data_pagamento->setExitAction($change_data_pagamento); $change_valor = new TAction(array($this, 'onCalculaValorParcial')); $valor_pagamento->setExitAction($change_valor); $change_status = new TAction(array($this, 'onChangeDataInicio')); $data_inicio->setExitAction($change_status); $change_status = new TAction(array($this, 'onChangeDataCancelamento')); $data_cancelamento->setExitAction($change_status); $change_status = new TAction(array($this, 'onChangeDataEncerramento')); $data_encerramento->setExitAction($change_status); $change_origem = new TAction(array($this, 'onChangeOrigem')); $combo_tipo_origens->setChangeAction($change_origem); $change_tipo_origem = new TAction(array($this, 'onChangeTipoOrigem')); $combo_codigo_origem->setChangeAction($change_tipo_origem); $vbox = new TVBox(); $vbox->add($pretable); $vbox->add($notebook); $vbox->add($subtable); $this->form->add($vbox); parent::add($this->form); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // creates a notebook $notebook = new TNotebook(500, 250); // creates the notebook page $page = new TTable(); // adds the notebook page $notebook->appendPage('Register data', $page); // create the form fields $field1 = new TEntry('field1'); $field2 = new TEntry('field2'); $field3 = new TEntry('field3'); $field4 = new TCombo('field4'); $field5 = new TEntry('field5'); $field6 = new TEntry('field6'); $field7 = new TEntry('field7'); $field8 = new TEntry('field8'); $field9 = new TEntry('field9'); // creates an array with items $units = array(); $units['PC'] = 'Piece'; $units['LT'] = 'Liter'; $units['ML'] = 'Milliliter'; $units['GL'] = 'Gallon'; $units['KG'] = 'Kilogram'; $units['GR'] = 'Gram'; // add the items to the combo $field4->addItems($units); // define some sizes $field1->setEditable(FALSE); $field1->setSize(100); $field2->setSize(300); $field4->setSize(100); $field3->setSize(100); $field5->setSize(100); $field6->setSize(100); $field7->setSize(100); $field8->setSize(100); $field9->setSize(300); // add a row for one field $row = $page->addRow(); $row->addCell(new TLabel('Id:')); $cell = $row->addCell($field1); // add a row for one field $row = $page->addRow(); $row->addCell(new TLabel('Description:')); $cell = $row->addCell($field2); // creates a frame $frame = new TFrame(); $frame->oid = 'frame-measures'; $frame->setLegend('Measures'); $button = new TButton('show_hide'); $button->class = 'btn btn-default btn-sm active'; $button->setLabel('Show/hide measures'); $button->addFunction("\$('[oid=frame-measures]').slideToggle(); \$(this).toggleClass( 'active' )"); $row = $page->addRow(); $row->addCell($button); // add the frame inside the table $row = $page->addRow(); $cell = $row->addCell($frame); $cell->colspan = 2; // adds another table inside the frame $page2 = new TTable(); $frame->add($page2); // add a row for tow fields $row = $page2->addRow(); $row->addCell(new TLabel('Stock:')); $row->addCell($field3); $row->addCell(new TLabel('Unit:')); $row->addCell($field4); // add a row for tow fields $row = $page2->addRow(); $row->addCell(new TLabel('Cost Price:')); $row->addCell($field5); $row->addCell(new TLabel('Sell Price:')); $row->addCell($field6); // add a row for tow fields $row = $page2->addRow(); $row->addCell(new TLabel('Net Weight:')); $row->addCell($field7); $row->addCell(new TLabel('Gross Weight:')); $row->addCell($field8); // add just another field $row = $page->addRow(); $row->addCell(new TLabel('Another field:')); $cell = $row->addCell($field9); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($notebook); parent::add($vbox); }
/** * 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); }