In the marketing administration page, fix display of marketings done by the mass...
authorOlivier Le Floch <olivier.le-floch@polytechnique.org>
Wed, 24 Sep 2008 19:15:40 +0000 (21:15 +0200)
committerOlivier Le Floch <olivier.le-floch@polytechnique.org>
Wed, 24 Sep 2008 19:15:40 +0000 (21:15 +0200)
  - The query uses a LEFT JOIN in case sender is not a valid uid,
  - If the sender is not found, then the template does not fill in his name in the output table.

modules/marketing.php
templates/marketing/private.tpl

index 9507cf5..eb0778d 100644 (file)
@@ -154,7 +154,7 @@ class MarketingModule extends PLModule
         $res = XDB::iterator(
                 "SELECT  r.*, a.alias
                    FROM  register_marketing AS r
-             INNER JOIN  aliases            AS a ON (r.sender=a.id AND a.type = 'a_vie')
+              LEFT JOIN  aliases            AS a ON (r.sender=a.id AND a.type = 'a_vie')
                   WHERE  uid={?}
                ORDER BY  date", $uid);
         $page->assign('addr', $res);
index aee32ff..85de8e3 100644 (file)
@@ -64,7 +64,7 @@ sa dernière relance date du {$relance|date_format}
     {iterate from=$addr item=a}
     <tr class="{cycle values='impair,pair'}">
       <td>{$a.email}</td>
-      <td><a href="profile/{$a.alias}" class="popup2">{$a.alias}</a> {if $a.type eq user}(*){/if}</td>
+      <td>{if $a.alias}<a href="profile/{$a.alias}" class="popup2">{$a.alias}</a> {if $a.type eq user}(*){/if}{/if}</td>
       <td>{$a.date|date_format|default:'-'}</td>
       <td>{$a.last|date_format|default:'-'}</td>
       <td class='center'>{$a.nb|default:"-"}</td>