コード例 #1
0
ファイル: payment.php プロジェクト: Ekleog/platal
 function handler_admin($page, $action = 'list', $id = null)
 {
     $page->setTitle('Administration - Paiements');
     $page->assign('title', 'Gestion des télépaiements');
     $table_editor = new PLTableEditor('admin/payments', 'payments', 'id');
     $table_editor->add_sort_field('flags');
     $table_editor->add_sort_field('id', true, true);
     $table_editor->on_delete("UPDATE payments SET flags = 'old' WHERE id = {?}", "Le paiement a été archivé");
     $table_editor->describe('text', 'intitulé', true);
     $table_editor->describe('url', 'site web', false, true);
     $table_editor->describe('amount_def', 'montant par défaut', false, true);
     $table_editor->describe('amount_min', 'montant minimum', false, true);
     $table_editor->describe('amount_max', 'montant maximum', false, true);
     $table_editor->describe('mail', 'email contact', true);
     $table_editor->describe('confirmation', 'message confirmation', false, true);
     $table_editor->describe('rib_id', 'RIB', false, true);
     // adds a column with the start date of the linked event if there is one
     $table_editor->add_option_table('group_events', 'group_events.paiement_id = t.id');
     $table_editor->add_option_field('group_events.archive', 'related_event', 'évènement archivé ?', 'tinyint');
     // adds a column with the linked rib if there is one
     $table_editor->add_option_table('payment_bankaccounts', 'payment_bankaccounts.id = t.rib_id');
     $table_editor->add_option_field('payment_bankaccounts.owner', 'linked_rib_owner', 'rib associé', 'varchar');
     // adds a link to the table of all the transactions
     $table_editor->addLink('id', "admin/payments/transactions/");
     $table_editor->apply($page, $action, $id);
 }