Displays grades and education names in admin tableditor. Closes #1124
[platal.git] / modules / profile.php
index b3e04a7..d0c33ea 100644 (file)
@@ -740,8 +740,16 @@ class ProfileModule extends PLModule
         $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);
-        $table_editor->describe('eduid', 'formation', true);
-        $table_editor->describe('degreeid', 'niveau', true);
+        $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);
     }
     function handler_admin_sections(&$page, $action = 'list', $id = null) {