Exemplo n.º 1
0
from Products.Archetypes.public import *

from Products.CMFCore.utils import getToolByName

from Products.Extropy.config import *
from Products.Extropy.interfaces import IExtropyBase
from Products.Extropy.interfaces import IExtropyTracking
from Products.Extropy.content.ExtropyBase import TimeSchema
from Products.Extropy.content.ExtropyBase import BudgetSchema
from Products.Extropy.content.ExtropyBase import ExtropyBase
from Products.Extropy.content.ExtropyBase import ExtropyBaseSchema
from Products.Extropy.content.ExtropyTracking import ExtropyTracking


ExtropyProjectSchema = ExtropyBaseSchema.copy() + Schema((

    LinesField(
        name='participants',
        vocabulary='getAvailableParticipants',
        multiValued=1,
        widget=InAndOutWidget(
            label='Participants',
            description='',
            label_msgid='label_participants',
            description_msgid='help_participants',
            i18n_domain='extropy',
        ),
    ),

    StringField(
Exemplo n.º 2
0
from zope.interface import implements

from AccessControl import ClassSecurityInfo
from Products.Archetypes.public import *
from Products.CMFCore.utils import getToolByName
from Products.Extropy.content.ExtropyBase import ExtropyBase
from Products.Extropy.content.ExtropyBase import ExtropyBaseSchema, ParticipantsSchema
from Products.Extropy.content.ExtropyTracking import ExtropyTracking
from Products.Extropy.config import *
from Products.Extropy.interfaces import *

ActivitySchema = ExtropyBaseSchema.copy()+ ParticipantsSchema.copy() + Schema((
    ))

del ActivitySchema['responsiblePerson']

class ExtropyActivity(ExtropyTracking, ExtropyBase, BaseFolder ):
    """Activity is ongoing work that needs hour-registration"""
    implements(IExtropyBase, IExtropyTracking)

    schema = ActivitySchema

    security = ClassSecurityInfo()

    _at_rename_after_creation = True

    def getWorkedHours(self):
        """get the total amount of time worked for this object"""
        tool = getToolByName(self,TIMETOOLNAME)
        return tool.countIntervalHours(node=self)
Exemplo n.º 3
0
from AccessControl import ClassSecurityInfo

from Products.Archetypes.public import *

from Products.CMFCore import permissions
from Products.CMFCore.utils import getToolByName

from Products.Extropy.config import *
from Products.Extropy.interfaces import IExtropyBase
from Products.Extropy.interfaces import IExtropyTracking
from Products.Extropy.content.ExtropyBase import ExtropyBase
from Products.Extropy.content.ExtropyBase import TimeSchema,ExtropyBaseSchema,  BudgetSchema
from Products.Extropy.content.ExtropyTracking import ExtropyTracking


ExtropyPhaseSchema = ExtropyBaseSchema.copy() + TimeSchema.copy() + BudgetSchema.copy()


class ExtropyPhase(ExtropyTracking, ExtropyBase, BaseFolder):
    """A Package is a unit of work that contains a number of tasks. Aka. milestone in other systems."""
    implements(IExtropyTracking, IExtropyBase)

    schema = ExtropyPhaseSchema
    _at_rename_after_creation = True

    security = ClassSecurityInfo()

    def getParticipants(self):
        """Gets the participants.
        """
        parent = self.getExtropyParent()