コード例 #1
0
ファイル: newsletter.php プロジェクト: Ekleog/platal
 function handler_admin_nl_cat($page, $action = 'list', $id = null)
 {
     $nl = $this->getNl();
     if (!$nl) {
         return PL_NOT_FOUND;
     }
     if (!$nl->mayEdit()) {
         return PL_FORBIDDEN;
     }
     $page->setTitle('Administration - Newsletter : Catégories');
     $page->assign('title', 'Gestion des catégories de la newsletter');
     $table_editor = new PLTableEditor($nl->adminPrefix() . '/categories', 'newsletter_cat', 'cid');
     $table_editor->describe('title', 'intitulé', true);
     $table_editor->describe('pos', 'position', true);
     if ($nl->group == Newsletter::GROUP_XORG) {
         $table_editor->add_option_table('newsletters', 'newsletters.id = t.nlid');
         $table_editor->add_option_field('newsletters.name', 'newsletter_name', 'Newsletter', null, 'nlid');
         $table_editor->describe('nlid', 'ID NL', true);
     } else {
         $table_editor->force_field_value('nlid', $nl->id);
         $table_editor->describe('nlid', 'nlid', false, false);
     }
     // Prevent deletion.
     $table_editor->on_delete(null, null);
     $table_editor->apply($page, $action, $id);
 }
コード例 #2
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);
 }