Only deletes company if it is being replaced.
authorStéphane Jacob <sj@m4x.org>
Sat, 21 Aug 2010 17:24:54 +0000 (19:24 +0200)
committerStéphane Jacob <sj@m4x.org>
Sat, 21 Aug 2010 17:24:54 +0000 (19:24 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/admin.php

index 19f3ec5..ceb2da6 100644 (file)
@@ -1378,15 +1378,15 @@ class AdminModule extends PLModule
             XDB::execute("DELETE FROM  profile_addresses
                                 WHERE  jobid = {?} AND type = 'hq'",
                          $id);
-            XDB::execute('DELETE FROM  profile_job_enum
-                                WHERE  id = {?}',
-                         $id);
 
             if (Env::has('change')) {
                 XDB::execute('UPDATE  profile_job
                                  SET  jobid = {?}
                                WHERE  jobid = {?}',
                              Env::i('newJobId'), $id);
+                XDB::execute('DELETE FROM  profile_job_enum
+                                    WHERE  id = {?}',
+                             $id);
 
                 $page->trigSuccess("L'entreprise a bien été remplacée.");
             } else {