From 003fafc0087083e13ec21e2ac9d01f0016600b30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 17 Jul 2009 17:15:12 +0200 Subject: [PATCH] Fixes the profile_update reminder. --- include/reminder/profile_update.inc.php | 9 ++------- templates/reminder/profile_update.tpl | 14 +++++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/reminder/profile_update.inc.php b/include/reminder/profile_update.inc.php index c07e741..397b1a5 100644 --- a/include/reminder/profile_update.inc.php +++ b/include/reminder/profile_update.inc.php @@ -50,7 +50,7 @@ class ReminderProfileUpdate extends Reminder parent::Prepare($page); $res = XDB::query('SELECT date < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_profile_old, - date AS profile_date, LENGTH(p.attach) > 0 AS photo + date AS profile_date, LENGTH(p.attach) > 0 AS has_photo FROM auth_user_md5 AS u LEFT JOIN photo AS p ON (u.user_id = p.uid) WHERE user_id = {?}', @@ -59,16 +59,11 @@ class ReminderProfileUpdate extends Reminder $page->assign('profile_incitation', $is_profile_old); $page->assign('profile_last_update', $profile_date); - $page->assign('photo_incitation', $has_photo); + $page->assign('photo_incitation', !$has_photo); require_once 'geoloc.inc.php'; $res = localize_addresses($this->user->id()); $page->assign('geocoding_incitation', count($res)); - - $page->assign('incitations_count', - ($is_profile_old ? 1 : 0) + - ($has_photo ? 0 : 1) + - (count($res) > 0 ? 1 : 0)); } public function template() diff --git a/templates/reminder/profile_update.tpl b/templates/reminder/profile_update.tpl index 065d949..497dc7e 100644 --- a/templates/reminder/profile_update.tpl +++ b/templates/reminder/profile_update.tpl @@ -24,16 +24,16 @@ La dernière mise à jour de ta fiche date du {$profile_last_update|date_format}. Il est possible qu'elle ne soit pas à jour. Si tu souhaites la modifier, - + clique ici ! {elseif $photo_incitation} - Tu n'as pas mis de photo de toi sur ta fiche, c'est dommage. Clique - - ici si tu souhaites en ajouter une. + Tu n'as pas mis de photo de toi sur ta fiche, c'est dommage. + + Clique ici si tu souhaites en ajouter une. {elseif $geocoding_incitation > 0} - Parmi tes adresses, il y en a {$geocoding_incitation} que nous n'avons pas pu localiser. Clique - - ici pour rectifier. + Parmi tes adresses, il y en a {$geocoding_incitation} que nous n'avons pas pu localiser. + + Clique ici pour rectifier. {/if}
-- 2.1.4