diff --git a/tabellio/agenda/burevent.py b/tabellio/agenda/burevent.py new file mode 100644 index 0000000..dc39dec --- /dev/null +++ b/tabellio/agenda/burevent.py @@ -0,0 +1,20 @@ +from zope import schema +from zope.interface import implements +from z3c.relationfield.schema import RelationChoice + +from plone.formwidget.contenttree import ObjPathSourceBinder + +from tabellio.agenda.interfaces import MessageFactory as _ +from parlevent import IParlEvent, ParlEvent + + +class IBurEvent(IParlEvent): + pass + + +class BurEvent(ParlEvent): + implements(IBurEvent) + + def klass(self): + return 'bureau-event' + diff --git a/tabellio/agenda/event.py b/tabellio/agenda/event.py index cdebf36..4b400c6 100644 --- a/tabellio/agenda/event.py +++ b/tabellio/agenda/event.py @@ -115,7 +115,10 @@ class EventBaseView: start = self.context.start if portal_type is None: - portal_type = ('tabellio.agenda.parlevent', 'tabellio.agenda.comevent') + portal_type = ('tabellio.agenda.parlevent', + 'tabellio.agenda.comevent', + 'tabellio.agenda.burevent', + ) monthly_view = MonthlyView(self.context, init_calendar=True) serie_of_events = monthly_view.get_events_from_catalog( @@ -135,7 +138,11 @@ class EventBaseView: start = self.context.start - datetime.timedelta(100) if portal_type is None: - portal_type = ('tabellio.agenda.event', 'tabellio.agenda.parlevent', 'tabellio.agenda.comevent') + portal_type = ('tabellio.agenda.event', + 'tabellio.agenda.parlevent', + 'tabellio.agenda.comevent', + 'tabellio.agenda.burevent' + ) monthly_view = MonthlyView(self.context, init_calendar=True) serie_of_events = monthly_view.get_events_from_catalog( diff --git a/tabellio/agenda/folder.py b/tabellio/agenda/folder.py index 2bdacdf..dbd0ccc 100644 --- a/tabellio/agenda/folder.py +++ b/tabellio/agenda/folder.py @@ -34,8 +34,9 @@ class AgendaSelectorVocabulary(object): def __call__(self, context): values = [('all', _(u'All events')), ('parlevent', _(u'Parlementary Events')), + ('burevent', _(u'Bureau Events')), ('comevent', _(u'Commission Events')), - ('parlcomevent', _(u'Parlmentary and Commission Events')), + ('parlcomevent', _(u'Parlmentary, Commission and Bureau Events')), ('genevent', _(u'General Events'))] terms = [] for key, value in values: @@ -89,25 +90,35 @@ class View(grok.View, utils.MonthlyView): return ['parl'] elif self.context.selector == 'comevent': return ['com'] + elif self.context.selector == 'burevent': + return ['bur'] elif self.context.selector == 'genevent': return ['gen'] elif self.context.selector == 'parlcomevent': - return ['parl', 'com'] + return ['parl', 'com', 'bur'] else: - return ['parl', 'com', 'gen'] + return ['parl', 'com', 'bur', 'gen'] def get_events_from_catalog(self, start, end, **keywords): if self.context.selector == 'parlevent': portal_type = ['tabellio.agenda.parlevent'] elif self.context.selector == 'comevent': portal_type = ['tabellio.agenda.comevent'] + elif self.context.selector == 'burevent': + portal_type = ['tabellio.agenda.burevent'] elif self.context.selector == 'genevent': portal_type = ['tabellio.agenda.event'] elif self.context.selector == 'parlcomevent': - portal_type = ['tabellio.agenda.parlevent', 'tabellio.agenda.comevent'] + portal_type = ['tabellio.agenda.parlevent', + 'tabellio.agenda.comevent', + 'tabellio.agenda.burevent', + ] else: - portal_type = ['tabellio.agenda.event', 'tabellio.agenda.parlevent', - 'tabellio.agenda.comevent'] + portal_type = ['tabellio.agenda.event', + 'tabellio.agenda.parlevent', + 'tabellio.agenda.burevent', + 'tabellio.agenda.comevent', + ] return utils.MonthlyView.get_events_from_catalog(self, start, end, portal_type=portal_type, **keywords) diff --git a/tabellio/agenda/folder_templates/view.pt b/tabellio/agenda/folder_templates/view.pt index 376c17f..29fa8bf 100644 --- a/tabellio/agenda/folder_templates/view.pt +++ b/tabellio/agenda/folder_templates/view.pt @@ -114,6 +114,7 @@