From 73682f225b86186e67c8b4c9406053bd99b354e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 17 Jul 2010 23:26:42 +0200 Subject: [PATCH] Orders lost user list by promo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/email.php | 17 +++++++++-------- templates/emails/lost.tpl | 4 +++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/email.php b/modules/email.php index 197ae8e..5fd93e9 100644 --- a/modules/email.php +++ b/modules/email.php @@ -794,15 +794,16 @@ class EmailModule extends PLModule { $page->changeTpl('emails/lost.tpl'); - // TODO: Order by promo. $page->assign('lost_emails', - XDB::iterator("SELECT a.uid, a.hruid - FROM accounts AS a - INNER JOIN email_options AS eo ON (eo.uid = a.uid) - LEFT JOIN emails AS e ON (a.uid = e.uid AND FIND_IN_SET('active', e.flags)) - WHERE e.uid IS NULL AND FIND_IN_SET('googleapps', eo.storage) = 0 AND - a.state = 'active' - ORDER BY a.hruid")); + XDB::iterator('SELECT a.uid, a.hruid, pd.promo + FROM accounts AS a + INNER JOIN email_options AS eo ON (eo.uid = a.uid) + LEFT JOIN emails AS e ON (a.uid = e.uid AND FIND_IN_SET(\'active\', e.flags)) + LEFT JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET(\'owner\', perms)) + LEFT JOIN profile_display AS pd ON (ap.pid = pd.pid) + WHERE e.uid IS NULL AND FIND_IN_SET(\'googleapps\', eo.storage) = 0 + AND a.state = \'active\' + ORDER BY pd.promo, a.hruid')); } function handler_broken_addr(&$page) diff --git a/templates/emails/lost.tpl b/templates/emails/lost.tpl index cdf4d1e..c3a40cc 100644 --- a/templates/emails/lost.tpl +++ b/templates/emails/lost.tpl @@ -26,10 +26,12 @@ - + + {assign var="promo" value=""} {iterate from=$lost_emails item="looser"} + -- 2.1.4
UtilisateurUtilisateur
{if $promo neq $looser.promo}{assign var="promo" value=$looser.promo}{$promo}{/if} {$looser.hruid}