Merge remote branch 'origin/xorg/maint' into xorg/master
[platal.git] / modules / profile / jobs.inc.php
index 8e2b35d..cc39c27 100644 (file)
@@ -224,7 +224,7 @@ class ProfileSettingJob implements ProfileSetting
             }
 
             if (isset($job['removed']) && $job['removed']) {
-                if ($job['name'] == '' && $entreprise) {
+                if ($job['name'] == '' && $entreprise && isset($entreprise[$entr_val - 1])) {
                     $entreprise[$entr_val - 1]->clean();
                 }
                 unset($value[$key]);
@@ -296,6 +296,9 @@ class ProfileSettingJob implements ProfileSetting
                                   VALUES  ' . implode(', ', $terms_values) . '
                  ON DUPLICATE KEY UPDATE  computed = VALUES(computed)');
         }
+        if (S::user()->isMe($page->owner) && count($value) > 1) {
+            Platal::page()->trigWarning('Attention, tu as plusieurs emplois sur ton profil. Pense à supprimer ceux qui sont obsolètes.');
+        }
     }
 
     public function getText($value)