/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // create the form using TQuickForm class $this->form = new TQuickForm('form_seek_sample'); $this->form->setFormTitle('Seek button'); $this->form->class = 'tform'; // create the form fields $city_id1 = new TSeekButton('city_id1'); $city_name1 = new TEntry('city_name1'); $criteria = new TCriteria(); $criteria->add(new TFilter('id', '>', 1)); $criteria->add(new TFilter('id', '<', 5)); $criteria->setProperty('order', 'name'); // define the action for city_id1 $obj = new TestCitySeek(); $action = new TAction(array($obj, 'onReload')); $city_id1->setAction($action); $city_id1->setSize(100); $city_name1->setEditable(FALSE); $this->form->addQuickFields('Manual SeekButton', array($city_id1, $city_name1)); $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:floppy-o'); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add($this->form); parent::add($vbox); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the notebook $this->notebook = new TNotebook(); $this->notebook->setSize(400, 170); // creates the form $this->form = new TQuickForm('form_account'); $this->notebook->appendPage('Personal details', $this->form); // create the form fields $email = new TEntry('email'); $first_name = new TEntry('first_name'); $last_name = new TEntry('last_name'); $phone = new TEntry('phone'); $email->setEditable(FALSE); // add the fields $this->form->addQuickField('Email: ', $email, 200); $this->form->addQuickField('First name: ', $first_name, 200); $this->form->addQuickField('Last name: ', $last_name, 200); $this->form->addQuickField('Phone: ', $phone, 200); // validations $first_name->addValidation('First name', new TRequiredValidator()); $last_name->addValidation('Last name', new TRequiredValidator()); $phone->addValidation('Phone', new TRequiredValidator()); // add a form action $this->form->addQuickAction('Confirm', new TAction(array($this, 'onConfirm')), 'ico_apply.png'); $this->form->addQuickAction('Back', new TAction(array($this, 'onBackForm')), 'ico_back.png'); // add the form to the page parent::add($this->notebook); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); parent::setDatabase('samples'); // defines the database parent::setActiveRecord('City'); // defines the active record // creates the form $this->form = new TQuickForm('form_City'); $this->form->class = 'tform'; // CSS class $this->form->style = 'width: 500px'; // define the form title $this->form->setFormTitle('Standard Form'); // create the form fields $id = new TEntry('id'); $name = new TEntry('name'); $id->setEditable(FALSE); // add the form fields $this->form->addQuickField('ID', $id, 100); $this->form->addQuickField('Name', $name, 100); // define the form action $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction('New', new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction('Listing', new TAction(array('StandardDataGridView', 'onReload')), 'ico_datagrid.gif'); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // security check if (TSession::getValue('logged') !== TRUE) { throw new Exception(_t('Not logged')); } // security check TTransaction::open('library'); if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'LIBRARIAN') { throw new Exception(_t('Permission denied')); } TTransaction::close(); // defines the database parent::setDatabase('library'); // defines the active record parent::setActiveRecord('Publisher'); // creates the form $this->form = new TQuickForm('form_Publisher'); // create the form fields $id = new TEntry('id'); $name = new TEntry('name'); $id->setEditable(FALSE); // define the sizes $this->form->addQuickField(_t('Code'), $id, 100); $this->form->addQuickField(_t('Name'), $name, 200); // define the form action $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); // add the form to the page parent::add($this->form); }
public function __construct() { parent::__construct(); $this->form = new TQuickForm(); $this->form->class = 'tform'; $this->form->setFormTitle(_t('Profile')); $name = new TEntry('name'); $login = new TEntry('login'); $email = new TEntry('email'); $password1 = new TPassword('password1'); $password2 = new TPassword('password2'); $login->setEditable(FALSE); $this->form->addQuickField(_t('Name'), $name, '80%', new TRequiredValidator()); $this->form->addQuickField(_t('Login'), $login, '80%', new TRequiredValidator()); $this->form->addQuickField(_t('Email'), $email, '80%', new TRequiredValidator()); $table = $this->form->getContainer(); $row = $table->addRow(); $row->style = 'background: #FFFBCB;'; $cell = $row->addCell(new TLabel(_t('Change password') . ' (' . _t('Leave empty to keep old password') . ')')); $cell->colspan = 2; $this->form->addQuickField(_t('Password'), $password1, '80%'); $this->form->addQuickField(_t('Password confirmation'), $password2, '80%'); $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:save'); $bc = new TBreadCrumb(); $bc->addHome(); $bc->addItem('Profile'); $container = TVBox::pack($bc, $this->form); $container->style = 'width:80%'; parent::add($container); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TQuickForm('form_SystemProgram'); $this->form->setFormTitle(_t('Program')); $this->form->class = 'tform'; // CSS class // defines the database parent::setDatabase('permission'); // defines the active record parent::setActiveRecord('SystemProgram'); // create the form fields $id = new TEntry('id'); $name = new TEntry('name'); $controller = new TEntry('controller'); $id->setEditable(false); // add the fields $this->form->addQuickField('ID', $id, 50); $this->form->addQuickField(_t('Name') . ': ', $name, 200); $this->form->addQuickField(_t('Controller') . ': ', $controller, 200); // validations $name->addValidation(_t('Name'), new TRequiredValidator()); $controller->addValidation('Controller', new TRequiredValidator()); // add form actions $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('SystemProgramList', 'onReload')), 'ico_datagrid.png'); $container = new TTable(); $container->style = 'width: 80%'; $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProgramList')); $container->addRow()->addCell($this->form); // add the form to the page parent::add($container); }
function __construct() { parent::__construct(); $this->form = new TQuickForm('form_Contribuinte'); $this->form->setFormTitle('Contribuinte'); $this->form->class = 'tform'; parent::setDatabase('liger'); parent::setActiveRecord('Contribuinte'); $contribuinte_id = new TEntry('contribuinte_id'); $contribuinte_nome = new TEntry('contribuinte_nome'); $contribuinte_tipo = new TCombo('contribuinte_tipo'); $contribuinte_endereco = new TEntry('contribuinte_endereco'); $contribuinte_bairro = new TEntry('contribuinte_bairro'); $contribuinte_cidade = new TEntry('contribuinte_cidade'); $contribuinte_estado = new TDBCombo('tb_estados_uf_id', 'liger', 'Estado', 'uf_id', 'uf_nome'); $contribuinte_cep = new TEntry('contribuinte_cep'); $contribuinte_telefone = new TEntry('contribuinte_telefone'); $contribuinte_cpf = new TEntry('contribuinte_cpf'); $contribuinte_dtnascimento = new TDate('contribuinte_dtnascimento'); $contribuinte_rg = new TEntry('contribuinte_rg'); $contribuinte_cnpj = new TEntry('contribuinte_cnpj'); $contribuinte_inscricaoestadual = new TEntry('contribuinte_inscricaoestadual'); $contribuinte_inscricaomunicipal = new TEntry('contribuinte_inscricaomunicipal'); $contribuinte_regjuceg = new TEntry('contribuinte_regjuceg'); $contribuinte_ramo = new TEntry('contribuinte_ramo'); $contribuinte_codatividade = new TEntry('contribuinte_codatividade'); $contribuinte_numempregados = new TEntry('contribuinte_numempregados'); $contribuinte_inicioatividades = new TDate('contribuinte_inicioatividades'); $tipo = array(1 => "Físico", 2 => "Jurídico"); $contribuinte_id->setEditable(false); $contribuinte_tipo->addItems($tipo); $this->form->addQuickField('ID', $contribuinte_id, 100); $this->form->addQuickField('Nome/Razão Social', $contribuinte_nome, 400); $this->form->addQuickField('Tipo', $contribuinte_tipo, 200); $this->form->addQuickField('Endereço', $contribuinte_endereco, 400); $this->form->addQuickField('Bairro', $contribuinte_bairro, 200); $this->form->addQuickField('Cidade', $contribuinte_cidade, 200); $this->form->addQuickField('Estado', $contribuinte_estado, 200); $this->form->addQuickField('CEP', $contribuinte_cep, 200); $this->form->addQuickField('Telefone', $contribuinte_telefone, 200); $this->form->addQuickField('CPF', $contribuinte_cpf, 200); $this->form->addQuickField('Data de Nascimento', $contribuinte_dtnascimento, 200); $this->form->addQuickField('RG', $contribuinte_rg, 200); $this->form->addQuickField('CNPJ', $contribuinte_cnpj, 200); $this->form->addQuickField('Inscrição Municipal', $contribuinte_inscricaomunicipal, 200); $this->form->addQuickField('Inscrição Estadual', $contribuinte_inscricaoestadual, 200); $this->form->addQuickField('Registro JUCEG', $contribuinte_regjuceg, 200); $this->form->addQuickField('Ramo', $contribuinte_ramo, 200); $this->form->addQuickField('Código de Atividade', $contribuinte_codatividade, 200); $this->form->addQuickField('Nº de Empregados', $contribuinte_numempregados, 200); $this->form->addQuickField('Início das Atividades', $contribuinte_inicioatividades, 200); $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('ContribuinteList', 'onReload')), 'ico_datagrid.png'); $container = new TTable(); $container->style = 'width: 80%'; $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'ContribuinteList')); $container->addRow()->addCell($this->form); parent::add($container); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // create the form using TQuickForm class $this->form = new BootstrapFormWrapper(new TQuickForm()); $this->form->setFormTitle('cadastroTarefas'); // create the form fields $id = new TEntry('id'); $id->setEditable(FALSE); $description = new TEntry('titulo'); $list = new TCombo('prioridade'); $text = new TText('descricao'); $combo_items = array(); $combo_items['1'] = 'Baixa'; $combo_items['2'] = 'Media'; $combo_items['3'] = 'Alta'; $list->addItems($combo_items); // add the fields inside the form $this->form->addQuickField('Id', $id, 40); $this->form->addQuickField('Título', $description, 250); $this->form->addQuickField('Descrição', $text, 120); $this->form->addQuickField('Prioridade', $list, 120); $text->setSize(250, 50); // define the form action $btn = $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:save'); $btn->class = 'btn btn-success'; $panel = new TPanelGroup('Cadastro de taredas'); $panel->add($this->form); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add($panel); parent::add($vbox); }
/** * Class constructor * Cria da página e o formulário de registro */ function __construct() { parent::__construct(); // cria o formulário $this->form = new TQuickForm('form_Funcionalidade'); $this->form->setFormTitle('Cadastro de Funcionalidades'); $this->form->class = 'tform'; // CSS class // Cria os campos do formulário $id = new TEntry('id'); $nome = new TEntry('nome'); $classe = new TEntry('classe'); $id->setEditable(false); // Adiciona os campos ao formulário $this->form->addQuickField('Código:', $id, 50); $this->form->addQuickField('Nome: ', $nome, 500); $this->form->addQuickField('Classe de controle: ', $classe, 500); // Validadores $nome->addValidation('Nome', new TRequiredValidator()); $classe->addValidation('Classe de controle', new TRequiredValidator()); // Adiciona as ações do formulário $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction('Voltar para a listagem', new TAction(array('FuncionalidadeList', 'onReload')), 'ico_datagrid.png'); $container = new TTable(); $container->style = 'width: 80%'; $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'FuncionalidadeList')); $container->addRow()->addCell($this->form); // Adiciona o formulário a pagina parent::add($container); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TQuickForm('form_Bairro'); $this->form->setFormTitle('Bairro'); $this->form->class = 'tform'; // CSS class // defines the database parent::setDatabase('liger'); // defines the active record parent::setActiveRecord('Bairro'); // create the form fields $bairros_id = new TEntry('bairros_id'); $bairros_nome = new TEntry('bairros_nome'); $tb_cidades_cid_id = new TDBCombo('tb_cidades_cid_id', 'liger', 'Cidade', 'cid_id', 'cid_nome'); $bairros_id->setEditable(false); // add the fields $this->form->addQuickField('ID', $bairros_id, 50); $this->form->addQuickField('Bairro: ', $bairros_nome, 200); $this->form->addQuickField('Cidade: ', $tb_cidades_cid_id, 200); // add form actions $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('BairroList', 'onReload')), 'ico_datagrid.png'); $container = new TTable(); $container->style = 'width: 80%'; $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'BairroList')); $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 table container $table = new TTable(); $table->style = 'width:100%'; // creates the form $this->form = new TForm('form_System_Provider'); $this->form->class = 'tform'; // add the notebook inside the form $this->form->add($table); $row1 = $table->addRow(); $row1->class = 'tformtitle'; $cell1 = $row1->addCell(new TLabel('Add new provider'), ''); $cell1->colspan = 2; // create the form fields $id = new TEntry('id'); $nif = new TEntry('nif'); $name = new TEntry('name'); $id->setEditable(false); // define the sizes $id->setSize(100); $nif->setSize(300); $name->setSize(300); // validations $nif->addValidation('nif', new TRequiredValidator()); $name->addValidation('name', new TRequiredValidator()); // add a row for the field id $table->addRowSet(new TLabel('ID:'), $id); $table->addRowSet(new TLabel('NIF: '), $nif); $table->addRowSet(new TLabel('Name: '), $name); // 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('SystemProvidersList', 'onReload')), _t('Back to the listing')); $list_button->setImage('fa:table blue'); // define the form fields $this->form->setFields(array($id, $nif, $name, $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', 'SystemProvidersList')); $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_City'); $this->form->class = 'tform'; // CSS class $this->form->style = 'width: 500px'; // creates a table $table = new TTable(); $table->width = '100%'; $table_buttons = new TTable(); // add the table inside the form $this->form->add($table); // create the form fields $id = new TEntry('id'); $name = new TEntry('name'); // define the sizes $id->setSize(100); $name->setSize(100); $id->setEditable(FALSE); // define the form title $row = $table->addRow(); $row->class = 'tformtitle'; $cell = $row->addCell(new TLabel('Manual form')); $cell->colspan = 2; // add the form fields $table->addRowSet(new TLabel('ID:'), $id); $table->addRowSet(new TLabel('Name:'), $name); // create an action button (save) $save_button = new TButton('save'); $save_button->setAction(new TAction(array($this, 'onSave')), 'Save'); $save_button->setImage('ico_save.png'); // create an action button (new) $new_button = new TButton('new'); $new_button->setAction(new TAction(array($this, 'onEdit')), 'New'); $new_button->setImage('ico_new.png'); // create an action button (go to list) $goto_button = new TButton('list'); $goto_button->setAction(new TAction(array('CompleteDataGridView', 'onReload')), 'Listing'); $goto_button->setImage('ico_datagrid.gif'); // add a row for the form action $row = $table_buttons->addRow(); $row->addCell($save_button); $row->addCell($new_button); $row->addCell($goto_button); // add a row for the form action $row = $table->addRow(); $row->class = 'tformaction'; $cell = $row->addCell($table_buttons); $cell->colspan = 2; // define wich are the form fields $this->form->setFields(array($id, $name, $save_button, $new_button, $goto_button)); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // security check if (TSession::getValue('logged') !== TRUE) { throw new Exception(_t('Not logged')); } // security check TTransaction::open('library'); if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'LIBRARIAN') { throw new Exception(_t('Permission denied')); } TTransaction::close(); // defines the database parent::setDatabase('library'); // defines the active record parent::setActiveRecord('Classification'); // creates the form $this->form = new TQuickForm('form_Classification'); // create the form fields $id = new TEntry('id'); $description = new TEntry('description'); $id->setEditable(FALSE); // define the sizes $this->form->addQuickField(_t('Code'), $id, 100); $this->form->addQuickField(_t('Description'), $description, 200); // define the form action $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); // creates a DataGrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // creates the datagrid columns $this->datagrid->addQuickColumn(_t('Code'), 'id', 'left', 100, new TAction(array($this, 'onReload')), array('order', 'id')); $this->datagrid->addQuickColumn(_t('Description'), 'description', 'left', 200, new TAction(array($this, 'onReload')), array('order', 'description')); // add the actions to the datagrid $this->datagrid->addQuickAction(_t('Edit'), new TDataGridAction(array($this, 'onEdit')), 'id', 'ico_edit.png'); $this->datagrid->addQuickAction(_t('Delete'), new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png'); // create the datagrid model $this->datagrid->createModel(); // creates the page navigation $this->pageNavigation = new TPageNavigation(); $this->pageNavigation->setAction(new TAction(array($this, 'onReload'))); $this->pageNavigation->setWidth($this->datagrid->getWidth()); // creates the page structure using a table $table = new TTable(); // add a row to the form $row = $table->addRow(); $row->addCell($this->form); // add a row to the datagrid $row = $table->addRow(); $row->addCell($this->datagrid); // add a row for page navigation $row = $table->addRow(); $row->addCell($this->pageNavigation); // add the table inside the page parent::add($table); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); parent::setDatabase("app"); parent::setActiveRecord("TipoMaterialPermanente"); parent::setDefaultOrder("nome", "asc"); // creates the form $this->form = new TQuickForm('form_TipoMaterialPermanente'); $this->form->class = 'tform'; // CSS class $this->form->setFormTitle('Tipo de material permanente'); // define the form title // // create the form fields $id = new TEntry('id'); $id->setEditable(false); $nome = new TEntry('nome'); $nome->addValidation('Tipo do material permanente', new TRequiredValidator()); $custo = new TEntry('custo'); $custo->addValidation('Custo', new TRequiredValidator()); $custo->addValidation('Custo unitário', new TNumericValidator()); // add the fields $this->form->addQuickField('#', $id, 50); $this->form->addQuickField('Tipo de material permanente', $nome, 400); $this->form->addQuickField('Custo unitário', $custo, 100); // create the form actions $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction('Relatório', new TAction(array($this, 'onReport')), 'ico_print.png'); // creates a DataGrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // creates the datagrid columns $id = $this->datagrid->addQuickColumn('#', 'id', 'left', 50); $nome = $this->datagrid->addQuickColumn('Tipo de material permanente', 'nome', 'left', 600); $custo = $this->datagrid->addQuickColumn('Custo unitário', 'custo', 'right', 100); // create the datagrid actions $edit_action = new TDataGridAction(array($this, 'onEdit')); $delete_action = new TDataGridAction(array($this, 'onDelete')); // add the actions to the datagrid $this->datagrid->addQuickAction(_t('Edit'), $edit_action, 'id', 'ico_edit.png'); $this->datagrid->addQuickAction(_t('Delete'), $delete_action, 'id', 'ico_delete.png'); // create the datagrid model $this->datagrid->createModel(); // creates the page navigation $this->pageNavigation = new TPageNavigation(); $this->pageNavigation->setAction(new TAction(array($this, 'onReload'))); $this->pageNavigation->setWidth($this->datagrid->getWidth()); // create the datagrid model $this->datagrid->createModel(); // creates the page navigation $this->pageNavigation = new TPageNavigation(); $this->pageNavigation->setAction(new TAction(array($this, 'onReload'))); $this->pageNavigation->setWidth($this->datagrid->getWidth()); // create the page container $container = TVBox::pack($this->form, $this->datagrid, $this->pageNavigation); parent::add($container); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // security check if (TSession::getValue('logged') !== TRUE) { throw new Exception(_t('Not logged')); } // security check TTransaction::open('changeman'); if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR' and Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'MANAGER') { throw new Exception(_t('Permission denied')); } TTransaction::close(); // creates a table $table = new TTable(); // creates the form $this->form = new TForm('form_Document'); $this->form->add($this->notebook); $this->form->class = 'tform'; $this->form->add($table); $table->addRowSet(new TLabel(_t('Document')), '')->class = 'tformtitle'; // create the form fields $id = new TEntry('id'); $id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description'); $title = new TEntry('title'); $content = new THtmlEditor('content'); $id->setEditable(FALSE); // define the sizes $id->setSize(100); $id_project->setSize(200); $title->setSize(200, 40); $content->setSize(680, 350); $table->addRowSet(new TLabel('ID:'), $id); $table->addRowSet(new TLabel(_t('Project') . ': '), $id_project); $table->addRowSet(new TLabel(_t('Title') . ': '), $title); $hbox = new THBox(); $hbox->style = 'margin: 10px'; $hbox->add($content); $row = $table->addRow(); $row->addCell($lbl = new TLabel(_t('Content') . ': ')); $lbl->setFontStyle('b'); $row = $table->addRow(); $cell = $row->addCell($hbox); $cell->colspan = 3; // create an action button (save) $save_button = new TButton('save'); // define the button action $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save')); $save_button->setImage('ico_save.png'); // define wich are the form fields $this->form->setFields(array($id, $id_project, $title, $content, $save_button)); $table->addRowSet($save_button, '')->class = 'tformaction'; $container = new TTable(); $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(); // security check if (TSession::getValue('logged') !== TRUE) { throw new Exception(_t('Not logged')); } // creates a table $table = new TTable(); $this->notebook = new TNotebook(); $this->notebook->setSize(600, 350); $this->notebook->appendPage(_t('Data'), $table); // creates the form $this->form = new TForm('form_Release'); $this->form->add($this->notebook); $options = array('Y' => _t('Yes'), 'N' => _t('No')); // create the form fields $id = new TEntry('id'); $id_project = new TEntry('project'); $name = new TEntry('name'); $description = new THtmlEditor('description'); $id->setEditable(FALSE); $id_project->setEditable(FALSE); $name->setEditable(FALSE); $description->setEditable(FALSE); // define the sizes $id->setSize(100); $id_project->setSize(200); $name->setSize(200, 40); $description->setSize(530, 200); // add a row for the field id $row = $table->addRow(); $row->addCell(new TLabel('ID:')); $row->addCell($id); // add a row for the field id_project $row = $table->addRow(); $row->addCell(new TLabel(_t('Project') . ': ')); $row->addCell($id_project); // add a row for the field name $row = $table->addRow(); $row->addCell(new TLabel(_t('Name') . ': ')); $row->addCell($name); // add a row for the field description $row = $table->addRow(); $row->addCell($lbl = new TLabel(_t('Description') . ': ')); $lbl->setFontStyle('b'); $row = $table->addRow(); $cell = $row->addCell($description); $cell->colspan = 3; // define wich are the form fields $this->form->setFields(array($id, $id_project, $name, $description)); $container = new TTable(); $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(); // security check if (TSession::getValue('logged') !== TRUE) { throw new Exception(_t('Not logged')); } // security check TTransaction::open('changeman'); if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR') { throw new Exception(_t('Permission denied')); } TTransaction::close(); // defines the database parent::setDatabase('changeman'); // defines the active record parent::setActiveRecord('Priority'); // creates the form $this->form = new TQuickForm('form_Priority'); $this->form->class = 'tform'; $this->form->style = 'width: 600px'; $this->form->setFormTitle(_t('Priority')); // create the form fields $id = new TEntry('id'); $description = new TEntry('description'); $id->setEditable(FALSE); // define the sizes $this->form->addQuickField('ID', $id, 100); $this->form->addQuickField(_t('Description') . ': ', $description, 200); // define the form action $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); // creates a DataGrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // creates the datagrid columns $this->datagrid->addQuickColumn('ID', 'id', 'left', 100, new TAction(array($this, 'onReload')), array('order', 'id')); $this->datagrid->addQuickColumn(_t('Description'), 'description', 'left', 440, new TAction(array($this, 'onReload')), array('order', 'description')); // add the actions to the datagrid $this->datagrid->addQuickAction(_t('Edit'), new TDataGridAction(array($this, 'onEdit')), 'id', 'ico_edit.png'); $this->datagrid->addQuickAction(_t('Delete'), new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png'); // create the datagrid model $this->datagrid->createModel(); // creates the page navigation $this->pageNavigation = new TPageNavigation(); $this->pageNavigation->setAction(new TAction(array($this, 'onReload'))); $this->pageNavigation->setWidth($this->datagrid->getWidth()); // creates the page structure using a vbox $container = new TVBox(); $container->add($this->form); $container->add($this->datagrid); $container->add($this->pageNavigation); // add the container inside the page parent::add($container); }
function __construct() { parent::__construct(); // instancia o formulário $this->form = new TForm(); $this->form->setName('form_livros'); // instancia o painél $panel = new TPanel(400, 300); $this->form->add($panel); // coloca o campo id no formulário $panel->put(new TLabel('ID'), 10, 10); $panel->put($id = new TEntry('id'), 100, 10); $id->setSize(100); $id->setEditable(FALSE); // coloca a imagem de um livro $panel->put(new TImage('book.png'), 320, 20); // coloca o campo título no formulário $panel->put(new TLabel('Título'), 10, 40); $panel->put($titulo = new TEntry('titulo'), 100, 40); // coloca o campo autor no formulário $panel->put(new TLabel('Autor'), 10, 70); $panel->put($autor = new TEntry('autor'), 100, 70); // coloca o campo tema no formulário $panel->put(new TLabel('Tema'), 10, 100); $panel->put($tema = new TCombo('tema'), 100, 100); // cria um vetor com as opções da combo tema $items = array(); $items['1'] = 'Administração'; $items['2'] = 'Informática'; $items['3'] = 'Economia'; $items['4'] = 'Matemática'; // adiciona os itens na combo $tema->addItems($items); // coloca o campo editora no formulário $editora = new TEntry('editora'); $panel->put(new TLabel('Editora'), 10, 130); $panel->put($editora, 100, 130); // coloca o campo ano no formulário $panel->put(new TLabel('Ano'), 210, 130); $panel->put($ano = new TEntry('ano'), 260, 130); $editora->setSize(100); $ano->setSize(40); // coloca o campo resumo no formulário $panel->put(new TLabel('Resumo'), 10, 160); $panel->put($resumo = new TText('resumo'), 100, 160); // cria uma ação $panel->put($acao = new TButton('action1'), 320, 240); $acao->setAction(new TAction(array($this, 'onSave')), 'Salvar'); // define quais são os campos do formulário $this->form->setFields(array($id, $titulo, $autor, $tema, $editora, $ano, $resumo, $acao)); 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_Customer_Report'); $this->form->class = 'tform'; // CSS class // creates a table $table = new TTable(); $table->width = '100%'; // add the table inside the form $this->form->add($table); // create the form fields $name = new TEntry('name'); $city_id = new TDBSeekButton('city_id', 'samples', 'form_Customer_Report', 'City', 'name', 'city_id', 'city_name'); $city_name = new TEntry('city_name'); $category_id = new TDBCombo('category_id', 'samples', 'Category', 'id', 'name'); $output_type = new TRadioGroup('output_type'); $options = array('html' => 'HTML', 'pdf' => 'PDF', 'rtf' => 'RTF'); $output_type->addItems($options); $output_type->setValue('pdf'); $output_type->setLayout('horizontal'); // define the sizes $name->setSize(200); $city_id->setSize(100); $category_id->setSize(100); $city_name->setEditable(FALSE); // add a row for the field name $row = $table->addRowSet(new TLabel('Report filters'), ''); $row->class = 'tformtitle'; // CSS class // add the fields into the table $table->addRowSet(new TLabel('Name' . ': '), $name); $table->addRowSet(new TLabel('City' . ': '), array($city_id, $city_name)); $table->addRowSet(new TLabel('Category' . ': '), $category_id); $table->addRowSet(new TLabel('Output' . ': '), $output_type); // create an action button (save) $save_button = new TButton('generate'); $save_button->setAction(new TAction(array($this, 'onGenerate')), 'Generate'); $save_button->setImage('ico_save.png'); // add a row for the form action $row = $table->addRowSet($save_button, ''); $row->class = 'tformaction'; // define wich are the form fields $this->form->setFields(array($name, $city_id, $city_name, $category_id, $output_type, $save_button)); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); parent::setDatabase('app'); // defines the database parent::setActiveRecord('Ajuda'); // defines the active record parent::setDefaultOrder('id', 'asc'); // defines the default order // creates the form $this->form = new TQuickForm('form_Ajuda'); $this->form->class = 'tform'; // CSS class $this->form->setFormTitle('Ajuda'); // define the form title // create the form fields $id = new TEntry('id'); $id->setEditable(false); $titulo = new TEntry('titulo'); $texto = new THtmlEditor('texto'); // add the fields $this->form->addQuickField('id', $id, 100); $this->form->addQuickField('titulo', $titulo, 700); $this->form->addQuickField('texto', $texto, 700); $texto->setSize(700, 300); // create the form actions $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); // creates a DataGrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // creates the datagrid columns $id = $this->datagrid->addQuickColumn('#', 'id', 'left', 100); $texto = $this->datagrid->addQuickColumn('Ajuda', 'titulo', 'left', 640); // create the datagrid actions $edit_action = new TDataGridAction(array($this, 'onEdit')); $delete_action = new TDataGridAction(array($this, 'onDelete')); // add the actions to the datagrid $this->datagrid->addQuickAction(_t('Edit'), $edit_action, 'id', 'ico_edit.png'); $this->datagrid->addQuickAction(_t('Delete'), $delete_action, 'id', 'ico_delete.png'); // create the datagrid model $this->datagrid->createModel(); // creates the page navigation $this->pageNavigation = new TPageNavigation(); $this->pageNavigation->setAction(new TAction(array($this, 'onReload'))); $this->pageNavigation->setWidth($this->datagrid->getWidth()); // create the page container $container = TVBox::pack($this->datagrid, $this->pageNavigation, $this->form); parent::add($container); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // create the form using TQuickForm class $this->form = new TQuickForm(); $this->form->class = 'tform'; $this->form->setFormTitle('Informações Pessoais'); // create the form fields $id = new TEntry('id'); $nome = new TEntry('name'); $email = new TEntry('email'); $telefone = new TEntry('phone'); $usuario = new TEntry('login'); $date = new TDate('date'); $cep = new TEntry('cep'); $senha = new TPassword('password'); $cSenha = new TPassword('rpassword'); $telefone->setMask('(99)99999-9999'); $cep->setMask('99.999-999'); //$id->setValue(TSession::getValue('id')); //$usuario->setValue (TSession::getValue('login')); $id->setEditable(FALSE); //Adcionando validaões $nome->addValidation("name", new TRequiredValidator()); $email->addValidation("email", new TEmailValidator()); $telefone->addValidation("telefone", new TRequiredValidator()); $usuario->addValidation("login", new TRequiredValidator()); $date->addValidation("date", new TRequiredValidator()); $senha->addValidation("passsword", new TRequiredValidator()); $cSenha->addValidation("rpasssword", new TRequiredValidator()); // add the fields inside the form $this->form->addQuickField('Código', $id, 80); $this->form->addQuickField('Nome', $nome, 700); $this->form->addQuickField('Usuario', $usuario, 350); $this->form->addQuickField('Nova senha ', $senha, 200); $this->form->addQuickField('Confirma senha', $cSenha, 200); $this->form->addQuickField('E-mail', $email, 280); $this->form->addQuickField('Telefone', $telefone, 180); $this->form->addQuickField('CEP', $cep, 180); $this->form->addQuickField('Data De nascimento', $date, 180); // define the form action $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png'); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->style = "width:100%"; $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
/** * Shows the widget */ public function show() { $tag = new TEntry($this->name); $tag->setEditable(FALSE); $tag->setProperty('id', $this->name); $tag->setSize(40); $tag->setProperty('onchange', "aux = document.getElementsByName('{$this->text_name}'); aux[0].value = this.value;"); $tag->show(); // define the tag properties $this->tag->name = $this->text_name; $this->tag->onchange = "entry = document.getElementById('{$this->name}'); entry.value = this.value;"; $this->tag->style = "width:{$this->size}px;"; // tamanho em pixels // creates an empty <option> tag $option = new TElement('option'); $option->add(''); $option->value = '0'; // valor da TAG // add the option tag to the combo $this->tag->add($option); if ($this->items) { // iterate the combobox items foreach ($this->items as $chave => $item) { // creates an <option> tag $option = new TElement('option'); $option->value = $chave; // define the index $option->add($item); // add the item label // verify if this option is selected if ($chave == $this->value) { // mark as selected $option->selected = 1; } // add the option to the combo $this->tag->add($option); } } // verify whether the widget is editable if (!parent::getEditable()) { // make the widget read-only $this->tag->readonly = "1"; $this->tag->{'class'} = 'tfield_disabled'; // CSS } // shows the combobox $this->tag->show(); }
function __construct() { parent::__construct(); //Instancia um novo Formulario $this->form = new TForm('livroForm'); //Isntancia o Painel $painel = new TPanel('400', '300'); $this->form->add($painel); //Coloca o campo ID no Formulario $painel->put(new TLabel('ID'), '10', '10'); $painel->put($id = new TEntry('id'), '100', '10'); $id->setSize('100'); $id->setEditable(false); //Coloca o campo titulo no formulario $painel->put(new TLabel('Titulo'), '10', '40'); $painel->put($titulo = new TEntry('titulo'), '100', '40'); //Coloca o campo autor no formulario $painel->put(new TLabel('Autor'), '10', '70'); $painel->put($autor = new TEntry('autor'), '100', '70'); //coloca o campo tema no formulario $painel->put(new TLabel('Tema'), '10', '100'); $painel->put($tema = new TCombo('tema'), '100', '100'); //Cria um vetor com as opções da Combo Tema $itens = array(); $itens['1'] = 'Administração'; $itens['2'] = 'Matematica'; $itens['3'] = 'Informatica'; //Adiciona os na Combo $tema->addItems($itens); //Coloca o campo editora no formulario $painel->put(new TLabel('Editora'), '10', '130'); $painel->put($editora = new TEntry('editora'), '100', '130'); $editora->setSize('100'); //Coloca o campo ano no formulario $painel->put(new TLabel('Ano'), '210', '130'); $painel->put($ano = new TEntry('ano'), '260', '130'); $ano->setSize('40'); //coloca o campo resumo no formulario $painel->put(new TLabel('Remuno'), '10', '160'); $painel->put($resumo = new TText('resumo'), '100', '160'); //Cria uma Ação $painel->put($acao = new TButton('action'), '320', '240'); $acao->setAction(new TAction(array($this, 'onSave')), 'Salvar'); //Define quais são os Campos do Formulario $this->form->setFields(array($id, $titulo, $autor, $tema, $editora, $ano, $resumo, $acao)); parent::add($this->form); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TQuickForm('form_Servidor'); $this->form->setFormTitle('Servidores'); $this->form->class = 'tform'; // CSS class // defines the database parent::setDatabase('lacenrh'); // defines the active record parent::setActiveRecord('Servidor'); // create the form fields $id = new TEntry('id'); $identificacao = new TEntry('identificacao'); $servidor = new TEntry('servidor'); $unidade = new TRadioGroup('unidade'); $id->setEditable(false); //create the combo Unidade $itemUnidade = array(); $itemUnidade['XV'] = ' Alto da XV '; $itemUnidade['GT'] = ' Guatupê'; // add the combo options $unidade->addItems($itemUnidade); //$unidade->setLayout('horizontal'); // add the fields $this->form->addQuickField('ID', $id, 50); $this->form->addQuickField('Identificação', $identificacao, 150); $this->form->addQuickField('Nome do Servidor', $servidor, 200); $this->form->addQuickField('Unidade', $unidade, 200); // validations $identificacao->addValidation('Identificação', new TRequiredValidator()); $servidor->addValidation('Nome', new TRequiredValidator()); $unidade->addValidation('Unidade', new TRequiredValidator()); // add form actions $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:floppy-o fa-lg'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'fa:plus-square green fa-lg'); $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('ServidorList', 'onReload')), 'fa:table blue fa-lg'); $container = new TTable(); $container->style = 'width: 80%'; $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'ServidorList')); $container->addRow()->addCell($this->form); // add the form to the page parent::add($container); }
function __construct() { parent::__construct(); // creates the form $this->form = new TQuickForm('form_Product'); $this->form->class = 'tform'; // CSS class $this->form->style = 'width: 650px;'; // defines the form title $this->form->setFormTitle('Product'); // define the database and the Active Record parent::setDatabase('samples'); parent::setActiveRecord('Product'); // units $units = array('PC' => 'Pieces', 'GR' => 'Grain'); // create the form fields $id = new TEntry('id'); $description = new TEntry('description'); $stock = new TEntry('stock'); $sale_price = new TEntry('sale_price'); $unity = new TCombo('unity'); $photo_path = new TFile('photo_path'); $id->setEditable(FALSE); $unity->addItems($units); $stock->setNumericMask(2, ',', '.', TRUE); // TRUE: process mask when editing and saving $sale_price->setNumericMask(2, ',', '.', TRUE); // TRUE: process mask when editing and saving // add the form fields $this->form->addQuickField('ID', $id, 200); $this->form->addQuickField('Description', $description, 200, new TRequiredValidator()); $this->form->addQuickField('Stock', $stock, 200, new TRequiredValidator()); $this->form->addQuickField('Sale Price', $sale_price, 200, new TRequiredValidator()); $this->form->addQuickField('Unity', $unity, 200, new TRequiredValidator()); $this->form->addQuickField('Photo Path', $photo_path, 200); $photo_path->setSize(200, 40); // add the actions $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction(_t('Back'), new TAction(array('ProductList', 'onReload')), 'ico_back.png'); $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', 'ProductList')); $vbox->add($this->form); parent::add($vbox); }
function __construct() { parent::__construct('form_conclui_venda'); // instancia uma tabela $table = new TTable(); // adiciona a tabela ao formulário parent::add($table); // cria os campos do formulário $cliente = new TEntry('id_cliente'); $desconto = new TEntry('desconto'); $valor_total = new TEntry('valor_total'); $valor_pago = new TEntry('valor_pago'); // define alguns atributos para os campos do formulário $valor_total->setEditable(FALSE); $cliente->setSize(100); $desconto->setSize(100); $valor_total->setSize(100); $valor_pago->setSize(100); // adiciona uma linha para o campo cliente $row = $table->addRow(); $row->addCell(new TLabel('Cliente:')); $row->addCell($cliente); // adiciona uma linha para o campo desconto $row = $table->addRow(); $row->addCell(new TLabel('Desconto:')); $row->addCell($desconto); // adiciona uma linha para o campo valor total $row = $table->addRow(); $row->addCell(new TLabel('Valor Total:')); $row->addCell($valor_total); // adiciona uma linha para o campo valor pago $row = $table->addRow(); $row->addCell(new TLabel('Valor Pago:')); $row->addCell($valor_pago); // cria um botão de ação para o formulário $this->button = new TButton('action1'); // adiciona uma linha para as ações do formulário $row = $table->addRow(); $row->addCell(''); $row->addCell($this->button); // define quais são os campos do formulário parent::setFields(array($cliente, $desconto, $valor_total, $valor_pago, $this->button)); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // security check if (TSession::getValue('logged') !== TRUE) { throw new Exception(_t('Not logged')); } // security check TTransaction::open('library'); if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'ADMINISTRATOR') { throw new Exception(_t('Permission denied')); } TTransaction::close(); // defines the database parent::setDatabase('library'); // defines the active record parent::setActiveRecord('User'); // creates the form $this->form = new TQuickForm('form_Project'); $this->form->class = 'tform'; $this->form->setFormTitle(_t('Users')); $this->form->style = 'width: 500px'; // create the form fields $id = new TEntry('id'); $login = new TEntry('login'); $name = new TEntry('name'); $password = new TPassword('password'); $id_role = new TDBCombo('id_role', 'library', 'Role', 'id', 'description'); $id->setEditable(FALSE); // define the sizes $this->form->addQuickField(_t('Code'), $id, 100); $this->form->addQuickField('Login', $login, 200); $this->form->addQuickField(_t('Name'), $name, 200); $this->form->addQuickField(_t('Password'), $password, 200); $this->form->addQuickField(_t('Role'), $id_role, 200); // define the form action $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); $vbox = new TVBox(); $vbox->add($this->form); // add the form to the page parent::add($vbox); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TQuickForm('form_Content'); $this->form->class = 'tform'; $this->form->style = 'width: 640px'; $this->form->setFormTitle(_t('Content')); // defines the database parent::setDatabase('blog'); // defines the active record parent::setActiveRecord('Content'); // create the form fields $id = new TEntry('id'); $title = new TEntry('title'); $subtitle = new TText('subtitle'); $sidepanel = new THtmlEditor('sidepanel'); $id->setEditable(FALSE); // add the fields $this->form->addQuickField('ID', $id, 100); $this->form->addQuickField(_t('Title'), $title, 500); $this->form->addQuickField(_t('Subtitle'), $subtitle, 400); $row = $this->form->getContainer()->addRow(); $row->addCell($lbl = new TLabel(_t('Side panel'))); $lbl->setFontStyle('b'); $sidepanel->style = 'margin: 10px'; $row = $this->form->getContainer()->addRow(); $row->addCell($sidepanel)->colspan = 2; $this->form->addField($sidepanel); $subtitle->setSize(500, 40); $sidepanel->setSize(590, 200); // define the form action $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png'); TTransaction::open('blog'); $content = new Content(); if ($content->load(1)) { $this->onEdit(array('key' => 1)); } TTransaction::close(); // add the form to the page parent::add($this->form); }
/** * Class constructor * Creates the page */ public function __construct() { parent::__construct(); // creates the customer form and add a table inside it $this->form = new TQuickForm('form'); $this->form->class = 'tform'; $this->form->setFormTitle('Customer'); // create the form fields $customer_id = new TDBSeekButton('customer_id', 'samples', 'form', 'Customer', 'name', 'customer_id', 'customer_name'); $customer_name = new TEntry('customer_name'); $this->form->addQuickFields('Customer', array($customer_id, $customer_name)); $this->form->addQuickAction('Check status', new TAction(array($this, 'onCheckSales')), 'ico_apply.png'); $customer_id->setSize(50); $customer_name->setSize(400); $customer_name->setEditable(FALSE); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // create the form using TQuickForm class $this->form = new TQuickForm('form_interaction'); $this->form->setFormTitle('Dynamic interactions'); $this->form->class = 'tform'; // create the form fields $input_exit = new TEntry('input_exit'); $response_a = new TEntry('response_a'); $combo_change = new TCombo('combo_change'); $response_b = new TCombo('response_b'); $response_c = new TEntry('response_c'); $combo_items = array(); $combo_items['a'] = 'Item a'; $combo_items['b'] = 'Item b'; $combo_items['c'] = 'Item c'; $response_a->setEditable(FALSE); $response_c->setEditable(FALSE); $combo_change->addItems($combo_items); $response_b->addItems($combo_items); // add the fields inside the form $this->form->addQuickField('Input with exit action', $input_exit, 200); $this->form->addQuickField('Response A', $response_a, 200); $this->form->addQuickField('Combo with change action', $combo_change, 200); $this->form->addQuickField('Response B', $response_b, 200); $this->form->addQuickField('Response C', $response_c, 200); $this->form->addQuickAction('View', new TAction(array($this, 'onView')), 'ico_view.png'); // set exit action for input_exit $exit_action = new TAction(array($this, 'onExitAction')); $input_exit->setExitAction($exit_action); // set exit action for input_exit $change_action = new TAction(array($this, 'onChangeAction')); $combo_change->setChangeAction($change_action); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }