Fixes anchors in emails/redirect.
authorStéphane Jacob <sj@m4x.org>
Fri, 29 Apr 2011 08:54:10 +0000 (10:54 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 29 Apr 2011 08:54:10 +0000 (10:54 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
include/emails.inc.php
templates/emails/redirect.tpl

index db35a5d..9776d80 100644 (file)
@@ -469,6 +469,7 @@ class Email
 
     // Basic email properties; $sufficient indicates if the email can be used as
     // an unique redirection; $redirect contains the delivery email address.
+    public $id;
     public $type;
     public $sufficient;
     public $email;
@@ -510,6 +511,11 @@ class Email
         }
         $this->sufficient = ($this->type == 'smtp' || $this->type == 'googleapps');
         $this->filter_level = ($this->type == 'imap') ? null : array_search($this->action, Bogo::$states);
+        if (array_key_exists($this->type , self::$storage_domains)) {
+            $this->id = $this->type;
+        } else {
+            $this->id = str_replace('@', '_at_', $this->email);
+        }
         $this->user = &$user;
     }
 
index fe168b3..4c691b4 100644 (file)
         <th>&nbsp;</th>
       </tr>
       {foreach from=$emails item=e name=redirect}
-      <tr class="{cycle values="pair,impair"}" id="line_{$e->email|replace:'@':'_at_'}">
+      <tr class="{cycle values="pair,impair"}" id="line_{$e->id}">
         <td>
           <strong>
             {if $e->broken}<span class="erreur">{assign var="error" value="1"}{/if}
           </a>
           {else}
           {if $e->sufficient}<span class="remove_email"><span style="display:none">&nbsp;</span></span>{/if}
-          <a href="emails/redirect#{$e->email}">{icon name=information title="Plus d'informations"}</a>
+          <a href="emails/redirect#{$e->type}">{icon name=information title="Plus d'informations"}</a>
           {/if}
         </td>
       </tr>