Add link to the administration page of the account, use category instead
[platal.git] / modules / admin.php
index e0c5d04..e9fbae1 100644 (file)
@@ -413,7 +413,10 @@ class AdminModule extends PLModule
         if (Post::has('account_deletion_confirmation')) {
             $uid = $user->id();
             $name = $user->fullName();
-            $user->profile()->clear();
+            $profile = $user->profile();
+            if ($profile) {
+                $user->profile()->clear();
+            }
             $user->clear(true);
             $page->trigSuccess("L'utilisateur $name ($uid) a bien été supprimé.");
         }
@@ -1060,7 +1063,7 @@ class AdminModule extends PLModule
         // where several copies of the site use the same DB, but not the same "dynamic configuration"
         global $globals;
         $globals->updateNbValid();
-        $page->assign('vit', new ValidateIterator());
+        $page->assign('vit', Validate::iterate());
     }
 
     function handler_validate_answers(&$page, $action = 'list', $id = null)
@@ -1398,9 +1401,9 @@ class AdminModule extends PLModule
         $page->changeTpl('admin/jobs.tpl');
 
         if (Env::has('search')) {
-            $res = XDB::query("SELECT  e.id, e.name, e.acronym
-                                 FROM  profile_job_enum AS e
-                                WHERE  e.name LIKE CONCAT('% ', {?}, '%') OR e.acronym LIKE CONCAT('% ', {?}, '%')",
+            $res = XDB::query("SELECT  id, name, acronym
+                                 FROM  profile_job_enum
+                                WHERE  name LIKE CONCAT('%', {?}, '%') OR acronym LIKE CONCAT('%', {?}, '%')",
                               Env::t('job'), Env::t('job'));
 
             if ($res->numRows() <= 20) {