From ee199bc81682d57503014194b0005ef36f490f39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 7 Jun 2010 17:25:16 +0200 Subject: [PATCH] Fixes error in alternate sector and adds explanation for sector modification (Closes #1070, #1069). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/profile.php | 11 +++++++---- templates/profile/jobs.alternates.tpl | 7 ++++++- 2 files changed, 13 insertions(+), 5 deletions(-) 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: *} -- 2.1.4