Exemple #1
0
    def getEventTypeName(self, key):
        mp = getToolByName(self, 'portal_properties')
        event_types_pro = mp.monet_calendar_event_properties.event_types
        event_types = DisplayList()
        for etype in event_types_pro:
            event_types.add(etype, _(etype))

        return event_types.getValue(key)
 def getEventTypeName(self,key):
     mp = getToolByName(self,'portal_properties')
     event_types_pro = mp.monet_calendar_event_properties.event_types
     event_types = DisplayList()
     for etype in event_types_pro:
         event_types.add(etype,_(etype))
     
     return event_types.getValue(key)
 def getSlotsName(self,key):
     mp = getToolByName(self,'portal_properties')
     
     special_event_types_pro = mp.monet_calendar_event_properties.special_event_types
     special_event_types = DisplayList()
     for etype in special_event_types_pro:
         special_event_types.add(etype,_(etype))
     
     return (key in special_event_types) and special_event_types.getValue(key) or SlotsVocab[key]
Exemple #4
0
    def getSlotsName(self, key):
        mp = getToolByName(self, 'portal_properties')

        special_event_types_pro = mp.monet_calendar_event_properties.special_event_types
        special_event_types = DisplayList()
        for etype in special_event_types_pro:
            special_event_types.add(etype, _(etype))

        return (key in special_event_types
                ) and special_event_types.getValue(key) or SlotsVocab[key]
Exemple #5
0
    def getManagersVocab(self, strict=False):
        """
        Get the managers available as a DisplayList. The first item is 'None',
        with a key of '(UNASSIGNED)'.

        Note, we now also allow Technicians here, unless we are called
        with 'strict' is True.
        """
        tracker = self.getTracker()
        vocab = DisplayList()
        #vocab.add('(UNASSIGNED)', _(u'None'))
        for item in tracker.getManagers():
            vocab.add(item, item)
        if not strict:
            for item in tracker.getTechnicians():
                vocab.add(item, item)

        L = []
        for iten in vocab:
            L.append({'id':iten,'label':vocab.getValue(iten)})

        return L