From 8138ece0fda73a1fe4b816c9ad87a0b4eb449087 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Thu, 27 Jul 2006 15:56:25 +0000 Subject: [PATCH] #127: promo columns in member view git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@680 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 3 +++ include/lists.inc.php | 4 ++-- templates/listes/members.tpl | 38 ++++++++++++++++++++++++++++---------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22a5acd..7820d53 100644 --- 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 diff --git a/include/lists.inc.php b/include/lists.inc.php index 15f0d67..a670cce 100644 --- a/include/lists.inc.php +++ b/include/lists.inc.php @@ -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); } diff --git a/templates/listes/members.tpl b/templates/listes/members.tpl index 8a2673b..2777da8 100644 --- a/templates/listes/members.tpl +++ b/templates/listes/members.tpl @@ -86,19 +86,28 @@ {if $owners|@count} {foreach from=$owners item=xs key=promo} + {foreach from=$xs item=x name=all} - + + {if $x.p} + + {/if} {/foreach} + {/foreach}
{if $promo}{$promo}{else}non-X{/if} + {if $smarty.foreach.all.first} + {if $promo}{$promo}{else}non-X{/if} + {/if} + - {foreach from=$xs item=x} {if $promo} - {$x.n}
+ {$x.n} {else} - {$x.l}
+ {$x.l} {/if} - {/foreach}
+ {$x.p} +
{/if} @@ -114,19 +123,28 @@ {if $members|@count} {foreach from=$members item=xs key=promo} + {foreach from=$xs item=x name=all} - + + {if $x.p} + + {/if} {/foreach} + {/foreach}
{if $promo}{$promo}{else}non-X{/if} + {if $smarty.foreach.all.first} + {if $promo}{$promo}{else}non-X{/if} + {/if} + - {foreach from=$xs item=x} {if $promo} - {$x.n}
+ {$x.n} {else} - {$x.l}
+ {$x.l} {/if} - {/foreach}
+ {$x.p} +
{/if} -- 2.1.4