def _get_notify_email_response_subject_message(self):
     default = u"""string:Notification: New registration for ${object/Title} has been received"""
     if False:
         foo = _(u'notify_email_response_subject', default=u"""string:Notification: New registration for ${object/Title} has been received""")
     translation_service = getToolByName(self,'translation_service')
     return translation_service.utranslate(domain='signupsheet',
                                          msgid=u'notify_email_response_subject',
                                          default=default,
                                          context=self)
Esempio n. 2
0
def registrantAdded(obj, event):
    """A new registrant added"""
    
    ftool = getToolByName(obj, 'portal_factory')
    if not ftool.isTemporary(obj):
        ssheet = aq_parent(obj)
        if ssheet.getEventsize() and ssheet.getSeatsLeft() < 0:
            ptool = getToolByName(obj, 'plone_utils')
            transaction.abort()
            ptool.addPortalMessage(_(u"Can't subscribe. No more free slots"), type='error')
    def _get_notify_email_response_message(self):
        default = u"""<tal:block tal:define="registrant nocall:options/registrant">New registrant registered for <tal:s tal:content="context/Title" />
Please check current registrans: <tal:s tal:content="string:${context/absolute_url}/view_registrants" />
</tal:block>
"""
        if False:
            foo = _(u'notify_email_response_message', u"""<tal:block tal:define="registrant nocall:options/registrant">New registrant registered for <tal:s tal:content="context/Title" />
Please check current registrans: <tal:s tal:content="string:${context/absolute_url}/view_registrants" />
</tal:block>
""")
        translation_service = getToolByName(self,'translation_service')
        return translation_service.utranslate(domain='signupsheet',
                                             msgid=u'notify_email_response_message',
                                             default=default,
                                             context=self)
    def _get_email_response_message(self):
        default = u"""<tal:block tal:define="registrant nocall:options/registrant">Thank you for registering to <tal:s tal:content="context/Title" />
Your status is: <tal:s tal:replace="registrant/computeStatus">registered</tal:s>
Your email is: <tal:e tal:content="registrant/email" />
</tal:block>
"""
        if False:
            foo = _(u'default_email_response_message', default = u"""<tal:block tal:define="registrant nocall:options/registrant">Thank you for registering to <tal:s tal:content="context/Title" />
Your status is: <tal:s tal:replace="registrant/computeStatus">registered</tal:s>
Your email is: <tal:e tal:content="registrant/email" />
</tal:block>
""")
        translation_service = getToolByName(self,'translation_service')
        return translation_service.utranslate(domain='signupsheet',
                                             msgid=u'default_email_response_message',
                                             default=default,
                                             context=self)
    def _get_thank_you_text_message(self):
        default = u"""<tal:block tal:define="registrant nocall:options/registrant">Thank you for registering, we will contact you shortly. <br/>
You provided the following information:<br />
Name: <strong tal:content="registrant/computeFullname" /><br/>
Email: <strong tal:content="registrant/email" /><br/>
</tal:block>
"""
        if False:
            foo = _(u'default_thank_you_text', default=u"""<tal:block tal:define="registrant nocall:options/registrant">Thank you for registering, we will contact you shortly. <br/>
You provided the following information:<br />
Name: <strong tal:content="registrant/computeFullname" /><br/>
Email: <strong tal:content="registrant/email" /><br/>
</tal:block>
""")
        translation_service = getToolByName(self,'translation_service')
        return translation_service.utranslate(domain='signupsheet',
                                             msgid=u'default_thank_you_text',
                                             default=default,
                                             context=self)
from Products.CMFCore.utils import getToolByName

#ATSchemaEditorNG
from Products.ATSchemaEditorNG.ParentManagedSchema import ParentManagedSchema, ParentOrToolManagedSchema
from Products.ATSchemaEditorNG.config import ATSE_MANAGED_NONE, ATSE_MANAGED_FULL
from Products.SignupSheet.config import PROJECTNAME

#ATContentTypes
from Products.ATContentTypes.content.document import finalizeATCTSchema

RegistrantSchema = BaseContent.schema.copy() + Schema(( 

    StringField('first_name',
        default_method="getMemberName",
        widget=StringWidget(
            label=_(u"First name")
        )
    ),
     
    StringField('last_name',
        default_method="getMemberLastName",
        widget=StringWidget(
            label=_(u"Last name")
        )
    ),
    
    StringField('status',
        write_permission = """SignupSheet: View Registration Info""",
        atse_managed=ATSE_MANAGED_NONE,
        read_permission="SignupSheet: View Registration Info",
        vocabulary = [('registered','registered','label_registered'),('waitinglist','waitinglist','label_waitinglist')],