function handler_adm_bankaccounts($page, $action = "list", $id = null) { // managment of bank account used for money transfert $page->setTitle('Administration - Paiements - RIBs'); $page->assign('title', "Liste des RIBs"); $table_editor = new PLTableEditor('admin/payments/bankaccounts', 'payment_bankaccounts', 'id'); $table_editor->describe('asso_id', 'ID du groupe', false, true); $table_editor->describe('owner', 'titulaire', true); $table_editor->add_option_table('groups', 'groups.id = t.asso_id'); $table_editor->add_option_field('groups.diminutif', 'group_name', 'groupe', 'varchar', 'iban'); $table_editor->add_sort_field('status'); $table_editor->add_sort_field('group_name', false); /* check RIB key FIXME: the column format (and name) changed if ($action == 'update' && Post::has('account') && !check_rib(Post::v('account'))) { $page->trigError("Le RIB n'est pas valide"); $table_editor->apply($page, 'edit', $id); return; } */ $table_editor->apply($page, $action, $id); }
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); }
function handler_admin_education_degree_set($page, $action = 'list', $id = null, $id2 = null) { $page->setTitle('Administration - Correspondances formations - niveau de formation'); $page->assign('title', 'Gestion des correspondances formations - niveau de formation'); $table_editor = new PLTableEditor('admin/education_degree_set', 'profile_education_degree', 'eduid', true, 'degreeid'); $table_editor->describe('eduid', 'id formation', true); $table_editor->describe('degreeid', 'id niveau', true); // Adds fields to show the names of education $table_editor->add_option_table('profile_education_enum', 'profile_education_enum.id = eduid'); $table_editor->add_option_field('profile_education_enum.name', 'edu_name', 'formation', null, 'degreeid'); // Adds fields to show the names of degrees $table_editor->add_option_table('profile_education_degree_enum', 'profile_education_degree_enum.id = t.degreeid'); $table_editor->add_option_field('profile_education_degree_enum.degree', 'degree_name', 'niveau'); $table_editor->apply($page, $action, $id, $id2); }