From be6806fa1366d924c8c85a6159a754f0f9e27763 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 26 Jun 2010 00:46:35 +0200 Subject: [PATCH] Allows empty grad years (Closes #1155). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/profile/general.inc.php | 9 ++++----- templates/profile/general.edu.tpl | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) 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) -- 2.1.4