From: Vincent Zanotti Date: Thu, 20 Mar 2008 10:22:54 +0000 (+0100) Subject: Adds 'last activity' information in the dead-but-still-alive table. X-Git-Tag: xorg/0.9.16~95 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f0eb8c993efa6dc5be13e5b1cd8521f2cd9e44bd;p=platal.git Adds 'last activity' information in the dead-but-still-alive table. Signed-off-by: Vincent Zanotti --- diff --git a/modules/admin.php b/modules/admin.php index 92a2107..976be74 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -841,11 +841,12 @@ class AdminModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Administration - Décédés'); $res = XDB::iterator( - "SELECT u.promo, u.nom, u.prenom, u.deces, u.matricule_ax, a.alias, - DATEDIFF(NOW(), u.deces) AS days + "SELECT u.promo, u.nom, u.prenom, u.deces, u.matricule_ax, a.alias, DATE(MAX(s.start)) AS last FROM auth_user_md5 AS u LEFT JOIN aliases AS a ON (a.id = u.user_id AND a.type = 'a_vie') + LEFT JOIN logger.sessions AS s ON (s.uid = u.user_id AND suid = 0) WHERE perms IN ('admin', 'user') AND deces <> 0 + GROUP BY u.user_id ORDER BY u.promo, u.nom"); $page->assign('dead', $res); } diff --git a/templates/admin/dead_but_active.tpl b/templates/admin/dead_but_active.tpl index cb3813c..b7ecb11 100644 --- a/templates/admin/dead_but_active.tpl +++ b/templates/admin/dead_but_active.tpl @@ -29,10 +29,10 @@ - + - - + + {iterate from=$dead item=d} @@ -46,13 +46,7 @@ {/iterate}
PromotionPromo État civilDate de décèsdepuisDécèsDernière activité
{$d.prenom} {$d.nom} {$d.deces} - {if $d.days gt 730} - {$d.days/365|string_format:"%d"} ans - {elseif $d.days gt 365} - 1 an - {else} - {$d.days/30.5|string_format:"%d"} mois - {/if} + {if $d.last gt $d.deces}{$d.last}{elseif $d.last}{$d.last}{else}-{/if}