Happy New Year!
[platal.git] / modules / profile.php
index a7f4b03..5617b7c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -30,7 +30,7 @@ class ProfileModule extends PLModule
             'fiche.php'                  => $this->make_hook('fiche',                      AUTH_PUBLIC),
             'profile'                    => $this->make_hook('profile',                    AUTH_PUBLIC),
             'profile/private'            => $this->make_hook('profile',                    AUTH_COOKIE),
-            'profile/ax'                 => $this->make_hook('ax',                         AUTH_COOKIE, 'admin'),
+            'profile/ax'                 => $this->make_hook('ax',                         AUTH_COOKIE, 'admin,edit_directory'),
             'profile/edit'               => $this->make_hook('p_edit',                     AUTH_MDP),
             'profile/ajax/address'       => $this->make_hook('ajax_address',               AUTH_COOKIE, 'user', NO_AUTH),
             'profile/ajax/tel'           => $this->make_hook('ajax_tel',                   AUTH_COOKIE, 'user', NO_AUTH),
@@ -330,7 +330,6 @@ class ProfileModule extends PLModule
         }
 
         // Build the page
-        $page->addJsLink('ajax.js');
         $page->addJsLink('education.js', false); /* dynamic content */
         $page->addJsLink('grades.js', false);    /* dynamic content */
         $page->addJsLink('profile.js');
@@ -757,10 +756,10 @@ class ProfileModule extends PLModule
         $table_editor->describe('degree', 'niveau', true);
         $table_editor->apply($page, $action, $id);
     }
-    function handler_admin_education_degree_set(&$page, $action = 'list', $id = null) {
+    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);
+        $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);
 
@@ -771,7 +770,7 @@ class ProfileModule extends PLModule
         $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);
+        $table_editor->apply($page, $action, $id, $id2);
     }
     function handler_admin_sections(&$page, $action = 'list', $id = null) {
         $page->setTitle('Administration - Sections');