Source code for ploneintranet.todo.behaviors
from .vocabularies import todo_priority
from plone.autoform.interfaces import IFormFieldProvider
from plone.supermodel import model
from plone.supermodel.directives import fieldset
from ploneintranet.core import ploneintranetCoreMessageFactory as _
from zope.interface import Interface
from zope.interface import provider
from zope.schema import Bool
from zope.schema import Choice
from zope.schema import Date
from zope.schema import Text
from zope.schema import TextLine
[docs]@provider(IFormFieldProvider)
class IMustRead(model.Schema):
"""MustRead schema
"""
fieldset("settings", label=_(u"Settings"), fields=("mustread",))
mustread = Bool(
title=_(u"Must read"),
description=_(u"""Mark the content as "Must read" for all users."""),
default=False,
required=False,
)
[docs]class IMustReadMarker(Interface):
"""Marker interface that will be provided by instances using the
IMustRead behavior.
"""
[docs]@provider(IFormFieldProvider)
class ITodo(model.Schema):
"""Todo schema
"""
description = Text(title=u"Long description", required=False)
initiator = TextLine(
title=_(u"Initiator"),
description=_("The user (or group) who requested this task"),
required=False,
)
assignee = TextLine(
title=_(u"Assignee"),
description=_("A user (or a group) assigned to this task"),
required=False,
)
priority = Choice(
title=_(u"Priority"), required=True, default=-1, vocabulary=todo_priority
)
due = Date(title=_(u"Due date"), required=False)
[docs]class ITodoMarker(Interface):
"""Marker interface that will be provided by instances using the
ITodo behavior.
"""
[docs]@provider(IFormFieldProvider)
class IMilestone(model.Schema):
"""A text field representing the milestone associated with this todo item.
For example, the id of the associated workflow state of the container.
"""
milestone = TextLine(title=_(u"Milestone"), required=False)
[docs]class IMilestoneMarker(Interface):
"""Marker interface that will be provided by instances using the
IMilestone behavior.
"""