本文整理汇总了PHP中TTable::addRowSet方法的典型用法代码示例。如果您正苦于以下问题:PHP TTable::addRowSet方法的具体用法?PHP TTable::addRowSet怎么用?PHP TTable::addRowSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTable
的用法示例。
在下文中一共展示了TTable::addRowSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onInputDialog
/**
* Open an input dialog
*/
public function onInputDialog($param)
{
$name = new TEntry('name');
$amount = new TEntry('amount');
$name->setValue($param['key']);
$form = new TForm('input_form');
$form->style = 'padding:20px';
$table = new TTable();
$table->addRowSet(new TLabel('Name: '), $name);
$table->addRowSet($lbl = new TLabel('Amount: '), $amount);
$lbl->setFontColor('red');
$form->setFields(array($name, $amount));
$form->add($table);
// show the input dialog
new TInputDialog('Input dialog', $form, new TAction(array($this, 'onConfirm')), 'Confirm');
}
示例2: TTable
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// creates a table
$table = new TTable();
// creates a label with the title
$title = new TLabel('Table Multi Cell');
$title->setFontSize(18);
$title->setFontFace('Arial');
$title->setFontColor('red');
// adds a row to the table
$row = $table->addRow();
$title = $row->addCell($title);
$title->colspan = 2;
// creates a series of input widgets
$id = new TEntry('id');
$name = new TEntry('name');
$min = new TEntry('min');
$max = new TEntry('max');
$start_date = new TDate('start_date');
$end_date = new TDate('end_date');
$address = new TEntry('address');
// adjust the size of the code
$id->setSize(70);
$start_date->setSize(70);
$end_date->setSize(70);
$min->setSize(87);
$max->setSize(87);
// add rows for the fields
$table->addRowSet(new TLabel('Code'), $id);
$table->addRowSet(new TLabel('Name'), $name);
// first approach
$table->addRowSet(new TLabel('Value'), array($min, new TLabel('To'), $max));
// second approach
$row = $table->addRow();
$row->addCell(new TLabel('Date'));
$row->addMultiCell($start_date, $end_date);
$table->addRowSet(new TLabel('Address'), $address);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($table);
parent::add($vbox);
}
示例3: TTable
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// creates a table
$table = new TTable();
// creates a label with the title
$title = new TLabel('Table Columns');
$title->setFontSize(18);
$title->setFontFace('Arial');
$title->setFontColor('red');
// adds a row to the table
$row = $table->addRow();
$title = $row->addCell($title);
$title->colspan = 2;
// creates a series of input widgets
$id = new TEntry('id');
$name = new TEntry('name');
$address = new TEntry('address');
$telephone = new TEntry('telephone');
$city = new TCombo('city');
$text = new TText('text');
$items = array();
$items['1'] = 'Porto Alegre';
$items['2'] = 'Lajeado';
$city->addItems($items);
// adjust the size of the code
$id->setSize(70);
// add rows for the fields
$table->addRowSet(new TLabel('Code'), $id);
$table->addRowSet(new TLabel('Name'), $name);
$table->addRowSet(new TLabel('City'), $city);
$table->addRowSet(new TLabel('Address'), $address);
$table->addRowSet(new TLabel('Telephone'), $telephone);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($table);
parent::add($vbox);
}
示例4: Exception
/**
* 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 the form
$this->form = new TForm('form_Note');
$this->form->class = 'tform';
// creates a table
$table = new TTable();
$table->addRowSet(new TLabel(_t('Note')), '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
// create the form fields
$id_issue = new THidden('id_issue');
$note = new THtmlEditor('note');
// define the sizes
$id_issue->setSize(100);
$note->setSize(640, 200);
$note->style = 'margin: 10px';
// add a row for the field id_issue
$row = $table->addRow();
$row->addCell($id_issue);
// add a row for the field note
$row = $table->addRow();
$row->addCell($lbl = new TLabel(_t('Notes') . ': '));
$row = $table->addRow();
$row->addCell($note);
$lbl->setFontStyle('b');
// 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');
// add a row for the form action
$row = $table->addRow();
$row->addCell($save_button);
// define wich are the form fields
$this->form->setFields(array($id_issue, $note, $save_button));
$container = new TTable();
$container->addRow()->addCell($this->form);
// add the form to the page
parent::add($container);
}
示例5: Exception
/**
* 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 the form
$this->form = new TForm('form_Issue');
$this->form->class = 'tform';
$this->form->style = 'width: 400px';
$table = new TTable();
$table->width = '100%';
$table->addRowSet(new TLabel(_t('Password')), '')->class = 'tformtitle';
$this->form->add($table);
// create the form fields
$current_password = new TPassword('current_password');
$new_password1 = new TPassword('new_password1');
$new_password2 = new TPassword('new_password2');
$current_password->addValidation(_t('Current password'), new TRequiredValidator());
$new_password1->addValidation(_t('New password'), new TRequiredValidator());
$new_password2->addValidation(_t('Confirm new password'), new TRequiredValidator());
// add a row for the field
$row = $table->addRow();
$row->addCell(new TLabel(_t('Current password') . ': '));
$row->addCell($current_password);
// add a row for the field
$row = $table->addRow();
$row->addCell(new TLabel(_t('New password') . ': '));
$row->addCell($new_password1);
// add a row for the field
$row = $table->addRow();
$row->addCell(new TLabel(_t('Confirm new password') . ': '));
$row->addCell($new_password2);
// 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');
$table->addRowSet($save_button, '')->class = 'tformaction';
// define wich are the form fields
$this->form->setFields(array($current_password, $new_password1, $new_password2, $save_button));
$container = new TVBox();
$container->add($this->form);
parent::add($container);
}
示例6: __construct
/**
* Class constructor
* Creates the page, the form and the listing
*/
public function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_search_SystemProgram');
$this->form->class = 'tform';
// creates a table
$table = new TTable();
$table->style = 'width:100%';
$table->addRowSet(new TLabel(_t('Programs')), '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
// create the form fields
$name = new TEntry('name');
$name->setValue(TSession::getValue('SystemProgram_name'));
$control = new TEntry('controller');
$control->setValue(TSession::getValue('SystemProgram_control'));
// add rows for the filter fields
$row = $table->addRowSet(new TLabel(_t('Name') . ': '), $name);
$row = $table->addRowSet(new TLabel(_t('Controller') . ': '), $control);
// create two action buttons to the form
$find_button = new TButton('find');
$new_button = new TButton('new');
// define the button actions
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('ico_find.png');
$new_button->setAction(new TAction(array('SystemProgramForm', 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
// define wich are the form fields
$this->form->setFields(array($name, $control, $find_button, $new_button));
$container = new THBox();
$container->add($find_button);
$container->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($container);
$cell->colspan = 2;
// creates a DataGrid
$this->datagrid = new TDataGrid();
$this->datagrid->style = 'width: 100%';
$this->datagrid->setHeight(320);
// creates the datagrid columns
$id = new TDataGridColumn('id', 'ID', 'right');
$name = new TDataGridColumn('name', _t('Name'), 'left');
$controller = new TDataGridColumn('controller', _t('Controller'), 'left');
// add the columns to the DataGrid
$this->datagrid->addColumn($id);
$this->datagrid->addColumn($name);
$this->datagrid->addColumn($controller);
// creates the datagrid column actions
$order_id = new TAction(array($this, 'onReload'));
$order_id->setParameter('order', 'id');
$id->setAction($order_id);
$order_name = new TAction(array($this, 'onReload'));
$order_name->setParameter('order', 'name');
$name->setAction($order_name);
$order_controller = new TAction(array($this, 'onReload'));
$order_controller->setParameter('order', 'controller');
$controller->setAction($order_controller);
// inline editing
$name_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$name_edit->setField('id');
$name->setEditAction($name_edit);
$controller_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$controller_edit->setField('id');
$controller->setEditAction($controller_edit);
// creates two datagrid actions
$action1 = new TDataGridAction(array('SystemProgramForm', 'onEdit'));
$action1->setLabel(_t('Edit'));
$action1->setImage('ico_edit.png');
$action1->setField('id');
$action2 = new TDataGridAction(array($this, 'onDelete'));
$action2->setLabel(_t('Delete'));
$action2->setImage('ico_delete.png');
$action2->setField('id');
// add the actions to the datagrid
$this->datagrid->addAction($action1);
$this->datagrid->addAction($action2);
// 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();
$table->style = 'width: 80%';
$table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
$table->addRow()->addCell($this->form);
$table->addRow()->addCell($this->datagrid);
$table->addRow()->addCell($this->pageNavigation);
// add the table inside the page
parent::add($table);
}
示例7: __construct
/**
* Class constructor
* Creates the page, the form and the listing
*/
public function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_search_System_user');
$this->form->class = 'tform';
// creates a table
$table = new TTable();
$table->style = 'width:100%';
$table->addRowSet(new TLabel(_t('Users')), '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
// create the form fields
$id = new TEntry('id');
$id->setValue(TSession::getValue('System_user_id'));
$name = new TEntry('name');
$name->setValue(TSession::getValue('System_user_name'));
// add a row for the filter field
$table->addRowSet(new TLabel('ID:'), $id);
$table->addRowSet(new TLabel(_t('Name') . ': '), $name);
// create two action buttons to the form
$find_button = new TButton('find');
$new_button = new TButton('new');
// define the button actions
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('fa:search');
$new_button->setAction(new TAction(array('SystemUserForm', 'onEdit')), _t('New'));
$new_button->setImage('fa:plus-square green');
// add a row for the form actions
$container = new THBox();
$container->add($find_button);
$container->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($container);
$cell->colspan = 2;
// define wich are the form fields
$this->form->setFields(array($id, $name, $find_button, $new_button));
// creates a DataGrid
$this->datagrid = new TDataGrid();
$this->datagrid->setHeight(320);
$this->datagrid->style = 'width: 100%';
// creates the datagrid columns
$id = new TDataGridColumn('id', 'ID', 'center');
$name = new TDataGridColumn('name', _t('Name'), 'center');
$login = new TDataGridColumn('login', _t('Login'), 'center');
$email = new TDataGridColumn('email', _t('Email'), 'center');
// add the columns to the DataGrid
$this->datagrid->addColumn($id);
$this->datagrid->addColumn($name);
$this->datagrid->addColumn($login);
$this->datagrid->addColumn($email);
// creates the datagrid column actions
$order_id = new TAction(array($this, 'onReload'));
$order_id->setParameter('order', 'id');
$id->setAction($order_id);
$order_name = new TAction(array($this, 'onReload'));
$order_name->setParameter('order', 'name');
$name->setAction($order_name);
$order_login = new TAction(array($this, 'onReload'));
$order_login->setParameter('order', 'login');
$login->setAction($order_login);
$order_email = new TAction(array($this, 'onReload'));
$order_email->setParameter('order', 'email');
$email->setAction($order_email);
// inline editing
$name_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$name_edit->setField('id');
$name->setEditAction($name_edit);
// creates two datagrid actions
$action1 = new TDataGridAction(array('SystemUserForm', 'onEdit'));
$action1->setLabel(_t('Edit'));
$action1->setImage('fa:pencil-square-o blue fa-lg');
$action1->setField('id');
$action2 = new TDataGridAction(array($this, 'onDelete'));
$action2->setLabel(_t('Delete'));
$action2->setImage('fa:trash-o grey fa-lg');
$action2->setField('id');
// add the actions to the datagrid
$this->datagrid->addAction($action1);
$this->datagrid->addAction($action2);
// 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();
$table->style = 'width: 80%';
$table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
$table->addRow()->addCell($this->form);
$table->addRow()->addCell($this->datagrid);
$table->addRow()->addCell($this->pageNavigation);
// add the table inside the page
parent::add($table);
//.........这里部分代码省略.........
示例8: __construct
/**
* Class constructor
* Creates the page, the form and the listing
*/
public 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('Subject');
// defines the filter field
parent::setFilterField('name');
// creates the form
$this->form = new TForm('form_search_Subject');
$this->form->class = 'tform';
$this->form->style = 'width: 600px';
// creates a table
$table = new TTable();
$table->width = '100%';
$table->addRowSet(new TLabel(_t('Subjects')), '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
// create the form fields
$name = new TEntry('name');
$name->setValue(TSession::getValue('Subject_name'));
// add a row for the field name
$row = $table->addRow();
$row->addCell(new TLabel(_t('Name') . ':'));
$row->addCell($name);
// create two action buttons to the form
$find_button = new TButton('find');
$new_button = new TButton('new');
// define the button actions
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('ico_find.png');
$new_button->setAction(new TAction(array('SubjectForm', 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
$buttons = new THBox();
$buttons->add($find_button);
$buttons->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($buttons);
$cell->colspan = 2;
// define wich are the form fields
$this->form->setFields(array($name, $find_button, $new_button));
// creates a DataGrid
$this->datagrid = new TQuickGrid();
$this->datagrid->setHeight(320);
// creates the datagrid columns
$this->datagrid->addQuickColumn(_t('Code'), 'id', 'right', 100, new TAction(array($this, 'onReload')), array('order', 'id'));
$this->datagrid->addQuickColumn(_t('Name'), 'name', 'left', 440, new TAction(array($this, 'onReload')), array('order', 'name'));
// add the actions to the datagrid
$this->datagrid->addQuickAction(_t('Edit'), new TDataGridAction(array('SubjectForm', '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
$container = new TVBox();
$container->add($this->form);
$container->add($this->datagrid);
$container->add($this->pageNavigation);
// add the vbox inside the page
parent::add($container);
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->form = new TForm('form_search_PlantaValores');
$this->form->class = 'tform';
$table = new TTable();
$table->style = 'width:100%';
$table->addRowSet(new TLabel('Planta de Valores'), '')->class = 'tformtitle';
$this->form->add($table);
$plantavalores_id = new TEntry('plantavalores_id');
$plantavalores_id->setValue(TSession::getValue('plantavalores_id'));
$anobase = new TEntry('anobase');
$anobase->setValue(TSession::getValue('anobase'));
$row = $table->addRowSet(new TLabel('ID: '), $plantavalores_id);
$row = $table->addRowSet(new TLabel('Ano Base: '), $anobase);
$find_button = new TButton('find');
$new_button = new TButton('new');
// define the button actions
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('ico_find.png');
$new_button->setAction(new TAction(array('PlantaValoresForm', 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
$this->form->setFields(array($plantavalores_id, $anobase, $find_button, $new_button));
$container = new THBox();
$container->add($find_button);
$container->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($container);
$cell->colspan = 2;
$this->datagrid = new TDataGrid();
$this->datagrid->style = 'width: 100%';
$this->datagrid->setHeight(320);
$plantavalores_id = new TDataGridColumn('plantavalores_id', 'ID', 'right');
$anobase = new TDataGridColumn('anobase', 'Ano Base', 'left');
$this->datagrid->addColumn($plantavalores_id);
$this->datagrid->addColumn($anobase);
$order_id = new TAction(array($this, 'onReload'));
$order_id->setParameter('order', 'plantavalores_id');
$plantavalores_id->setAction($order_id);
$order_data = new TAction(array($this, 'onReload'));
$order_data->setParameter('order', 'anobase');
$anobase->setAction($order_data);
$action1 = new TDataGridAction(array('PlantaValoresForm', 'onEdit'));
$action1->setLabel(_t('Edit'));
$action1->setImage('ico_edit.png');
$action1->setField('anobase_id');
$action2 = new TDataGridAction(array($this, 'onDelete'));
$action2->setLabel(_t('Delete'));
$action2->setImage('ico_delete.png');
$action2->setField('plantavalores_id');
$this->datagrid->addAction($action1);
$this->datagrid->addAction($action2);
$this->datagrid->createModel();
$this->pageNavigation = new TPageNavigation();
$this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
$this->pageNavigation->setWidth($this->datagrid->getWidth());
$table = new TTable();
$table->style = 'width: 80%';
$table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
$table->addRow()->addCell($this->form);
$table->addRow()->addCell($this->datagrid);
$table->addRow()->addCell($this->pageNavigation);
parent::add($table);
}
示例10: TForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_System_user');
$this->form->class = 'tform';
// creates the table container
$table = new TTable();
$table->style = 'width: 100%';
$table->addRowSet(new TLabel('Usuário'), '', '', '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
$frame_groups = new TFrame(NULL, 280);
$frame_groups->setLegend('Grupos');
$frame_groups->style .= ';margin: 4px';
$frame_programs = new TFrame(NULL, 280);
$frame_programs->setLegend('Programas');
$frame_programs->style .= ';margin: 15px';
// create the form fields
$id = new TEntry('id');
$name = new TEntry('name');
$login = new TEntry('login');
$password = new TPassword('password');
$repassword = new TPassword('repassword');
$email = new TEntry('email');
$multifield_programs = new TMultiField('programs');
$program_id = new TDBSeekButton('program_id', 'esales', 'form_System_user', 'SystemProgram', 'name', 'programs_id', 'programs_name');
$program_name = new TEntry('program_name');
$groups = new TDBCheckGroup('groups', 'esales', 'SystemGroup', 'id', 'name');
$frontpage_id = new TDBSeekButton('frontpage_id', 'esales', 'form_System_user', 'SystemProgram', 'name', 'frontpage_id', 'frontpage_name');
$frontpage_name = new TEntry('frontpage_name');
$scroll = new TScroll();
$scroll->setSize(290, 230);
$scroll->add($groups);
$frame_groups->add($scroll);
$frame_programs->add($multifield_programs);
// define the sizes
$id->setSize(100);
$name->setSize(200);
$login->setSize(150);
$password->setSize(150);
$email->setSize(200);
$frontpage_id->setSize(100);
$multifield_programs->setHeight(140);
// outros
$id->setEditable(false);
$program_name->setEditable(false);
$frontpage_name->setEditable(false);
// validations
$name->addValidation('Nome', new TRequiredValidator());
$login->addValidation('Login', new TRequiredValidator());
$email->addValidation('Email', new TEmailValidator());
$program_id->setSize(50);
$program_name->setSize(200);
// configuracoes multifield
$multifield_programs->setClass('SystemProgram');
$multifield_programs->addField('id', 'ID', $program_id, 60);
$multifield_programs->addField('name', 'Nome', $program_name, 250);
$multifield_programs->setOrientation('horizontal');
// add a row for the field id
$table->addRowSet(new TLabel('ID:'), $id, new TLabel('Nome' . ': '), $name);
$table->addRowSet(new TLabel('login' . ': '), $login, new TLabel('Email' . ': '), $email);
$table->addRowSet(new TLabel('Senha' . ': '), $password, new TLabel('Confirmar senha' . ': '), $repassword);
$table->addRowSet(new TLabel('Página inicial' . ': '), $frontpage_id, new TLabel('Nome página' . ': '), $frontpage_name);
$row = $table->addRow();
$cell = $row->addCell($frame_groups);
$cell->colspan = 2;
$row = $table->addRow();
$cell = $row->addCell($frame_programs);
$cell->colspan = 2;
// create an action button (save)
$save_button = new TButton('save');
$save_button->setAction(new TAction(array($this, 'onSave')), 'Salvar');
$save_button->setImage('ico_save.png');
// create an new button (edit with no parameters)
$new_button = new TButton('new');
$new_button->setAction(new TAction(array($this, 'onEdit')), 'Novo');
$new_button->setImage('ico_new.png');
$list_button = new TButton('list');
$list_button->setAction(new TAction(array('SystemUserList', 'onReload')), 'Voltar para listagem');
$list_button->setImage('ico_datagrid.png');
// define the form fields
$this->form->setFields(array($id, $name, $login, $password, $repassword, $multifield_programs, $frontpage_id, $frontpage_name, $groups, $email, $save_button, $new_button, $list_button));
$buttons = new THBox();
$buttons->add($save_button);
$buttons->add($new_button);
$buttons->add($list_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($buttons);
$cell->colspan = 4;
$container = new TTable();
$container->style = 'width: 80%';
$container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemUserList'));
$container->addRow()->addCell($this->form);
// add the form to the page
//.........这里部分代码省略.........
示例11: __construct
/**
* Class constructor
* Creates the page, the form and the listing
*/
public function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_FreqServList');
$this->form->class = 'tform';
// creates a table
$table = new TTable();
$table->style = 'width:100%';
$table->addRowSet(new TLabel('Frequência'), '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
// create the form fields
//$id = new TEntry('ID');
//$id->setValue(TSession::getValue('Frequencia_id'));
$servidor_id = new TDBSeekButton('servidor_id', 'lacenrh', 'form_FreqServList', 'Servidor', 'servidor', 'servidor_id', 'servidor_nome');
$servidor_id->setValue(TSession::getValue('Frequencia_servidor_id'));
$servidor_nome = new TEntry('servidor_nome');
$servidor_nome->setValue(TSession::getValue('Frequencia_servidor_nome'));
$diames = new TDate('Data');
$diames->setValue(TSession::getValue('Frequencia_diames'));
//$id->setSize(40);
$servidor_id->setSize(40);
$servidor_nome->setSize(300);
$diames->setSize(100);
$diames->setMask('dd/mm/yyyy');
// add rows for the filter fields
//$row=$table->addRowSet(new TLabel(('ID') . ': '), $id);
$row = $table->addRowSet(new TLabel('Servidor' . ': '), $servidor_id);
$row = $table->addRowSet(new TLabel('Nome' . ': '), $servidor_nome);
$row = $table->addRowSet(new TLabel('Data' . ': '), $diames);
//$row=$table->addRowSet(new TLabel(('Unidade') . ': '), $unidade);
// create two action buttons to the form
$find_button = new TButton('find');
$clear_button = new Tbutton('clear');
$new_button = new TButton('new');
// define the button actions
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('fa:search fa-lg');
$clear_button->setAction(new TAction(array($this, 'onClear')), 'Limpar');
$clear_button->setImage('fa:undo red fa-lg');
$new_button->setAction(new TAction(array('FrequenciaServidorForm', 'onEdit')), _t('New'));
$new_button->setImage('fa:plus-square green fa-lg');
// define wich are the form fields
$this->form->setFields(array($servidor_id, $servidor_nome, $diames, $find_button, $clear_button, $new_button));
$container = new THBox();
$container->add($find_button);
$container->add($clear_button);
$container->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($container);
$cell->colspan = 2;
// creates a DataGrid
$this->datagrid = new TDataGrid();
$this->datagrid->style = 'width: 100%';
$this->datagrid->setHeight(320);
// creates the datagrid columns
$servidor_nome = new TDataGridColumn('servidor_nome', 'Nome', 'left', 200);
$diames = new TDataGridColumn('diames', 'Data', 'center', 50);
$entrada = new TDataGridColumn('entrada', 'Entrada', 'center', 40);
$intervalo_inicio = new TDataGridColumn('intervalo_inicio', 'Saída', 'center', 50);
$intervalo_fim = new TDataGridColumn('intervalo_fim', 'Entrada', 'center', 50);
$saida = new TDataGridColumn('saida', 'Saída', 'center', 50);
$ausencia_desc = new TDataGridColumn('ausencia_desc', 'Ausência', 'left');
// add the columns to the DataGrid
$this->datagrid->addColumn($servidor_nome);
$this->datagrid->addColumn($diames);
$this->datagrid->addColumn($entrada);
$this->datagrid->addColumn($intervalo_inicio);
$this->datagrid->addColumn($intervalo_fim);
$this->datagrid->addColumn($saida);
$this->datagrid->addColumn($ausencia_desc);
$order_servidor_nome = new TAction(array($this, 'onReload'));
$order_servidor_nome->setParameter('order', 'servidor_nome');
$servidor_nome->setAction($order_servidor_nome);
$order_diames = new TAction(array($this, 'onReload'));
$order_diames->setParameter('order', 'diames');
$diames->setAction($order_diames);
// inline editing
$servidor_entrada_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$servidor_entrada_edit->setField('id');
$entrada->setEditAction($servidor_entrada_edit);
$servidor_intervalo_inicio_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$servidor_intervalo_inicio_edit->setField('id');
$intervalo_inicio->setEditAction($servidor_intervalo_inicio_edit);
$servidor_intervalo_fim_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$servidor_intervalo_fim_edit->setField('id');
$intervalo_fim->setEditAction($servidor_intervalo_fim_edit);
$servidor_saida_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$servidor_saida_edit->setField('id');
$saida->setEditAction($servidor_saida_edit);
// creates two datagrid actions
$action1 = new TDataGridAction(array('FrequenciaServidorForm', 'onEdit'));
$action1->setLabel(_t('Edit'));
$action1->setImage('fa:pencil-square-o blue');
//.........这里部分代码省略.........
示例12: __construct
public function __construct()
{
parent::__construct();
$this->form = new TForm('form_search_Contribuinte');
$this->form->class = 'tform';
$table = new TTable();
$table->style = 'width:100%';
$table->addRowSet(new TLabel('Contribuinte'), '')->class = 'tformtitle';
$this->form->add($table);
$contribuinte_id = new TEntry('contribuinte_id');
$contribuinte_id->setValue(TSession::getValue('contribuinte_id'));
$contribuinte_nome = new TEntry('contribuinte_nome');
$contribuinte_nome->setValue(TSession::getValue('contribuinte_nome'));
$row = $table->addRowSet(new TLabel('ID: '), $contribuinte_id);
$row = $table->addRowSet(new TLabel('Nome/Razão Social: '), $contribuinte_nome);
$find_button = new TButton('find');
$new_button = new TButton('new');
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('ico_find.png');
$new_button->setAction(new TAction(array('ContribuinteForm', 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
$this->form->setFields(array($contribuinte_id, $contribuinte_nome, $find_button, $new_button));
$container = new THBox();
$container->add($find_button);
$container->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($container);
$cell->colspan = 2;
// creates a DataGrid
$this->datagrid = new TDataGrid();
$this->datagrid->style = 'width: 100%';
$this->datagrid->setHeight(320);
$contribuinte_id = new TDataGridColumn('contribuinte_id', 'ID', 'right');
$contribuinte_nome = new TDataGridColumn('contribuinte_nome', 'Nome/Razão Social', 'left');
$contribuinte_tipo = new TDataGridColumn('contribuinte_tipo', 'Tipo', 'left');
$contribuinte_tipo = new TDataGridColumn('contribuinte_tipos', 'Tipo', 'left');
$this->datagrid->addColumn($contribuinte_id);
$this->datagrid->addColumn($contribuinte_nome);
$this->datagrid->addColumn($contribuinte_tipo);
$order_id = new TAction(array($this, 'onReload'));
$order_id->setParameter('order', 'contribuinte_id');
$contribuinte_id->setAction($order_id);
$order_name = new TAction(array($this, 'onReload'));
$order_name->setParameter('order', 'contribuinte_nome');
$contribuinte_nome->setAction($order_name);
$name_edit = new TDataGridAction(array($this, 'onInlineEdit'));
$name_edit->setField('contribuinte_id');
$contribuinte_nome->setEditAction($name_edit);
// creates two datagrid actions
$action1 = new TDataGridAction(array('ContribuinteForm', 'onEdit'));
$action1->setLabel(_t('Edit'));
$action1->setImage('ico_edit.png');
$action1->setField('contribuinte_id');
$action2 = new TDataGridAction(array($this, 'onDelete'));
$action2->setLabel(_t('Delete'));
$action2->setImage('ico_delete.png');
$action2->setField('contribuinte_id');
$this->datagrid->addAction($action1);
$this->datagrid->addAction($action2);
$this->datagrid->createModel();
$this->pageNavigation = new TPageNavigation();
$this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
$this->pageNavigation->setWidth($this->datagrid->getWidth());
$table = new TTable();
$table->style = 'width: 80%';
$table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
$table->addRow()->addCell($this->form);
$table->addRow()->addCell($this->datagrid);
$table->addRow()->addCell($this->pageNavigation);
// add the table inside the page
parent::add($table);
}
示例13: Exception
/**
* 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 == 'CUSTOMER') {
throw new Exception(_t('Permission denied'));
}
TTransaction::close();
$table = new TTable();
// creates the form
$this->form = new TForm('form_Issue');
$this->form->add($table);
$table->width = '100%';
$this->form->style = 'width: 750px';
$this->form->class = 'tform';
$table->addRowSet(new TLabel(_t('Issue')), '')->class = 'tformtitle';
$table1 = new TTable();
$table2 = new TTable();
// create the form fields
$id = new TEntry('id');
$id_user = new TDBCombo('id_user', 'changeman', 'Member', 'id', 'name');
$id_status = new TDBCombo('id_status', 'changeman', 'Status', 'id', 'complete_description');
$id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
$id_priority = new TDBCombo('id_priority', 'changeman', 'Priority', 'id', 'description_translated');
$id_category = new TDBCombo('id_category', 'changeman', 'Category', 'id', 'description_translated');
$id_release = new TDBCombo('id_release', 'changeman', 'Release', 'id', 'name');
$id_member = new TDBCombo('id_member', 'changeman', 'Member', 'id', 'name');
$register_date = new TDate('register_date');
$close_date = new TDate('close_date');
$time = new TEntry('issue_time');
$title = new TEntry('title');
$description = new THtmlEditor('description');
$solution = new THtmlEditor('solution');
$id_user->addValidation(_t('User'), new TRequiredValidator());
$id_status->addValidation(_t('Status'), new TRequiredValidator());
$id_project->addValidation(_t('Project'), new TRequiredValidator());
$id_priority->addValidation(_t('Priority'), new TRequiredValidator());
$id_category->addValidation(_t('Category'), new TRequiredValidator());
$register_date->addValidation(_t('Start date'), new TRequiredValidator());
$title->addValidation(_t('Title'), new TRequiredValidator());
$description->addValidation(_t('Description'), new TRequiredValidator());
// define the sizes
$id->setSize(100);
$id_user->setSize(200);
$id_status->setSize(200);
$id_project->setSize(200);
$id_priority->setSize(200);
$id_category->setSize(200);
$id_release->setSize(200);
$id_member->setSize(200);
$register_date->setSize(100);
$close_date->setSize(100);
$time->setSize(200);
$title->setSize(200, 40);
$description->setSize(680, 300);
$solution->setSize(680, 300);
$register_date->setMask('yyyy-mm-dd');
$close_date->setMask('yyyy-mm-dd');
$id->setEditable(FALSE);
// add a row for the field id
$table1->addRowSet(new TLabel('ID:'), $id);
$table1->addRowSet(new TLabel(_t('User') . ': '), $id_user);
$table1->addRowSet(new TLabel(_t('Status') . ': '), $id_status);
$table1->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
$table1->addRowSet(new TLabel(_t('Priority') . ': '), $id_priority);
$table1->addRowSet(new TLabel(_t('Category') . ': '), $id_category);
$table2->addRowSet(new TLabel(_t('Release') . ': '), $id_release);
$table2->addRowSet(new TLabel(_t('Assigned to')), $id_member);
$table2->addRowSet(new TLabel(_t('Start date') . ':'), $register_date);
$table2->addRowSet(new TLabel(_t('Due date') . ':'), $close_date);
$table2->addRowSet(new TLabel(_t('Time') . ':'), $time);
$table2->addRowSet(new TLabel(_t('Title') . ':'), $title);
$row = $table->addRow();
$row->addCell($table1);
$row->addCell($table2);
$subnotebook = new TNotebook();
$subnotebook->setSize(710, 320);
$subnotebook->style = 'padding: 50px';
$subnotebook->appendPage(_t('Description'), $description);
$subnotebook->appendPage(_t('Solution'), $solution);
$hbox = new THBox();
$hbox->add($subnotebook);
$hbox->style = 'margin: 10px';
$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');
//.........这里部分代码省略.........
示例14: __construct
/**
* Class constructor
* Creates the page, the form and the listing
*/
public function __construct()
{
parent::__construct();
// security check
if (TSession::getValue('logged') !== TRUE) {
throw new Exception(_t('Not logged'));
}
// creates the form
$this->form = new TForm('form_search_Issue');
$this->form->class = 'tform';
// creates a table
$table = new TTable();
$table->width = '100%';
$table->addRowSet(new TLabel(_t('Issues')), '', '', '')->class = 'tformtitle';
// add the table inside the form
$this->form->add($table);
// create the form fields
$filter_status = new TDBCombo('id_status', 'changeman', 'Status', 'id', 'description_translated');
$filter_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
$filter_priority = new TDBCombo('id_priority', 'changeman', 'Priority', 'id', 'description_translated');
$filter_category = new TDBCombo('id_category', 'changeman', 'Category', 'id', 'description_translated');
$filter_title = new TEntry('title');
$filter_status->setValue(TSession::getValue('Issue_id_status'));
$filter_project->setValue(TSession::getValue('Issue_id_project'));
$filter_priority->setValue(TSession::getValue('Issue_id_priority'));
$filter_category->setValue(TSession::getValue('Issue_id_category'));
$filter_title->setValue(TSession::getValue('Issue_title'));
$filter_title->setSize(480);
// add a row for the filter field
$row = $table->addRow();
$row->addCell(new TLabel(_t('Status') . ': '));
$row->addCell($filter_status);
$row->addCell(new TLabel(_t('Project') . ': '));
$row->addCell($filter_project);
$row = $table->addRow();
$row->addCell(new TLabel(_t('Priority') . ': '));
$row->addCell($filter_priority);
$row->addCell(new TLabel(_t('Category') . ': '));
$row->addCell($filter_category);
$row = $table->addRow();
$row->addCell(new TLabel(_t('Title') . ': '));
$cell = $row->addCell($filter_title);
$cell->colspan = 3;
// create two action buttons to the form
$find_button = new TButton('find');
$new_button = new TButton('new');
// define the button actions
$find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
$find_button->setImage('ico_find.png');
TTransaction::open('changeman');
if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic == 'CUSTOMER') {
$class = 'NewIssueForm';
$new_button->setAction(new TAction(array($class, 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
} else {
$class = 'UpdateIssueForm';
$new_button->setAction(new TAction(array($class, 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
}
TTransaction::close();
$buttons = new THBox();
$buttons->add($find_button);
$buttons->add($new_button);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($buttons);
$cell->colspan = 4;
// define wich are the form fields
$this->form->setFields(array($filter_status, $filter_project, $filter_priority, $filter_category, $filter_title, $find_button, $new_button));
// creates a DataGrid
$this->datagrid = new TDataGrid();
$this->datagrid->setHeight(320);
// creates the datagrid columns
$id = new TDataGridColumn('id', 'ID', 'right', 50);
$title = new TDataGridColumn('title', _t('Title'), 'left', 260);
$id_status = new TDataGridColumn('status', _t('Status'), 'left', 100);
$id_priority = new TDataGridColumn('priority', _t('Priority'), 'left', 100);
$id_category = new TDataGridColumn('category', _t('Category'), 'left', 100);
$register_date = new TDataGridColumn('register_date', _t('Start date'), 'left', 110);
// creates the datagrid actions
$order1 = new TAction(array($this, 'onReload'));
$order2 = new TAction(array($this, 'onReload'));
$order3 = new TAction(array($this, 'onReload'));
$order4 = new TAction(array($this, 'onReload'));
$order5 = new TAction(array($this, 'onReload'));
$order6 = new TAction(array($this, 'onReload'));
$order7 = new TAction(array($this, 'onReload'));
$order8 = new TAction(array($this, 'onReload'));
// define the ordering parameters
$order1->setParameter('order', 'id');
$order2->setParameter('order', 'title');
$order3->setParameter('order', 'id_status');
$order4->setParameter('order', 'id_priority');
$order5->setParameter('order', 'id_category');
$order6->setParameter('order', 'register_date');
// assign the ordering actions
//.........这里部分代码省略.........
示例15: __construct
/**
* Form constructor
* @param $param Request
*/
public function __construct($param)
{
parent::__construct();
// creates the form
$this->form = new TForm('form_Cliente');
$this->form->class = 'tform';
// change CSS class
$note = new TNotebook(400, 300);
// add a table inside form
$table = new TTable();
$table->width = '100%';
// add a row for the form title
$row = $table->addRow();
$row->class = 'tformtitle';
// CSS class
$row->addCell(new TLabel('Clientes'))->colspan = 2;
// create the form fields
$id = new TEntry('id');
$nome = new TEntry('nome');
// campo para telefones
$multifield = new TMultiField('telefone');
$telefone_id = new TEntry('id');
$telefone_id->setEditable(false);
$telefone = new TEntry('numero');
$telefone->setMask('(99)99999-9999');
// campo para emails
$multifield_email = new TMultiField('email');
$email = new TEntry('email');
$email_id = new TEntry('id');
$email->addValidation('email', new TEmailValidator());
$multifield->addField('id', 'Codigo', $telefone_id, 200);
$multifield->addField('numero', 'Telefone', $telefone, 200, true);
$multifield_email->addField('id', 'Codigo', $email_id, 200);
$multifield_email->addField('email', 'Email', $email, 200, true);
// define the sizes
$id->setSize(100);
$nome->setSize(200);
// add one row for each form field
$table->addRowSet(new TLabel('id:'), $id);
$table->addRowSet(new TLabel('nome:'), $nome);
$this->form->setFields(array($id, $nome, $multifield, $multifield_email));
// create the form actions
$save_button = TButton::create('save', array($this, 'onSave'), _t('Save'), 'bs:floppy-disk red');
$new_button = TButton::create('new', array($this, 'onEdit'), _t('New'), 'bs:edit green');
$this->form->addField($save_button);
$this->form->addField($new_button);
$buttons_box = new THBox();
$buttons_box->add($save_button);
$buttons_box->add($new_button);
// add a row for the form action
$row = $table->addRow();
$row->class = 'tformaction';
// CSS class
$row->addCell($buttons_box)->colspan = 2;
$note->appendPage('Clientes', $table);
$note->appendPage('Telefone', $multifield);
$note->appendPage('Email', $multifield_email);
$this->form->add($note);
// vertical box container
$container = new TVBox();
$container->style = 'width: 90%';
// $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$container->add(TPanelGroup::pack('Title', $this->form));
parent::add($container);
}