本文整理汇总了PHP中TEntry::setExitAction方法的典型用法代码示例。如果您正苦于以下问题:PHP TEntry::setExitAction方法的具体用法?PHP TEntry::setExitAction怎么用?PHP TEntry::setExitAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEntry
的用法示例。
在下文中一共展示了TEntry::setExitAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TQuickForm
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new TQuickForm('cond_form');
$this->form->setFormTitle('Conditional form');
$this->form->class = 'tform';
// create the form fields
$animal = new TEntry('animal');
$color = new TEntry('color');
$animal->setExitAction(new TAction(array($this, 'onEnableAction')));
$color->setExitAction(new TAction(array($this, 'onEnableAction')));
// add the fields inside the form
$this->form->addQuickField('Animal (type "elephant"): ', $animal, 200);
$this->form->addQuickField('Color (type "blue")', $color, 200);
// define the form action
$this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
self::onEnableAction(array());
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例2: __construct
/**
* Class constructor
* Creates the page
*/
public function __construct()
{
parent::__construct();
new TSession();
// creates the items form and add a table inside
$this->form_item = new TForm('form_pos');
$this->form_item->class = 'tform';
$table_item = new TTable();
$table_item->width = '100%';
$this->form_item->add($table_item);
// create the form fields
$product_id = new TDBSeekButton('product_id', 'samples', 'form_pos', 'Product', 'description', 'product_id', 'product_description');
$product_description = new TEntry('product_description');
$sale_price = new TEntry('sale_price');
$amount = new TEntry('amount');
$discount = new TEntry('discount');
$total = new TEntry('total');
// add validators
$product_id->addValidation('Product', new TRequiredValidator());
$amount->addValidation('Amount', new TRequiredValidator());
// define the exit actions
$product_id->setExitAction(new TAction(array($this, 'onExitProduct')));
$amount->setExitAction(new TAction(array($this, 'onUpdateTotal')));
$discount->setExitAction(new TAction(array($this, 'onUpdateTotal')));
// define some attributes
$product_id->style = 'font-size: 17pt; height: 30px';
$product_description->style = 'font-size: 17pt; height: 30px';
$sale_price->style = 'font-size: 17pt; height: 30px';
$amount->style = 'font-size: 17pt; height: 30px';
$discount->style = 'font-size: 17pt; height: 30px';
$total->style = 'font-size: 17pt; height: 30px';
$product_id->button->style = 'height: 30px; margin-top:0px; vertical-align:top';
// define some properties
$product_id->setSize(50);
$product_description->setEditable(FALSE);
$sale_price->setEditable(FALSE);
$total->setEditable(FALSE);
$sale_price->setNumericMask(2, '.', ',');
$discount->setNumericMask(2, '.', ',');
$total->setNumericMask(2, '.', ',');
$sale_price->setSize(100);
$amount->setSize(100);
$discount->setSize(100);
$total->setSize(100);
// add a row for the form title
$row = $table_item->addRow();
$row->class = 'tformtitle';
// CSS class
$cell = $row->addCell(new TLabel('Point of Sales'));
$cell->colspan = 4;
// create the field labels
$lab_pro = new TLabel('Product');
$lab_des = new TLabel('Description');
$lab_pri = new TLabel('Price');
$lab_amo = new TLabel('Amount');
$lab_dis = new TLabel('Discount');
$lab_tot = new TLabel('Total');
$lab_pro->setFontSize(17);
$lab_des->setFontSize(17);
$lab_pri->setFontSize(17);
$lab_amo->setFontSize(17);
$lab_dis->setFontSize(17);
$lab_tot->setFontSize(17);
$lab_pro->setFontFace('Trebuchet MS');
$lab_des->setFontFace('Trebuchet MS');
$lab_pri->setFontFace('Trebuchet MS');
$lab_amo->setFontFace('Trebuchet MS');
$lab_dis->setFontFace('Trebuchet MS');
$lab_tot->setFontFace('Trebuchet MS');
$lab_pro->setFontColor('red');
$lab_amo->setFontColor('red');
// creates the action button
$button1 = new TButton('add');
$button1->setAction(new TAction(array($this, 'onAddItem')), 'Add item');
$button1->setImage('ico_add.png');
// add the form fields
$table_item->addRowSet($lab_pro, $product_id, $lab_des, $product_description);
$table_item->addRowSet($lab_pri, $sale_price, $lab_amo, $amount);
$table_item->addRowSet($lab_dis, $discount, $lab_tot, array($total, $button1));
// define the form fields
$this->form_item->setFields(array($product_id, $product_description, $sale_price, $amount, $discount, $total, $button1));
// creates the customer form and add a table inside it
$this->form_customer = new TForm('form_customer');
$this->form_customer->class = 'tform';
$table_customer = new TTable();
$table_customer->width = '100%';
$this->form_customer->add($table_customer);
// add a row for the form title
$row = $table_customer->addRow();
$row->class = 'tformtitle';
// CSS class
$cell = $row->addCell(new TLabel('Customer'));
$cell->colspan = 5;
// create the form fields
$customer_id = new TDBSeekButton('customer_id', 'samples', 'form_customer', 'Customer', 'name', 'customer_id', 'customer_name');
$customer_name = new TEntry('customer_name');
//.........这里部分代码省略.........
示例3: TForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_Clientes');
$this->form->class = 'tform';
// CSS class
// add a table inside form
$table = new TTable();
$table->width = '100%';
$this->form->add($table);
// 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');
$sobrenome = new TEntry('sobrenome');
$cep = new TEntry('cep');
$logradouro = new TEntry('logradouro');
$bairro = new TEntry('bairro');
$cidade = new TEntry('cidade');
$email = new TEntry('email');
$dd = new TEntry('dd');
$telefone = new TEntry('telefone');
$senha = new TPassword('senha');
$buscaCep = new TAction(array($this, 'onSearch'));
$cep->setExitAction($buscaCep);
// mascaras
$cep->setMask('99999-999');
// define the sizes
$id->setSize(100);
$nome->setSize(200);
$sobrenome->setSize(200);
$cep->setSize(200);
$logradouro->setSize(200);
$bairro->setSize(200);
$cidade->setSize(200);
$email->setSize(200);
$dd->setSize(200);
$telefone->setSize(200);
$senha->setSize(200);
// add one row for each form field
$table->addRowSet(new TLabel('id:'), $id);
$table->addRowSet(new TLabel('nome:'), $nome);
$table->addRowSet(new TLabel('sobrenome:'), $sobrenome);
$table->addRowSet(new TLabel('cep:'), $cep);
$table->addRowSet(new TLabel('logradouro:'), $logradouro);
$table->addRowSet(new TLabel('bairro:'), $bairro);
$table->addRowSet(new TLabel('cidade:'), $cidade);
$table->addRowSet(new TLabel('email:'), $email);
$table->addRowSet(new TLabel('dd:'), $dd);
$table->addRowSet(new TLabel('telefone:'), $telefone);
$table->addRowSet(new TLabel('senha:'), $senha);
// create an action button (save)
$save_button = new TButton('save');
$save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
$save_button->setImage('ico_save.png');
// create an new button (edit with no parameters)
$new_button = new TButton('new');
$new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
$this->form->setFields(array($id, $nome, $sobrenome, $cep, $logradouro, $bairro, $cidade, $email, $dd, $telefone, $senha, $save_button, $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;
parent::add($this->form);
}
示例4: TForm
//.........这里部分代码省略.........
$table->addRowSet($label_titulo = new TLabel('Título:'), $titulo);
$label_titulo->setFontColor('#FF0000');
$table->addRowSet(new TLabel('Data Inicio'), array($data_inicio, $label_status = new TLabel('Status:'), $status_ticket_id));
$label_status->setSize(70);
$table->addRowSet(new TLabel('Data Encerramento:'), array($data_encerramento, $label_data_cancelamento = new TLabel('Data Cancelamento:'), $data_cancelamento));
$label_data_cancelamento->setSize(160);
$table->addRowSet(new TLabel('Prioridade:'), $prioridade_id);
$table->addRowSet(new TLabel('Origem:'), $origem);
$table->addRowSet(new TLabel('Tipo Ticket:'), $tipo_ticket_id);
$table->addRowSet($label_sistema = new TLabel('Sistema:'), $sistema_id);
$label_sistema->setFontColor('#FF0000');
$table->addRowSet(new TLabel('Descrição Solicitação:'), $solicitacao_descricao);
$table->addRowSet(new TLabel('DR.:'), $nome_dtr);
$table->addRowSet(new TLabel(''), array($gerar_dr, $link_dtr));
$table->addRowSet(new TLabel(''), $data_inicio_oculta);
// notebook Pagamento
$tablePagamento->addRowSet(new TLabel('Data Prevista:'), $data_prevista);
$tablePagamento->addRowSet(new TLabel('Data Aprovação:'), $data_aprovacao);
$tablePagamento->addRowSet(new TLabel('Qte Horas:'), $orcamento_horas);
$tablePagamento->addRowSet(new TLabel('Valor Hora:'), $orcamento_valor_hora);
$tablePagamento->addRowSet(new TLabel('Valor Desconto:'), $valor_desconto);
$tablePagamento->addRowSet(new TLabel('Valor Total:'), $valor_total);
$tablePagamento->addRowSet(new TLabel('Forma de Pgto:'), $forma_pagamento);
$tablePagamento->addRowSet(new TLabel('Descrição Providência:'), $providencia);
$tablePagamento->addRowSet(new TLabel('Observação:'), $observacao);
// creates a frame
$frame = new TFrame();
$frame->oid = 'frame-measures';
$frame->setLegend('Pagamentos:');
$row = $tablePagamento->addRow();
$cell = $row->addCell($frame);
$cell->colspan = 2;
$page2 = new TTable();
$frame->add($page2);
$page2->addRowSet(new TLabel('Valor Pgto:'), array($valor_pagamento, $tamanho_label = new TLabel('Valor Ultimo Pgto:'), $valor_ultimo_pgto));
$tamanho_label->setSize(150);
$page2->addRowSet(new TLabel('Data Pgto:'), array($data_pagamento, $tamanho_label = new TLabel('Data Ultimo Pgto:'), $data_ultimo_pgto));
$tamanho_label->setSize(150);
$page2->addRowSet(new TLabel('Valor Total:'), array($valor_total_parcial, $tamanho_label = new TLabel('Valor Total Pago: '), $valor_total_pago));
$tamanho_label->setSize(150);
$page2->addRowSet(new TLabel('Saldo a pagar:'), $valor_saldo);
$tablePagamento->addRowSet(new TLabel(''), $logado_id);
// Envia campos para o formulario
$this->form->setFields(array($id, $titulo, $data_inicio, $data_inicio_oculta, $data_encerramento, $data_cancelamento, $origem, $solicitacao_descricao, $nome_dtr, $providencia, $orcamento_horas, $orcamento_valor_hora, $valor_desconto, $valor_total, $forma_pagamento, $data_ultimo_pgto, $valor_ultimo_pgto, $valor_total_pago, $data_cadastro, $data_prevista, $data_aprovacao, $observacao, $tipo_ticket_id, $sistema_id, $status_ticket_id, $prioridade_id, $responsavel_id, $valor_total_parcial, $valor_pagamento, $data_pagamento, $valor_saldo, $combo_tipo_origens, $combo_codigo_origem, $combo_solicitante_id, $logado_id));
// create the form actions
$save_button = TButton::create('save', array($this, 'onSave'), _t('Save'), 'fa:floppy-o');
$new_button = TButton::create('new', array($this, 'onEdit'), _t('New'), 'fa:plus-square green');
$del_button = TButton::create('delete', array($this, 'onDelete'), _t('Delete'), 'fa:trash-o red fa-lg');
$list_button = TButton::create('list', array('TicketList', 'onReload'), _t('List'), 'fa:table blue');
$enviar_email = TButton::create('email', array($this, 'onEnviaEmail'), 'Enviar Email', 'ico_email.png');
$sincronizar = TButton::create('sincronizar', array($this, 'onSincronizarContatos'), 'Sincronizar Contatos', 'sincronizar.png');
$this->form->addField($save_button);
$this->form->addField($new_button);
$this->form->addField($del_button);
$this->form->addField($list_button);
$this->form->addField($enviar_email);
$this->form->addField($sincronizar);
$subtable = new TTable();
$row = $subtable->addRow();
$row->addCell($save_button);
$row->addCell($new_button);
$row->addCell($del_button);
$row->addCell($list_button);
$row->addCell($enviar_email);
$row->addCell($sincronizar);
$pretable = new TTable();
$pretable->style = 'width: 100%';
$row = $pretable->addRow();
$row->class = 'tformtitle';
// CSS class
$row->addCell(new TLabel('Cadastro de Ticket'))->colspan = 2;
$change_action = new TAction(array($this, 'onCalculaValorTotal'));
$orcamento_horas->setExitAction($change_action);
$orcamento_valor_hora->setExitAction($change_action);
$valor_desconto->setExitAction($change_action);
$change_data_action = new TAction(array($this, 'onChangeDataAction'));
$data_aprovacao->setExitAction($change_data_action);
$change_data_prev = new TAction(array($this, 'onChangeDataPrevista'));
$data_prevista->setExitAction($change_data_prev);
$change_data_pagamento = new TAction(array($this, 'onChangeDataPagamento'));
$data_pagamento->setExitAction($change_data_pagamento);
$change_valor = new TAction(array($this, 'onCalculaValorParcial'));
$valor_pagamento->setExitAction($change_valor);
$change_status = new TAction(array($this, 'onChangeDataInicio'));
$data_inicio->setExitAction($change_status);
$change_status = new TAction(array($this, 'onChangeDataCancelamento'));
$data_cancelamento->setExitAction($change_status);
$change_status = new TAction(array($this, 'onChangeDataEncerramento'));
$data_encerramento->setExitAction($change_status);
$change_origem = new TAction(array($this, 'onChangeOrigem'));
$combo_tipo_origens->setChangeAction($change_origem);
$change_tipo_origem = new TAction(array($this, 'onChangeTipoOrigem'));
$combo_codigo_origem->setChangeAction($change_tipo_origem);
$vbox = new TVBox();
$vbox->add($pretable);
$vbox->add($notebook);
$vbox->add($subtable);
$this->form->add($vbox);
parent::add($this->form);
}