From: Stéphane Jacob Date: Mon, 7 Jun 2010 15:25:16 +0000 (+0200) Subject: Fixes error in alternate sector and adds explanation for sector modification (Closes... X-Git-Tag: xorg/1.0.0~155 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ee199bc81682d57503014194b0005ef36f490f39;p=platal.git Fixes error in alternate sector and adds explanation for sector modification (Closes #1070, #1069). Signed-off-by: Stéphane Jacob --- diff --git a/modules/profile.php b/modules/profile.php index fd61642..077b3dc 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -443,10 +443,13 @@ class ProfileModule extends PLModule ORDER BY id', $sssect); $page->changeTpl('profile/jobs.alternates.tpl', NO_SKIN); - $alternate = $res->next(); - $alternates = $alternate['name']; - while ($alternate = $res->next()) { - $alternates .= ', ' . $alternate['name']; + $alternates = ''; + if ($res->total() > 0) { + $alternate = $res->next(); + $alternates = $alternate['name']; + while ($alternate = $res->next()) { + $alternates .= ', ' . $alternate['name']; + } } $page->assign('alternates', $alternates); } diff --git a/templates/profile/jobs.alternates.tpl b/templates/profile/jobs.alternates.tpl index c0707f1..46e06f8 100644 --- a/templates/profile/jobs.alternates.tpl +++ b/templates/profile/jobs.alternates.tpl @@ -21,6 +21,11 @@ {**************************************************************************} -({$alternates}) +{if $alternates} + ({$alternates}) +{else} + Il faut renseigner les 3 champs concernant le secteur + pour que celui-ci soit pris en compte lors de la validation. +{/if} {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}