def __call__(self, value, *args, **kwargs): Wrongs=[] for email in value: try: checkEmailAddress(email) except EmailAddressInvalid: Wrongs.append(email) if len(Wrongs)==1: return _(u"The next email address is invalid: %s") % (Wrongs[0]) elif len(Wrongs)>1: spanWrong=", ".join(Wrongs) return _(u"The nexts email addresses are invalid: %s ") % (spanWrong) else: pass
def SendEmail(object, evt): host = getToolByName(object, 'MailHost') message=_(u"""The project entitle %s to which you are subscribed has been modified you can see it in %s """) % (object.title, object.absolute_url()) ToList=evt.object.suscribers From=host.smtp_userid Subject=_(u"Modified Content %s") % (object.title) if ToList == "" or ToList==[]: return else: try: host.secureSend(message, ToList, From,subject=Subject, subtype='plain', charset='UTF-8') except MailHostError: logger = logging.getLogger("cenditel.ppm.events.SedEmail") logger.warning ("We sorry, we cold not send the email because the mail host was not configure") except SMTPRecipientsRefused: logger = logging.getLogger("cenditel.ppm.events.SedEmail") logger.warning ("We sorry, we cold not send the email because one or more recipiendts has been refused") raise SMTPRecipientsRefused('Recipient address rejected by server')
def title(self): return _(u"Navigation PPM")
from cenditel.ppm import CenditelPpmMF as _ from cenditel.ppm.config import PROJECTNAME from cenditel.ppm.interfaces import IProposals from cenditel.ppm.validator import GroupsValidator from Products.DataGridField import DataGridField, DataGridWidget from Products.FCKeditor.FckWidget import FckWidget proposalsSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.TextField( name='templatest', widget=FckWidget( label=_(u"Summary"), description=_(u"Proposal summary of a future project"), allow_file_upload=False, rows=5, cols=40, ), allowable_content_types = ('text/html',), default_content_type = 'text/html', default_output_type = 'text/x-html-safe', storage=atapi.AnnotationStorage(), validators=('isTidyHtmlWithCleanup',), searchable=True, required=False ), DataGridField(
from cenditel.ppm.validator import SuscriberValidator #from cenditel.ppm.validator import UsersValidator projectSchema = folder.ATFolderSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.LinesField( name='manager', required=True, searchable=True, storage = atapi.AnnotationStorage(), vocabulary_factory="cenditel.ppm.user", widget=InAndOutWidget( size = 10, label=_(u"Manager"), description=_(u"Project Manager"), ), #schemata='Project', ), atapi.StringField( name='status', widget=atapi.SelectionWidget( format='select', label=_(u"Status"), description=_(u"Project Status"), ), vocabulary=SCHEDULE_STATUS_PROJECT, schemata='Project',
from Products.Archetypes.utils import DisplayList from cenditel.ppm import CenditelPpmMF as _ PROJECTNAME = 'cenditel.ppm' ADD_PERMISSIONS = { 'PPM': 'cenditel.ppm: Add PPM', 'Proposals': 'cenditel.ppm: Add Proposals', 'Project': 'cenditel.ppm: Add Project', } TYPE_SUBFOLDER_PROJECT = DisplayList(( ("Event", _(u"Events/Activities")), ("Folder", _(u"Folder")), ("Ploneboard", _(u"Discussions board")), ("PoiTracker", _(u"Demands")), ("Weblog", _(u"Blog")), )) SCHEDULE_STATUS_PROJECT = DisplayList(( ("est", _(u"Estimated")), # none ("comm", _(u"Committed")), # none ("plan", _(u"In Planning")), # yellow ("hold", _(u"On Hold")), # none ("ipa", _(u"In Process - Ahead of Schedule")), # green ("ipb", _(u"In Process - Begin Schedule")), # red ("ipo", _(u"In Process - On Schedule")), # green ("comp", _(u"Completed")), # none
def title(self): return _(u"Projects Dashboard")
def __call__(self, value, *args, **kwargs): Dic=value[0] value = str(value) if Dic['Title']=='': return (_(u'A user required to select, please correct.'))
def __call__(self, value, *args, **kwargs): Dic=value[0] value = str(value) if Dic['Title']=='': return _(u'Group required, please correct.')
def title(self): return _(u"Project Proposals Dashboard")