Adds email_warning reminder.
authorStéphane Jacob <jacou@melix.net>
Tue, 5 May 2009 20:20:40 +0000 (22:20 +0200)
committerStéphane Jacob <jacou@melix.net>
Fri, 8 May 2009 19:44:03 +0000 (21:44 +0200)
include/reminder/email_warning.inc.php
templates/events/index.tpl
templates/reminder/email_warning.tpl [new file with mode: 0644]

index 886ada8..4e6689f 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+class ReminderEmailWarning extends Reminder
+{
+    public function HandleAction($action)
+    {
+        if ($action == 'dismiss') {
+            $this->UpdateOnDismiss();
+        }
+    }
+
+    protected function GetDisplayText() {}
+
+    public function Display(&$page)
+    {
+        header('Content-Type: text/html; charset=utf-8');
+        $page->changeTpl('reminder/email_warning.tpl', NO_SKIN);
+        $page->assign('baseurl', $this->GetBaseUrl());
+    }
+
+    public static function IsCandidate(User &$user)
+    {
+        return count(S::v('mx_failures', array())) > 0;
+    }
+}
+
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index 03f96dd..8c0914a 100644 (file)
@@ -57,21 +57,6 @@ Bienvenue {$smarty.session.prenom}{if $birthday}
 </div>
 {/if}
 
-{if $smarty.session.mx_failures|@count}
-<div class="warnings">
-  {icon name=error} Des problèmes sont actuellement recontrés sur tes redirections suivantes&nbsp;:
-  <ul>
-    {foreach from=$smarty.session.mx_failures item=mail}
-    <li>
-      <span class="erreur">{$mail.mail}</span> :
-      <span class="explication">{$mail.text}</span>
-    </li>
-    {/foreach}
-  </ul>
-  <div style="text-align: center"><a href="emails/redirect">Gérer mes adresses de redirection</a></div>
-</div>
-{/if}
-
 {if $fiche_incitation || $photo_incitation || ($geoloc_incitation > 0)}
 <div class="warnings">
   <ul>
diff --git a/templates/reminder/email_warning.tpl b/templates/reminder/email_warning.tpl
new file mode 100644 (file)
index 0000000..28aa0d1
--- /dev/null
@@ -0,0 +1,41 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<div class="warnings reminder">
+  <span style="float: right">
+    <a href="" onclick="Ajax.update_html('reminder', '{$baseurl}/dismiss')">
+      {icon name=cross title="Cacher cet avertissement."}
+    </a>
+  </span>
+  {icon name=error} Des problèmes sont actuellement recontrés sur tes redirections suivantes&nbsp;:
+  <ul>
+    {foreach from=$smarty.session.mx_failures item=mail}
+    <li>
+      <span class="erreur">{$mail.mail}</span> :
+      <span class="explication">{$mail.text}</span>
+    </li>
+    {/foreach}
+  </ul>
+  <div style="text-align: center"><a href="emails/redirect">Gérer mes adresses de redirection</a></div>
+</div>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}