From b50bf10c63f4e78a0a2a1aab0940a1bce4e8b449 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 9 Apr 2012 22:57:49 +0200 Subject: [PATCH] Displays when last email to remind the user about her xnet account was sent. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/xnetgrp.php | 8 +++ templates/xnetgrp/awaiting_active.tpl | 84 ++++++++++++++++++++++++++++++ upgrade/1.1.5/07_register_pending_xnet.sql | 1 + 3 files changed, 93 insertions(+) create mode 100644 templates/xnetgrp/awaiting_active.tpl create mode 100644 upgrade/1.1.5/07_register_pending_xnet.sql diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index e0ea0d4..933d6d2 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -638,6 +638,10 @@ class XnetGrpModule extends PLModule FROM register_pending_xnet WHERE uid = {?}', $uid); + XDB::execute('UPDATE register_pending_xnet + SET last_date = NOW() + WHERE uid = {?}', + $uid); $mailer = new PlMailer('xnet/account.mail.tpl'); $mailer->addCc('validation+xnet_account@polytechnique.org'); @@ -679,10 +683,14 @@ class XnetGrpModule extends PLModule $registration_date = XDB::fetchAllAssoc('uid', 'SELECT uid, date FROM register_pending_xnet WHERE uid IN {?}', $uids); + $last_date = XDB::fetchAllAssoc('uid', 'SELECT uid, last_date + FROM register_pending_xnet + WHERE uid IN {?}', $uids); $users = User::getBulkUsersWithUIDs($uids); $page->assign('users', $users); $page->assign('registration_date', $registration_date); + $page->assign('last_date', $last_date); } diff --git a/templates/xnetgrp/awaiting_active.tpl b/templates/xnetgrp/awaiting_active.tpl new file mode 100644 index 0000000..a3cd289 --- /dev/null +++ b/templates/xnetgrp/awaiting_active.tpl @@ -0,0 +1,84 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2011 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{if $users|@count} +
+ {xsrf_token_field} + + + + + + + + + {foreach from=$users item=user} + {assign var=uid value=$user->id()} + + + + + + + + {/foreach} + + + +
NomEmailDemande d'activationDernière relance + {icon name="arrow_refresh" title="Tout (dé)cocher"} +
{profile user=$user promo=true}{$user->email}{$registration_date.$uid|date_format:"%x"}{$last_date.$uid|date_format:"%x"}
+ +
+ + + +
+{else} +

Il n'y a aucun compte en attente d'activation pour ce groupe.

+{/if} + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/upgrade/1.1.5/07_register_pending_xnet.sql b/upgrade/1.1.5/07_register_pending_xnet.sql new file mode 100644 index 0000000..9609300 --- /dev/null +++ b/upgrade/1.1.5/07_register_pending_xnet.sql @@ -0,0 +1 @@ +ALTER TABLE register_pending_xnet ADD COLUMN last_date DATE AFTER date; -- 2.1.4