#127: promo columns in member view
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 27 Jul 2006 15:56:25 +0000 (15:56 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 27 Jul 2006 15:56:25 +0000 (15:56 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@680 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
include/lists.inc.php
templates/listes/members.tpl

index 22a5acd..7820d53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,6 +84,9 @@ Bug/Wish:
     * Emails:
         - #426: Add an identification header in mails.                     -FRU
 
+    * Lists:
+        - #127: Add promo in member list when sorted by name               -FRU
+
     * Profile:
         - #344: Tels can be bigger (up to 30 chars).                       -Car
 
index 15f0d67..a670cce 100644 (file)
@@ -53,7 +53,7 @@ function list_sort_owners(&$members, $tri_promo = true) {
                                           WHERE  a.alias = {?}', $m);
             if(list($prenom, $nom, $promo) = $res->fetchOneRow()) {
                 $key = $tri_promo ? $promo : strtoupper($nom{0});
-                $membres[$key][$nom.$m] = Array('n' => "$prenom $nom", 'l' => $m);
+                $membres[$key][$nom.$m] = Array('n' => "$prenom $nom", 'l' => $m, 'p' => (!$tri_promo ? $promo : null));
             } else {
                 $membres[0][] = Array('l' => $mem);
             }
@@ -61,7 +61,7 @@ function list_sort_owners(&$members, $tri_promo = true) {
             $res = XDB::query('SELECT prenom, nom FROM groupex.membres WHERE email={?}', $mem);
             if (list($prenom, $nom) = $res->fetchOneRow()) {
                 $key = $tri_promo ? 0 : strtoupper($nom{0});
-                $membres[$key][$nom.$m] = Array('n' => "$prenom $nom", 'l' => $mem);
+                $membres[$key][$nom.$m] = Array('n' => "$prenom $nom", 'l' => $mem, 'p' => (!$tri_promo ? 'non-X' : null));
             } else {
                 $membres[0][] = Array('l' => $mem);
             }
index 8a2673b..2777da8 100644 (file)
 {if $owners|@count}
 <table class='tinybicol' cellpadding='0' cellspacing='0'>
   {foreach from=$owners item=xs key=promo}
+  {foreach from=$xs item=x name=all}
   <tr>
-    <td class='titre'>{if $promo}{$promo}{else}non-X{/if}</td>
+    <td class='titre'>
+      {if $smarty.foreach.all.first}
+      {if $promo}{$promo}{else}non-X{/if}
+      {/if}
+    </td>
     <td>
-      {foreach from=$xs item=x}
       {if $promo}
-      <a href="profile/{$x.l}" class="popup2">{$x.n}</a><br />
+      <a href="profile/{$x.l}" class="popup2">{$x.n}</a>
       {else}
-      {$x.l}<br />
+      {$x.l}
       {/if}
-      {/foreach}
     </td>
+    {if $x.p}
+    <td class="right">
+      {$x.p}
+    </td>
+    {/if}
   </tr>
   {/foreach}
+  {/foreach}
 </table>
 {/if}
 
 {if $members|@count}
 <table class='bicol' cellpadding='0' cellspacing='0'>
   {foreach from=$members item=xs key=promo}
+  {foreach from=$xs item=x name=all}
   <tr>
-    <td class='titre'>{if $promo}{$promo}{else}non-X{/if}</td>
+    <td class='titre' style="width: 20%">
+      {if $smarty.foreach.all.first}
+      {if $promo}{$promo}{else}non-X{/if}
+      {/if}
+    </td>
     <td>
-      {foreach from=$xs item=x}
       {if $promo}
-      <a href="profile/{$x.l}" class="popup2">{$x.n}</a><br />
+      <a href="profile/{$x.l}" class="popup2">{$x.n}</a>
       {else}
-      {$x.l}<br />
+      {$x.l}
       {/if}
-      {/foreach}
     </td>
+    {if $x.p}
+    <td class="right">
+      {$x.p}
+    </td>
+    {/if}
   </tr>
   {/foreach}
+  {/foreach}
 </table>
 {/if}