/**
  * 
  */
 public function makeTEntry($properties)
 {
     $widget = new TEntry((string) $properties->{'name'});
     $widget->setValue((string) $properties->{'value'});
     $widget->setMask((string) $properties->{'mask'});
     $widget->setSize((int) $properties->{'width'});
     if (isset($properties->{'maxlen'})) {
         $widget->setMaxLength((int) $properties->{'maxlen'});
     }
     if (isset($properties->{'tip'})) {
         $widget->setTip((string) $properties->{'tip'});
     }
     if (isset($properties->{'required'}) and $properties->{'required'} == '1') {
         $widget->addValidation((string) $properties->{'name'}, new TRequiredValidator());
     }
     $widget->setEditable((string) $properties->{'editable'});
     $this->fields[] = $widget;
     $this->fieldsByName[(string) $properties->{'name'}] = $widget;
     return $widget;
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // load the styles
     TPage::include_css('app/resources/formdecorator.css');
     // create the HTML Renderer
     $html = new THtmlRenderer('app/resources/formdecorator.html');
     // create the form using TQuickForm class
     $this->form = new TQuickForm();
     // create the form fields
     $id = new TEntry('id');
     $description = new TEntry('description');
     $date = new TDate('date');
     $time = new TEntry('time');
     $number = new TEntry('number');
     $text = new TText('text');
     $description->setTip('Type the description here...');
     $date->setMask('dd/mm/yyyy');
     // define date mask
     $time->setMask('99:99');
     $number->setNumericMask(2, ',', '.');
     // define numeric input
     // add the fields inside the form
     $this->form->addQuickField('Id', $id, 40);
     $this->form->addQuickField('Description', $description, 200);
     $this->form->addQuickField('Date (dd/mm/yyyy)', $date, 80);
     $this->form->addQuickField('Time (99:99)', $time, 60);
     $this->form->addQuickField('Numeric Input (9.999,99)', $number, 100);
     $this->form->addQuickField('Text', $text, 120);
     $text->setSize(200, 100);
     // define the form action
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
     // replace the main section variables
     $replace = array('form' => $this->form);
     $html->enableSection('main', $replace);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($html);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the notebook
     $notebook = new TNotebook(620, 340);
     // create the form
     $this->form = new TForm();
     // creates the notebook page
     $table = new TTable();
     // add the notebook inside the form
     $this->form->add($table);
     // adds the notebook page
     $notebook->appendPage('Input elements', $this->form);
     // create the form fields
     $field1 = new TEntry('field1');
     $field2 = new TEntry('field2');
     $field3 = new TEntry('field3');
     $field4 = new TEntry('field4');
     $field5 = new TPassword('field5');
     $field6 = new TDate('field6');
     $field7 = new TSpinner('field7');
     $field8 = new TSlider('field8');
     $field9 = new TText('field9');
     $field1->setTip('Tip for field 1');
     $field2->setTip('Tip for field 2');
     $field3->setTip('Tip for field 3');
     $field4->setTip('Tip for field 4');
     $field5->setTip('Tip for field 5');
     $field6->setTip('Tip for field 6');
     $field7->setTip('Tip for field 7');
     $field8->setTip('Tip for field 8');
     $field9->setTip('Tip for field 9');
     $field2->setValue('123');
     $field2->setEditable(FALSE);
     $field3->setMask('99.999-999');
     $field4->setMaxLength(10);
     $field6->setSize(100);
     $field7->setRange(0, 100, 10);
     $field8->setRange(0, 100, 10);
     $field7->setValue(30);
     $field8->setValue(50);
     $field9->setSize(300, 50);
     // add rows for the fields
     $table->addRowSet(new TLabel('TEntry object:'), $field1);
     $table->addRowSet(new TLabel('TEntry not editable:'), $field2);
     $table->addRowSet(new TLabel('TEntry with mask:'), $field3, new TLabel('99.999-999'));
     $table->addRowSet(new TLabel('TEntry with maxlength (10):'), $field4);
     $table->addRowSet(new TLabel('TPassword object:'), $field5);
     $table->addRowSet(new TLabel('TDate Object:'), $field6);
     $table->addRowSet(new TLabel('Spinner Object:'), $field7);
     $table->addRowSet(new TLabel('Slider Object:'), $field8);
     $table->addRowSet(new TLabel('TText Object:'), $field9);
     // creates the action button
     $button1 = new TButton('action1');
     // define the button action
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     // define wich are the form fields
     $this->form->setFields(array($field1, $field2, $field3, $field4, $field5, $field6, $field7, $field8, $field9, $button1));
     // add a row for the button
     $row = $table->addRow();
     $row->addCell($button1);
     // 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
  */
 function __construct()
 {
     parent::__construct();
     // create the notebook
     $notebook = new TNotebook(620, 410);
     // create the form
     $this->form = new TForm();
     // creates the notebook page
     $table = new TTable();
     // add the notebook inside the form
     $this->form->add($table);
     // adds the notebook page
     $notebook->appendPage('Input elements', $this->form);
     // create the form fields
     $field1 = new TEntry('field1');
     $field2 = new TEntry('field2');
     $field3 = new TEntry('field3');
     $field4 = new TEntry('field4');
     $field5 = new TEntry('field5');
     $field6 = new TPassword('field6');
     $field7 = new TDate('field7');
     $field8 = new TSpinner('field8');
     $field9 = new TSlider('field9');
     $field10 = new TText('field10');
     $field1->setTip('Tip for field 1');
     $field2->setTip('Tip for field 2');
     $field3->setTip('Tip for field 3');
     $field4->setTip('Tip for field 4');
     $field5->setTip('Tip for field 5');
     $field6->setTip('Tip for field 6');
     $field7->setTip('Tip for field 7');
     $field8->setTip('Tip for field 8');
     $field9->setTip('Tip for field 9');
     $field10->setTip('Tip for field 10');
     $field2->setValue('123');
     $field2->setEditable(FALSE);
     $field3->setMask('99.999-999');
     $field4->setMaxLength(10);
     $field5->setCompletion(array('Allen', 'Albert', 'Alberto', 'Alladin'));
     $field7->setSize(100);
     $field8->setRange(0, 100, 10);
     $field9->setRange(0, 100, 10);
     $field8->setValue(30);
     $field9->setValue(50);
     $field10->setSize(300, 80);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TEntry object:'));
     $cell = $row->addCell($field1);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TEntry not editable:'));
     $cell = $row->addCell($field2);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TEntry with mask:'));
     $cell = $row->addCell($field3);
     $cell = $row->addCell(new TLabel('99.999-999'));
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TEntry with maxlength (10):'));
     $cell = $row->addCell($field4);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TEntry with completion (a..):'));
     $cell = $row->addCell($field5);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TPassword object:'));
     $cell = $row->addCell($field6);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TDate Object:'));
     $cell = $row->addCell($field7);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('Spinner Object:'));
     $cell = $row->addCell($field8);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('Slider Object:'));
     $cell = $row->addCell($field9);
     // add a row for one field
     $row = $table->addRow();
     $row->addCell(new TLabel('TText Object:'));
     $cell = $row->addCell($field10);
     // creates the action button
     $button1 = new TButton('action1');
     // define the button action
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     // define wich are the form fields
     $this->form->setFields(array($field1, $field2, $field3, $field4, $field5, $field6, $field7, $field8, $field9, $field10, $button1));
     // add a row for the button
     $row = $table->addRow();
     $row->addCell($button1);
     // add the form inside the page
     parent::add($notebook);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_crm');
     // creates a table
     //        $table = new TTable;
     $panel = new TPanel(100, 10);
     // add the notebook inside the form
     $this->form->add($panel);
     $panel->put(new TLabel('CRM Titulo:'), 0, 0);
     // $notebook->appendPage('Cidade', $table_contact);
     //        $notebook->appendPage('Skill (aggregation)', $table_skill);
     // create the form fields
     $code = new TEntry('id');
     //        $crm_id = new TDBCombo('crm_id', 'db_crmbf', 'CRM', 'id', 'titulo');
     $crm_id = new TEntry('crm_nome');
     $tiporegistro_id = new TDBCombo('tiporegistro_id', 'db_crmbf', 'RegistroTipo', 'id', 'nome');
     $registro = new TText('registro');
     $temporegistro = new TEntry('tempo_registro');
     //        $temporegistro->setEditable(false);
     $dataregistro = new TDate('data_registro');
     $hora_registro = new TEntry('hora_registro');
     $numero_registro = new TEntry('numero_registro');
     // add field validators
     $registro->addValidation('Nome', new TRequiredValidator());
     // $cidade_id->addValidation('Cidade', new TRequiredValidator);
     // $birthdate->addValidation('Birthdate', new TRequiredValidator);
     //        $cidade_id->addValidation('Category', new TRequiredValidator);
     //$obj = new CidadeFormList;
     //$cidade_id->setAction(new TAction(array($obj, 'onReload')));
     //        $itemGender = array();
     //        $itemGender['M'] = 'Male';
     //        $itemGender['F'] = 'Female';
     //        // add the combo options
     //        $gender->addItems($itemGender);
     //        $gender->setLayout('horizontal');
     //
     //        $itemStatus = array();
     //        $itemStatus['S'] = 'Single';
     //        $itemStatus['C'] = 'Committed';
     //        $itemStatus['M'] = 'Married';
     //        $status->addItems($itemStatus);
     // define some properties for the form fields
     $code->setEditable(FALSE);
     $code->setSize(100);
     $crm_id->setSize(320);
     $registro->setSize(320);
     $temporegistro->setSize(160);
     //$temporegistro->setValue(date("d/m/Y H:i:s"));
     $tiporegistro_id->setSize(160);
     //$dataregistro->setRange(0,1000,1);
     $dataregistro->setSize(90);
     // $hora_registro->setRange(0,100,1);
     $hora_registro->setSize(150);
     $hora_registro->setTip('Horario EX: 8:14');
     $numero_registro->setSize(320);
     $panel->put("Codigo: ", 10, 25);
     $panel->put("CRM: ", 10, 50);
     $panel->put("Tipo: ", 10, 75);
     $panel->put("Tempo: ", 10, 100);
     $panel->put("Data: ", 10, 125);
     $panel->put("Horario: ", 10, 150);
     $panel->put("Nº Registro: ", 10, 175);
     $panel->put("Registro: ", 10, 200);
     $panel->put($code, 100, 25);
     $panel->put($crm_id, 100, 50);
     $panel->put($tiporegistro_id, 100, 75);
     $panel->put($temporegistro, 100, 100);
     $panel->put($dataregistro, 100, 125);
     $panel->put($hora_registro, 100, 150);
     $panel->put($numero_registro, 100, 175);
     $panel->put($registro, 100, 200);
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Code:'));
     //        $row->addCell($code);
     //
     //        // add a row for the field name
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('CRM Titulo:'));
     //        $cell = $row->addCell($crm_id);
     //
     //        // add a row for the field Telefone
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Tipo Registro:'));
     //        $cell = $row->addCell($tiporegistro_id);
     //
     //        // add a row for the field Email
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Tempo:'));
     //        $cell = $row->addCell($temporegistro);
     //
     //        // add a row for the field celular
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Data:'));
     //        $cell = $row->addCell($dataregistro);
     //
     //        // add a row for the field skype
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Hora:'));
     //        $cell = $row->addCell($hora_registro);
     //
     //        // add a row for the field endereco
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Numero Registro:'));
     //        $row->addCell($numero_registro);
     //
     //        // add a row for the field name
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Registro:'));
     //        $cell = $row->addCell($registro);
     // add a row for the field Category
     //        $row = $table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($cidade_id);
     // add a row for the field city
     //        $row=$table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($cidade_id);
     /*
      // add a row for the field Phone
      $row = $table_data->addRow();
      $row->addCell(new TLabel('Phone:'));
      $row->addCell($phone);
     
      // add a row for the field BirthDate
      $row->addCell(new TLabel('BirthDate:'));
      $row->addCell($birthdate);
     
      // add a row for the field status
      $row = $table_data->addRow();
      $row->addCell(new TLabel('Status:'));
      $cell = $row->addCell($status);
     
      // add a row for the field Email
      $row->addCell(new TLabel('Email:'));
      $cell = $row->addCell($email);
     
      // add a row for the field gender
      $row->addCell(new TLabel('Gender:'));
      $row->addCell($gender);
     
      $row = $table_contact->addRow();
      $cell = $row->addCell(new TLabel('<b>Contact</b>'));
      $cell->valign = 'top';
     
      // add two fields inside the multifield in the second sheet
      $contacts_list->setHeight(100);
      $contacts_list->setClass('Contact'); // define the returning class
      $contacts_list->addField('type', 'Contact Type: ', new TEntry('type'), 200);
      $contacts_list->addField('value', 'Contact Value: ', new TEntry('value'), 200);
      $row = $table_contact->addRow();
      $row->addCell($contacts_list);
     
      // create the radio button for the skills list
      $skill_list = new TDBCheckGroup('skill_list', 'samples', 'Skill', 'id', 'name');
      $table_skill->addRow()->addCell($lbl = new TLabel('Skills'));
      $table_skill->addRow()->addCell($skill_list);
      $lbl->setFontStyle('b');
     
     * 
     */
     // create an action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     $button1->setProperty('width', 150);
     //  create an action button (go to list)
     $button2 = new TButton('list');
     $button2->setAction(new TAction(array('RegistroList', 'onReload')), 'Ir para Listagem');
     $button2->setImage('ico_datagrid.gif');
     $button2->setProperty('width', 100);
     $panel->put($button1, 100, 325);
     $panel->put($button2, 200, 325);
     // define wich are the form fields
     $this->form->setFields(array($code, $crm_id, $registro, $temporegistro, $tiporegistro_id, $dataregistro, $hora_registro, $numero_registro, $button1, $button2));
     //        $subtable = new TTable;
     //        $row = $subtable->addRow();
     //        $row->addCell($button1);
     //        $row->addCell($button2);
     //        $table_layout = new TTable;
     //        $table_layout->addRow()->addCell($this->form);
     //        $table_layout->addRow()->addCell($subtable);
     // add the form inside the page
     parent::add($panel);
     //        parent::add($table_layout);
 }
示例#6
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_crm');
     // creates a table
     $table = new TTable();
     $notebook = new TNotebook(500, 320);
     // add the notebook inside the form
     $this->form->add($notebook);
     $notebook->appendPage('Cadastro Registro CRM', $table);
     // create the form fields
     $code = new TEntry('id');
     $crm_id = new TCombo('crm_id');
     $tiporegistro_id = new TDBCombo('tiporegistro_id', 'db_crmbf', 'RegistroTipo', 'id', 'nome');
     $registro = new TText('registro');
     $temporegistro = new TEntry('tempo_registro');
     //        $temporegistro->setEditable(false);
     $dataregistro = new TDate('data_registro');
     $hora_registro = new TEntry('hora_registro');
     $numero_registro = new TEntry('numero_registro');
     // finaliza a transacao
     TTransaction::close();
     $items1 = array();
     //dados do cliente CRM
     TTransaction::open('db_crmbf');
     $criteria = new TCriteria();
     $criteria->add(new TFilter('cliente_id', '=', $_GET['fk']));
     $repository = new TRepository('CRM');
     $cadastros = $repository->load($criteria);
     //adiciona os objetos no combo
     foreach ($cadastros as $object) {
         $items1[$object->id] = $object->titulo;
     }
     // adiciona as opcoes na combo
     $crm_id->addItems($items1);
     TTransaction::close();
     // add field validators
     $registro->addValidation('Registro deve ser informado', new TRequiredValidator());
     // define some properties for the form fields
     $code->setEditable(FALSE);
     $code->setSize(100);
     $crm_id->setSize(320);
     //        $crm_id->setEditable(FALSE);
     $registro->setSize(320);
     $temporegistro->setSize(160);
     $temporegistro->setValue(date("d/m/Y H:i:s"));
     $tiporegistro_id->setSize(160);
     $dataregistro->setSize(90);
     $hora_registro->setSize(150);
     $hora_registro->setTip('Horario EX: 8:14');
     $numero_registro->setSize(320);
     $row = $table->addRow();
     $row->addCell(new TLabel('Code:'));
     $row->addCell($code);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('CRM Titulo:'));
     $cell = $row->addCell($crm_id);
     // add a row for the field Telefone
     $row = $table->addRow();
     $row->addCell(new TLabel('Tipo Registro:'));
     $cell = $row->addCell($tiporegistro_id);
     // add a row for the field Email
     $row = $table->addRow();
     $row->addCell(new TLabel('Tempo:'));
     $cell = $row->addCell($temporegistro);
     // add a row for the field celular
     $row = $table->addRow();
     $row->addCell(new TLabel('Data:'));
     $cell = $row->addCell($dataregistro);
     // add a row for the field skype
     $row = $table->addRow();
     $row->addCell(new TLabel('Hora:'));
     $cell = $row->addCell($hora_registro);
     // add a row for the field endereco
     $row = $table->addRow();
     $row->addCell(new TLabel('Numero Registro:'));
     $row->addCell($numero_registro);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('Registro:'));
     $cell = $row->addCell($registro);
     // create an action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     // create an action button
     $button2 = new TButton('action3');
     $action2 = new TAction(array('ClienteRegistroDetalhe', 'onEdit'));
     //parametro fk e key da sessao
     $action2->setParameter('fk', TSession::getValue('cliente_fk'));
     $action2->setParameter('key', TSession::getValue('crm_key'));
     $button2->setImage('ico_datagrid.png');
     $button2->setAction($action2, 'Voltar');
     // define wich are the form fields
     $this->form->setFields(array($code, $crm_id, $registro, $temporegistro, $tiporegistro_id, $dataregistro, $hora_registro, $numero_registro, $button1, $button2));
     $subtable = new TTable();
     $row = $subtable->addRow();
     $row->addCell($button1);
     $row->addCell($button2);
     $table_layout = new TTable();
     $table_layout->addRow()->addCell($this->form);
     $table_layout->addRow()->addCell($subtable);
     // add the form inside the page
     parent::add($table_layout);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_clienteRegistro Detalhe');
     // creates a table
     $table = new TTable();
     $panel = new TPanel(480, 260);
     $notebook = new TNotebook(500, 250);
     // add the notebook inside the form
     $this->form->add($notebook);
     // add the notebook inside the form
     $this->form->add($table);
     // create the form fields
     $city_id2 = new TSeekButton('city_id2');
     $city_name2 = new TEntry('city_name2');
     $city_id2->setSize(100);
     $city_name2->setEditable(FALSE);
     //dados do cliente CRM
     TTransaction::open('db_crmbf');
     $criteria = new TCriteria();
     $criteria->add(new TFilter('cliente_id', '=', $_GET['key']));
     //
     $repository = new TRepository('CRM');
     $CRM = $repository->load($criteria);
     foreach ($CRM as $crms) {
         $codigoCRM = $crms->id;
         $tituloCRM = $crms->titulo;
         $projetoCRM = $crms->projeto_nome;
         $dataCRM = $crms->data_crm;
         $tempoCRM = $crms->tempo;
         $porcentagemCRM = $crms->porcentagem;
         $descricaoCRM = $crms->descricao;
         $solicitanteCRM = $crms->solicitante;
         $usuarioalteracaoCRM = $crms->usuarioalteracao;
         $responsavel_nomeCRM = $crms->responsavel_nome;
         $tipo_nomeCRM = $crms->tipo_nome;
         $cliente_nomeCRM = $crms->cliente_nome;
         $prioridade_nomeCRM = $crms->prioridade_nome;
         $status_nomeCRM = $crms->status_nome;
     }
     TTransaction::close();
     $notebook->appendPage('Registros CRMs', $table);
     $code = new TEntry('id');
     $crm_id = new TDBCombo('crm_id', 'db_crmbf', 'CRM', 'id', 'titulo');
     $tiporegistro_id = new TDBCombo('tiporegistro_id', 'db_crmbf', 'RegistroTipo', 'id', 'nome');
     $registro = new TText('registro');
     $temporegistro = new TEntry('tempo_registro');
     //        $temporegistro->setEditable(false);
     $dataregistro = new TDate('data_registro');
     $hora_registro = new TEntry('hora_registro');
     $numero_registro = new TEntry('numero_registro');
     // define some properties for the form fields
     $code->setEditable(FALSE);
     $code->setSize(100);
     $crm_id->setSize(320);
     $crm_id->setEditable(FALSE);
     $registro->setSize(320);
     $temporegistro->setSize(160);
     //$temporegistro->setValue(date("d/m/Y H:i:s"));
     $tiporegistro_id->setSize(160);
     //$dataregistro->setRange(0,1000,1);
     $dataregistro->setSize(90);
     // $hora_registro->setRange(0,100,1);
     $hora_registro->setSize(150);
     $hora_registro->setTip('Horario EX: 8:14');
     $numero_registro->setSize(320);
     $row = $table->addRow();
     $row->addCell(new TLabel('Code:'));
     $row->addCell($code);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('CRM Titulo:'));
     $cell = $row->addCell($crm_id);
     // add a row for the field Telefone
     $row = $table->addRow();
     $row->addCell(new TLabel('Tipo Registro:'));
     $cell = $row->addCell($tiporegistro_id);
     // add a row for the field Email
     $row = $table->addRow();
     $row->addCell(new TLabel('Tempo:'));
     $cell = $row->addCell($temporegistro);
     // add a row for the field celular
     $row = $table->addRow();
     $row->addCell(new TLabel('Data:'));
     $cell = $row->addCell($dataregistro);
     // add a row for the field skype
     $row = $table->addRow();
     $row->addCell(new TLabel('Hora:'));
     $cell = $row->addCell($hora_registro);
     // add a row for the field endereco
     $row = $table->addRow();
     $row->addCell(new TLabel('Numero Registro:'));
     $row->addCell($numero_registro);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('Registro:'));
     $cell = $row->addCell($registro);
     // $notebook->appendPage('Cidade', $table_contact);
     //        $notebook->appendPage('Skill (aggregation)', $table_skill);
     // create the form fields
     //        $code = new TEntry('id');
     //        $nome = new TEntry('nome');
     //        $email = new TEntry('email');
     //        $telefone = new TEntry('telefone');
     //        $celular = new TEntry('celular');
     //        $skype = new TEntry('skype');
     //        $endereco = new TEntry('endereco');
     ////        $cidade_id = new TSeekButton('cidade_id');
     //        $cidade_id = new TDBCombo('cidade_id', 'db_crmbf', 'Cidade', 'id', 'nome');
     //        $birthdate = new TDate('birthdate');
     //        $email = new TEntry('email');
     //        $gender = new TRadioGroup('gender');
     //        $status = new TCombo('status');
     //        $contacts_list = new TMultiField('contacts_list');
     // add field validators
     //        $nome->addValidation('Nome', new TRequiredValidator);
     //        $cidade_id->addValidation('Cidade', new TRequiredValidator);
     // $birthdate->addValidation('Birthdate', new TRequiredValidator);
     //        $cidade_id->addValidation('Category', new TRequiredValidator);
     //$obj = new CidadeFormList;
     //$cidade_id->setAction(new TAction(array($obj, 'onReload')));
     //        $itemGender = array();
     //        $itemGender['M'] = 'Male';
     //        $itemGender['F'] = 'Female';
     //        // add the combo options
     //        $gender->addItems($itemGender);
     //        $gender->setLayout('horizontal');
     //
     //        $itemStatus = array();
     //        $itemStatus['S'] = 'Single';
     //        $itemStatus['C'] = 'Committed';
     //        $itemStatus['M'] = 'Married';
     //        $status->addItems($itemStatus);
     // define some properties for the form fields
     //        $code->setEditable(FALSE);
     //        $code->setSize(100);
     //        $nome->setSize(320);
     //        $email->setSize(160);
     //        $telefone->setSize(160);
     //        $celular->setSize(160);
     //        $skype->setSize(160);
     //        $endereco->setSize(320);
     //        $cidade_id->setSize(150);
     //$cidade_id->setEditable(FALSE);
     // add a row for the field code
     $panel->put("CRM: ", $codigoCRM, 10, 5);
     $panel->put($tituloCRM, 10, 20);
     $panel->put($projetoCRM, 10, 40);
     $panel->put("Data de Criação: " . $dataCRM, 10, 75);
     $panel->put("Aberto por: " . $usuarioalteracaoCRM, 10, 95);
     $panel->put("Cliente: " . $cliente_nomeCRM, 10, 55);
     $panel->put("Responsavel: " . $responsavel_nomeCRM, 10, 110);
     $panel->put("Tipo: " . $tipo_nomeCRM, 10, 130);
     $panel->put("Percentual Conclusão: " . $porcentagemCRM, 10, 140);
     $panel->put("Tempo Gasto: " . $tempoCRM, 10, 160);
     $panel->put("Situação: " . $status_nomeCRM, 10, 180);
     $panel->put("Descrição: " . $descricaoCRM, 10, 200);
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Titulo:'));
     //        $row->addCell($tituloCRM);
     //
     //        // add a row for the field name
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Projeto:'));
     //        $cell = $row->addCell($projetoCRM);
     //        $cell->colspan = 3;
     //
     //        // add a row for the field Email
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('DATA:'));
     //        $cell = $row->addCell($dataCRM);
     //        $cell->colspan = 3;
     //
     //        // add a row for the field Telefone
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Tempo:'));
     //        $cell = $row->addCell($tempoCRM);
     //        $cell->colspan = 3;
     //
     //        // add a row for the field celular
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Porcentagem:'));
     //        $cell = $row->addCell($porcentagemCRM);
     //
     //        // add a row for the field skype
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Solicitação:'));
     //        $cell = $row->addCell($solicitanteCRM);
     //        // add a row for the field endereco
     //        $row = $table_data->addRow();
     //        $row->addCell(new TLabel('Endereço:'));
     //        $row->addCell($endereco);
     //
     //        // add a row for the field endereco
     //        $row = $table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $row->addCell($cidade_id);
     // add a row for the field Category
     //        $row = $table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($cidade_id);
     // add a row for the field city
     //        $row=$table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($cidade_id);
     /*
      // add a row for the field Phone
      $row = $table_data->addRow();
      $row->addCell(new TLabel('Phone:'));
      $row->addCell($phone);
     
      // add a row for the field BirthDate
      $row->addCell(new TLabel('BirthDate:'));
      $row->addCell($birthdate);
     
      // add a row for the field status
      $row = $table_data->addRow();
      $row->addCell(new TLabel('Status:'));
      $cell = $row->addCell($status);
     
      // add a row for the field Email
      $row->addCell(new TLabel('Email:'));
      $cell = $row->addCell($email);
     
      // add a row for the field gender
      $row->addCell(new TLabel('Gender:'));
      $row->addCell($gender);
     
      $row = $table_contact->addRow();
      $cell = $row->addCell(new TLabel('<b>Contact</b>'));
      $cell->valign = 'top';
     
      // add two fields inside the multifield in the second sheet
      $contacts_list->setHeight(100);
      $contacts_list->setClass('Contact'); // define the returning class
      $contacts_list->addField('type', 'Contact Type: ', new TEntry('type'), 200);
      $contacts_list->addField('value', 'Contact Value: ', new TEntry('value'), 200);
      $row = $table_contact->addRow();
      $row->addCell($contacts_list);
     
      // create the radio button for the skills list
      $skill_list = new TDBCheckGroup('skill_list', 'samples', 'Skill', 'id', 'name');
      $table_skill->addRow()->addCell($lbl = new TLabel('Skills'));
      $table_skill->addRow()->addCell($skill_list);
      $lbl->setFontStyle('b');
     
     * 
     */
     // create an action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     // create an action button (go to list)
     $button2 = new TButton('list');
     $button2->setAction(new TAction(array('ClienteList', 'onReload')), 'Ir para Listagem');
     $button2->setImage('ico_datagrid.gif');
     // create an action button
     $button3 = new TButton('action3');
     $action3 = new TAction(array('RegistroForm', 'onEdit'));
     $action3->setParameter('fk', $codigoCRM);
     $button3->setImage('ico_save.png');
     $button3->setAction($action3, 'Inserir Registro');
     // define wich are the form fields
     $this->form->setFields(array($code, $crm_id, $registro, $temporegistro, $tiporegistro_id, $dataregistro, $hora_registro, $numero_registro, $button1, $button2, $button3));
     $subtable = new TTable();
     $row = $subtable->addRow();
     $row->addCell($button1);
     $row->addCell($button2);
     $row->addCell($button3);
     $table_layout = new TTable();
     $table_layout->addRow()->addCell($this->form);
     $table_layout->addRow()->addCell($subtable);
     //         // add a row for the field gender
     //          $row->addCell(new TLabel('Gender:'));
     //          $row->addCell($registroREG);
     //
     //        // add a row for the field Category
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($registroREG);
     // add the form inside the page
     parent::add($panel);
     parent::add($table_layout);
     // creates the form
     $this->form2 = new TForm('form_clienteRegistro Detalhe');
     //dados do cliente CRM
     TTransaction::open('db_crmbf');
     $criteria2 = new TCriteria();
     // $criteria->add(new TFilter('crm_id', '=', $_GET['key']));
     $criteria2->setProperty('order', 'id desc');
     $repository2 = new TRepository('Registro');
     $reg = $repository2->load($criteria2);
     foreach ($reg as $regs) {
         $row = $table->addRow();
         $row->addCell(new TLabel('ID:'));
         $cell = $row->addCell($regs->id);
         $row = $table->addRow();
         $row->addCell(new TLabel('CRM:'));
         $cell = $row->addCell($regs->crm_id);
         $row = $table->addRow();
         $row->addCell(new TLabel('CRM:'));
         $cell = $row->addCell($regs->tiporegistro_id);
         $row = $table->addRow();
         $row->addCell(new TLabel('Tempo:'));
         $cell = $row->addCell($regs->tempo_registro);
         $row = $table->addRow();
         $row->addCell(new TLabel('Data:'));
         $cell = $row->addCell($regs->data_registro);
         $row = $table->addRow();
         $row->addCell(new TLabel('Horario:'));
         $cell = $row->addCell($regs->hora_registro);
         $row = $table->addRow();
         $row->addCell(new TLabel('Numero Registro:'));
         $cell = $row->addCell($regs->numero_registro);
         $row = $table->addRow();
         $row->addCell(new TLabel('Registro:'));
         $cell = $row->addCell($regs->registro);
         $row = $table->addRow();
         $row->addCell(new TLabel(' '));
         $cell = $row->addCell(' ');
         //            $idREG = $regs->id;
         //            $crm_idREG = $regs->crm_id;
         //            $tiporegistro_idREG = $regs->tiporegistro_id;
         //            $tempoREG = $regs->tempo_registro;
         //            $dataREG = $regs->data_registro;
         //            $horaREG = $regs->hora_registro;
         //            $numRegistroREG = $regs->numero_registro;
         //            $registroREG = $regs->registro;
     }
     TTransaction::close();
 }
示例#8
0
 /**
  * constructor method
  */
 public function __construct()
 {
     parent::__construct();
     new TSession();
     // creates the form
     $this->form = new TForm('form_city_Seek');
     // creates the table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('name');
     $code = new TEntry('id');
     $crm_id = new TDBCombo('crm_id', 'db_crmbf', 'CRM', 'id', 'titulo');
     $tiporegistro_id = new TDBCombo('tiporegistro_id', 'db_crmbf', 'RegistroTipo', 'id', 'nome');
     $registro = new TText('registro');
     $temporegistro = new TEntry('tempo_registro');
     //        $temporegistro->setEditable(false);
     $dataregistro = new TDate('data_registro');
     $hora_registro = new TEntry('hora_registro');
     $numero_registro = new TEntry('numero_registro');
     // keep the session value
     //  $name->setValue(TSession::getValue('test_city_name'));
     // add the field inside the table
     //        $row=$table->addRow();
     //        $row->addCell(new TLabel('Name:'));
     //        $row->addCell($name);
     $code->setEditable(FALSE);
     $code->setSize(100);
     $crm_id->setSize(320);
     $registro->setSize(320);
     $temporegistro->setSize(160);
     //$temporegistro->setValue(date("d/m/Y H:i:s"));
     $tiporegistro_id->setSize(160);
     //$dataregistro->setRange(0,1000,1);
     $dataregistro->setSize(90);
     // $hora_registro->setRange(0,100,1);
     $hora_registro->setSize(150);
     $hora_registro->setTip('Horario EX: 8:14');
     $numero_registro->setSize(320);
     $row = $table->addRow();
     $row->addCell(new TLabel('Code:'));
     $row->addCell($code);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('CRM Titulo:'));
     $cell = $row->addCell($crm_id);
     // add a row for the field Telefone
     $row = $table->addRow();
     $row->addCell(new TLabel('Tipo Registro:'));
     $cell = $row->addCell($tiporegistro_id);
     // add a row for the field Email
     $row = $table->addRow();
     $row->addCell(new TLabel('Tempo:'));
     $cell = $row->addCell($temporegistro);
     // add a row for the field celular
     $row = $table->addRow();
     $row->addCell(new TLabel('Data:'));
     $cell = $row->addCell($dataregistro);
     // add a row for the field skype
     $row = $table->addRow();
     $row->addCell(new TLabel('Hora:'));
     $cell = $row->addCell($hora_registro);
     // add a row for the field endereco
     $row = $table->addRow();
     $row->addCell(new TLabel('Numero Registro:'));
     $row->addCell($numero_registro);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('Registro:'));
     $cell = $row->addCell($registro);
     // create a find button
     $find_button = new TButton('search');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Search');
     $find_button->setImage('ico_find.png');
     // add a row for the find button
     $row = $table->addRow();
     $row->addCell($find_button);
     // define wich are the form fields
     $this->form->setFields(array($name, $find_button));
     // create the datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $id = new TDataGridColumn('id', 'Id', 'right', 70);
     $name = new TDataGridColumn('name', 'Name', 'left', 220);
     $state = new TDataGridColumn('state', 'Estado', 'left', 80);
     $order1 = new TAction(array($this, 'onReload'));
     $order2 = new TAction(array($this, 'onReload'));
     $order1->setParameter('order', 'id');
     $order2->setParameter('order', 'name');
     // define the column actions
     $id->setAction($order1);
     $name->setAction($order2);
     // add the columns inside the datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($state);
     // create one datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel('Selecionar');
     $action1->setImage('ico_apply.png');
     $action1->setField('id');
     // add the action to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // create the page navigator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create a table for layout
     $table = new TTable();
     // create a row for the form
     $row = $table->addRow();
     $row->addCell($this->form);
     // create a row for the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // create a row for the page navigator
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }