From: Stéphane Jacob Date: Fri, 25 Jun 2010 22:46:35 +0000 (+0200) Subject: Allows empty grad years (Closes #1155). X-Git-Tag: xorg/1.0.0~28 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=be6806fa1366d924c8c85a6159a754f0f9e27763;p=platal.git Allows empty grad years (Closes #1155). Signed-off-by: Stéphane Jacob --- diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 13106c1..c0dcfa8 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -237,8 +237,8 @@ class ProfileSettingEdu implements ProfileSetting } static function sortByGradYear($line1, $line2) { - $a = (int) $line1['grad_year']; - $b = (int) $line2['grad_year']; + $a = (isset($line1['grad_year'])) ? (int) $line1['grad_year'] : 0; + $b = (isset($line2['grad_year'])) ? (int) $line2['grad_year'] : 0; if ($a == $b) { return 0; } @@ -259,9 +259,8 @@ class ProfileSettingEdu implements ProfileSetting $i = 0; foreach ($value as $key=>&$edu) { if (($edu['grad_year'] < 1921) || ($edu['grad_year'] > (date('Y') + 4))) { - Platal::page()->trigError('L\'année d\'obtention du diplôme est mal renseignée, elle doit être du type : 2004.'); - $edu['error'] = true; - $success = false; + Platal::page()->trigWarning('L\'année d\'obtention du diplôme est mal ou non renseignée, elle doit être du type : 2004.'); + $edu['warning'] = true; } if ($key != $i) { $value[$i] = $edu; diff --git a/templates/profile/general.edu.tpl b/templates/profile/general.edu.tpl index 8a3c4c5..51ff4c7 100644 --- a/templates/profile/general.edu.tpl +++ b/templates/profile/general.edu.tpl @@ -59,7 +59,7 @@ Année d'obtention du diplôme : - (par exemple : 2008)