Nouvelle fonctionnalité : récupérer les adresses mails des adhérents à jour de leur cotisation uniquement. Ça ne change rien en début d'année mais c'est important vers la fin.

This commit is contained in:
Yohan Bataille 2014-09-10 17:29:22 +02:00
parent 32e6eb744a
commit de9909011a
3 changed files with 40 additions and 0 deletions

View File

@ -34,5 +34,25 @@ class GetEmailsController(AuthenticatedBaseController):
"emails" : emails
}
#end def
@expose("brie.templates.getemails.cotisation_paid")
def cotisation_paid(self, residence):
residence_name = residence
residence_dn = Residences.get_dn_by_name(self.user, residence_name)
members = Member.get_all(self.user, residence_dn)
emails = []
for member in members:
if CotisationComputes.is_cotisation_paid(member.dn, self.user, residence_dn):
emails.append(member.mail.first())
#end if
#end for
return {
"user" : self.user,
"residence" : residence_name,
"emails" : emails
}
#end def
#end class

View File

@ -0,0 +1,16 @@
<html xmlns:py="http://genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude">
<head>
<link rel="stylesheet" type="text/css" href="/css/common.css" />
<link rel="stylesheet" type="text/css" href="/css/show.css" />
<xi:include href="common-css-header.html" />
</head>
<body>
<xi:include href="navbar.html" />
<div class="section" >
<span class="section_name show_section_name">Adresses mails des adhérents ${residence} avec un logement attribué et une cotisation à jour.</span>
<div py:for="email in emails">
${email}<br />
</div>
</div>
</body>
</html>

View File

@ -13,6 +13,10 @@
<input type="hidden" name="residence" value="${residence}"/>
<input type="submit" value="Récupérer toutes les adresses mails" class="button"/>
</form>
<form action="/getemails/cotisation_paid" method="post" class="inline_block">
<input type="hidden" name="residence" value="${residence}"/>
<input type="submit" value="Récupérer les adresses mails des adhérents actifs" class="button"/>
</form>
</div>
<table class="table table-hover">
<tr>