[gen] Pod field: send pod results by emails.

This commit is contained in:
Gaetan Delannay 2014-09-17 18:09:30 +02:00
parent b565f38d97
commit 4947e2956c
13 changed files with 176 additions and 32 deletions

View file

@ -146,6 +146,7 @@ class ToolWrapper(AbstractWrapper):
<input type="hidden" name="customParams"/>
<input type="hidden" name="checkedUids"/>
<input type="hidden" name="checkedSem"/>
<input type="hidden" name="mailing"/>
<input type="hidden" name="action" value="generate"/>
</form>''')

View file

@ -1,4 +1,5 @@
# ------------------------------------------------------------------------------
from appy.fields.string import String
from appy.gen import WorkflowOwner
from appy.gen.layout import summaryPageLayouts
from appy.gen.wrappers import AbstractWrapper
@ -107,6 +108,14 @@ class UserWrapper(AbstractWrapper):
from AccessControl.AuthEncoding import pw_validate
return pw_validate(encryptedPassword, clearPassword)
def getMailRecipient(self):
'''Returns, for this user, the "recipient string" (first name, name,
email) as can be used for sending an email.'''
res = self.email or self.login
# Ensure this is really an email
if not String.EMAIL.match(res): return
return '%s <%s>' % (self.title, res)
def setLogin(self, oldLogin, newLogin):
'''Changes the login of this user from p_oldLogin to p_newLogin.'''
self.login = newLogin