merge branch master
This commit is contained in:
commit
27720799f8
10 changed files with 134 additions and 24 deletions
|
@ -263,6 +263,9 @@ class EditConceptPage(EditConceptForm):
|
||||||
super(EditConceptPage, self).setupController()
|
super(EditConceptPage, self).setupController()
|
||||||
self.registerDojoFormAll()
|
self.registerDojoFormAll()
|
||||||
|
|
||||||
|
def getActions(self, category='object', page=None, target=None):
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
class CreateObjectForm(ObjectForm):
|
class CreateObjectForm(ObjectForm):
|
||||||
|
|
||||||
|
@ -449,6 +452,9 @@ class CreateConceptPage(CreateConceptForm):
|
||||||
super(CreateConceptPage, self).setupController()
|
super(CreateConceptPage, self).setupController()
|
||||||
self.registerDojoFormAll()
|
self.registerDojoFormAll()
|
||||||
|
|
||||||
|
def getActions(self, category='object', page=None, target=None):
|
||||||
|
return []
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def nextUrl(self):
|
def nextUrl(self):
|
||||||
return self.getUrlForTarget(self.virtualTargetObject)
|
return self.getUrlForTarget(self.virtualTargetObject)
|
||||||
|
|
Binary file not shown.
|
@ -296,6 +296,30 @@ msgstr "Besprechungsprotokoll für dieses Objekt anzeigen."
|
||||||
msgid "Download Meeting Minutes"
|
msgid "Download Meeting Minutes"
|
||||||
msgstr "Besprechungsprotokoll generieren"
|
msgstr "Besprechungsprotokoll generieren"
|
||||||
|
|
||||||
|
msgid "Participants"
|
||||||
|
msgstr "Teilnehmer"
|
||||||
|
|
||||||
|
msgid "The names of the persons taking part in the event."
|
||||||
|
msgstr "Die Namen der Personen, die an der Besprechung teilnehmen."
|
||||||
|
|
||||||
|
msgid "label_responsible"
|
||||||
|
msgstr "Vortragender"
|
||||||
|
|
||||||
|
msgid "desc_responsible"
|
||||||
|
msgstr "Person, die diesen Tagesordnungpunkt vertritt."
|
||||||
|
|
||||||
|
msgid "label_discussion"
|
||||||
|
msgstr "Diskussion"
|
||||||
|
|
||||||
|
msgid "desc_discussion"
|
||||||
|
msgstr "Diskussion"
|
||||||
|
|
||||||
|
msgid "label_consequences"
|
||||||
|
msgstr "Schlussfolgerungen"
|
||||||
|
|
||||||
|
msgid "desc_consequences"
|
||||||
|
msgstr "Schlussfolgerungen"
|
||||||
|
|
||||||
msgid "Task/Action"
|
msgid "Task/Action"
|
||||||
msgstr "Aufgabe"
|
msgstr "Aufgabe"
|
||||||
|
|
||||||
|
|
|
@ -281,6 +281,7 @@ class CreateFollowUpEventForm(CreateConceptPage, MeetingMinutes):
|
||||||
data = self.getData()
|
data = self.getData()
|
||||||
data['title'] = self.baseEvent.title
|
data['title'] = self.baseEvent.title
|
||||||
data['description'] = self.baseEvent.description
|
data['description'] = self.baseEvent.description
|
||||||
|
data['participants'] = self.baseEvent.participants
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def results(self):
|
def results(self):
|
||||||
|
@ -316,7 +317,6 @@ class CreateFollowUpEvent(CreateConcept, BaseFollowUpController):
|
||||||
result = super(CreateFollowUpEvent, self).update()
|
result = super(CreateFollowUpEvent, self).update()
|
||||||
form = self.request.form
|
form = self.request.form
|
||||||
toBeAssigned = form.get('cb_select_tasks') or []
|
toBeAssigned = form.get('cb_select_tasks') or []
|
||||||
print '***', toBeAssigned
|
|
||||||
for uid in toBeAssigned:
|
for uid in toBeAssigned:
|
||||||
task = util.getObjectForUid(uid)
|
task = util.getObjectForUid(uid)
|
||||||
self.createFollowUpTask(adapted(task))
|
self.createFollowUpTask(adapted(task))
|
||||||
|
@ -333,8 +333,9 @@ class CreateFollowUpEvent(CreateConcept, BaseFollowUpController):
|
||||||
conceptType=taskType,
|
conceptType=taskType,
|
||||||
title=source.title,
|
title=source.title,
|
||||||
description=source.description,
|
description=source.description,
|
||||||
start=source.start,
|
responsible=source.start,
|
||||||
end=source.end)
|
discussion=source.discussion,
|
||||||
|
consequences=source.consequences)
|
||||||
stask.assignChild(newTask, self.followsPredicate)
|
stask.assignChild(newTask, self.followsPredicate)
|
||||||
for rel in stask.getParentRelations():
|
for rel in stask.getParentRelations():
|
||||||
if rel.predicate != self.view.typePredicate:
|
if rel.predicate != self.view.typePredicate:
|
||||||
|
|
|
@ -39,6 +39,26 @@
|
||||||
set_schema="loops.organize.interfaces.ITask" />
|
set_schema="loops.organize.interfaces.ITask" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
|
<zope:adapter factory="loops.organize.task.Event"
|
||||||
|
provides="loops.organize.interfaces.IEvent"
|
||||||
|
trusted="True" />
|
||||||
|
<zope:class class="loops.organize.task.Event">
|
||||||
|
<require permission="zope.View"
|
||||||
|
interface="loops.organize.interfaces.IEvent" />
|
||||||
|
<require permission="zope.ManageContent"
|
||||||
|
set_schema="loops.organize.interfaces.IEvent" />
|
||||||
|
</zope:class>
|
||||||
|
|
||||||
|
<zope:adapter factory="loops.organize.task.AgendaItem"
|
||||||
|
provides="loops.organize.interfaces.IAgendaItem"
|
||||||
|
trusted="True" />
|
||||||
|
<zope:class class="loops.organize.task.AgendaItem">
|
||||||
|
<require permission="zope.View"
|
||||||
|
interface="loops.organize.interfaces.IAgendaItem" />
|
||||||
|
<require permission="zope.ManageContent"
|
||||||
|
set_schema="loops.organize.interfaces.IAgendaItem" />
|
||||||
|
</zope:class>
|
||||||
|
|
||||||
<zope:adapter factory="loops.organize.party.HasRole"
|
<zope:adapter factory="loops.organize.party.HasRole"
|
||||||
provides="loops.organize.interfaces.IHasRole"
|
provides="loops.organize.interfaces.IHasRole"
|
||||||
trusted="True" />
|
trusted="True" />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2012 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Interfaces for organizational stuff like persons and addresses.
|
Interfaces for organizational stuff like persons and addresses.
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.interface import Interface, Attribute
|
from zope.interface import Interface, Attribute
|
||||||
|
@ -156,13 +154,46 @@ class IMemberRegistrationManager(Interface):
|
||||||
current password.
|
current password.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# task
|
# task management, meeting minutes: task, event, agenda item
|
||||||
|
|
||||||
class ITask(IConceptSchema, ITask, ILoopsAdapter):
|
class ITask(IConceptSchema, ITask, ILoopsAdapter):
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class IEvent(ITask):
|
||||||
|
|
||||||
|
participants = schema.Text(
|
||||||
|
title=_(u'Participants'),
|
||||||
|
description=_(u'The names of the persons taking part in the event.'),
|
||||||
|
default=u'',
|
||||||
|
missing_value=u'',
|
||||||
|
required=False)
|
||||||
|
|
||||||
|
|
||||||
|
class IAgendaItem(ILoopsAdapter):
|
||||||
|
|
||||||
|
responsible = schema.TextLine(
|
||||||
|
title=_(u'label_responsible'),
|
||||||
|
description=_(u'desc_responsible.'),
|
||||||
|
default=u'',
|
||||||
|
required=False)
|
||||||
|
|
||||||
|
discussion = schema.Text(
|
||||||
|
title=_(u'label_discussion'),
|
||||||
|
description=_(u'desc_discussion.'),
|
||||||
|
default=u'',
|
||||||
|
missing_value=u'',
|
||||||
|
required=False)
|
||||||
|
|
||||||
|
concequences = schema.Text(
|
||||||
|
title=_(u'label_consequences'),
|
||||||
|
description=_(u'desc_consequences.'),
|
||||||
|
default=u'',
|
||||||
|
missing_value=u'',
|
||||||
|
required=False)
|
||||||
|
|
||||||
|
|
||||||
# 'hasrole' predicate
|
# 'hasrole' predicate
|
||||||
|
|
||||||
class IHasRole(IRelationAdapter):
|
class IHasRole(IRelationAdapter):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2012 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,23 +17,22 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Adapters for IConcept providing interfaces from the cybertools.organize package.
|
Adapters for IConcept providing interfaces from the
|
||||||
|
cybertools.organize package.
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from time import mktime
|
from time import mktime
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
|
|
||||||
from loops.organize.interfaces import ITask
|
from loops.organize.interfaces import ITask, IEvent, IAgendaItem
|
||||||
from loops.interfaces import IConcept
|
from loops.interfaces import IConcept
|
||||||
from loops.interfaces import IIndexAttributes
|
from loops.interfaces import IIndexAttributes
|
||||||
from loops.common import AdapterBase
|
from loops.common import AdapterBase
|
||||||
from loops.type import TypeInterfaceSourceList
|
from loops.type import TypeInterfaceSourceList
|
||||||
|
|
||||||
|
|
||||||
TypeInterfaceSourceList.typeInterfaces += (ITask,)
|
TypeInterfaceSourceList.typeInterfaces += (ITask, IEvent, IAgendaItem)
|
||||||
|
|
||||||
|
|
||||||
class Task(AdapterBase):
|
class Task(AdapterBase):
|
||||||
|
@ -42,10 +41,29 @@ class Task(AdapterBase):
|
||||||
|
|
||||||
implements(ITask)
|
implements(ITask)
|
||||||
|
|
||||||
_adapterAttributes = ('context', '__parent__',)
|
_adapterAttributes = AdapterBase._adapterAttributes
|
||||||
_contextAttributes = list(ITask)
|
_contextAttributes = list(ITask)
|
||||||
|
|
||||||
|
|
||||||
|
class Event(Task):
|
||||||
|
""" A scheduled event or appointment.
|
||||||
|
"""
|
||||||
|
|
||||||
|
implements(IEvent)
|
||||||
|
|
||||||
|
_contextAttributes = list(IEvent)
|
||||||
|
|
||||||
|
|
||||||
|
class AgendaItem(AdapterBase):
|
||||||
|
""" Some topic (a sort of task) that is discussed during an event.
|
||||||
|
"""
|
||||||
|
|
||||||
|
implements(IAgendaItem)
|
||||||
|
|
||||||
|
_adapterAttributes = AdapterBase._adapterAttributes
|
||||||
|
_contextAttributes = list(IAgendaItem)
|
||||||
|
|
||||||
|
|
||||||
class IndexAttributes(object):
|
class IndexAttributes(object):
|
||||||
|
|
||||||
implements(IIndexAttributes)
|
implements(IIndexAttributes)
|
||||||
|
|
|
@ -24,8 +24,9 @@ from cybertools.util.jeep import Jeep
|
||||||
from loops.common import adapted
|
from loops.common import adapted
|
||||||
from loops.concept import Concept
|
from loops.concept import Concept
|
||||||
from loops.organize.interfaces import IPerson, IHasRole
|
from loops.organize.interfaces import IPerson, IHasRole
|
||||||
|
from loops.organize.interfaces import IEvent, IAgendaItem
|
||||||
from loops.organize.party import Person, HasRole
|
from loops.organize.party import Person, HasRole
|
||||||
from loops.organize.task import Task
|
from loops.organize.task import Task, Event, AgendaItem
|
||||||
from loops.setup import addAndConfigureObject
|
from loops.setup import addAndConfigureObject
|
||||||
from loops.tests.auth import login
|
from loops.tests.auth import login
|
||||||
|
|
||||||
|
@ -37,6 +38,8 @@ def setupUtilitiesAndAdapters(loopsRoot):
|
||||||
component.provideUtility(principalAnnotations, IPrincipalAnnotationUtility)
|
component.provideUtility(principalAnnotations, IPrincipalAnnotationUtility)
|
||||||
component.provideAdapter(Person, provides=IPerson)
|
component.provideAdapter(Person, provides=IPerson)
|
||||||
component.provideAdapter(Task)
|
component.provideAdapter(Task)
|
||||||
|
component.provideAdapter(Event, provides=IEvent)
|
||||||
|
component.provideAdapter(AgendaItem, provides=IAgendaItem)
|
||||||
component.provideAdapter(FoundPrincipalFactory)
|
component.provideAdapter(FoundPrincipalFactory)
|
||||||
component.provideAdapter(HasRole, provides=IHasRole)
|
component.provideAdapter(HasRole, provides=IHasRole)
|
||||||
return Jeep((
|
return Jeep((
|
||||||
|
|
|
@ -242,14 +242,19 @@ and recording information about the tasks.
|
||||||
|
|
||||||
Let's start with creating an a event and assigning it a task.
|
Let's start with creating an a event and assigning it a task.
|
||||||
|
|
||||||
>>> from loops.organize.interfaces import ITask
|
>>> from loops.organize.interfaces import IEvent, IAgendaItem
|
||||||
>>> tEvent = addAndConfigureObject(concepts, Concept, 'event',
|
>>> tEvent = addAndConfigureObject(concepts, Concept, 'event',
|
||||||
... title=u'Event', conceptType=concepts.getTypeConcept(),
|
... title=u'Event', conceptType=concepts.getTypeConcept(),
|
||||||
... typeInterface=ITask)
|
... typeInterface=IEvent)
|
||||||
|
>>> tAgendaItem = addAndConfigureObject(concepts, Concept, 'agendaitem',
|
||||||
|
... title=u'AgendaItem', conceptType=concepts.getTypeConcept(),
|
||||||
|
... typeInterface=IEvent)
|
||||||
|
|
||||||
>>> ev01 = addAndConfigureObject(concepts, Concept, 'ev01',
|
>>> ev01 = addAndConfigureObject(concepts, Concept, 'ev01',
|
||||||
... title=u'loops Meeting', conceptType=tEvent)
|
... title=u'loops Meeting', conceptType=tEvent)
|
||||||
>>> ev01.assignChild(task01)
|
>>> aitem01 = addAndConfigureObject(concepts, Concept, 'aitem01',
|
||||||
|
... title=u'Documentation of Features', conceptType=tAgendaItem)
|
||||||
|
>>> ev01.assignChild(aitem01)
|
||||||
|
|
||||||
Now we create the meeting minutes report. We assign the event type as a
|
Now we create the meeting minutes report. We assign the event type as a
|
||||||
child in order to provide the information for which types of objects the
|
child in order to provide the information for which types of objects the
|
||||||
|
@ -259,9 +264,9 @@ report is available.
|
||||||
>>> component.provideAdapter(MeetingMinutes, provides=IReportInstance,
|
>>> component.provideAdapter(MeetingMinutes, provides=IReportInstance,
|
||||||
... name='meeting_minutes')
|
... name='meeting_minutes')
|
||||||
|
|
||||||
>>> meetingMinutes = addAndConfigureObject(concepts, Concept, 'meeting_minutes',
|
>>> meetingMinutes = addAndConfigureObject(concepts, Concept,
|
||||||
... title=u'Meeting Minutes', conceptType=tReport,
|
... 'meeting_minutes', title=u'Meeting Minutes', conceptType=tReport,
|
||||||
... reportType='meeting_minutes')
|
... reportType='meeting_minutes')
|
||||||
>>> meetingMinutes.assignChild(tEvent, hasReport)
|
>>> meetingMinutes.assignChild(tEvent, hasReport)
|
||||||
|
|
||||||
We can now access the report using a corresponding report-based view.
|
We can now access the report using a corresponding report-based view.
|
||||||
|
@ -277,7 +282,8 @@ We can now access the report using a corresponding report-based view.
|
||||||
... for col in reportView.displayedColumns:
|
... for col in reportView.displayedColumns:
|
||||||
... print col.getDisplayValue(row),
|
... print col.getDisplayValue(row),
|
||||||
... print
|
... print
|
||||||
{'url': 'http://127.0.0.1/loops/views/home/.36', 'title': u'loops Development'}
|
{'url': 'http://127.0.0.1/loops/views/home/.58',
|
||||||
|
'title': u'Documentation of Features'}
|
||||||
<cybertools.composer.report.result.ResultSet object ...>
|
<cybertools.composer.report.result.ResultSet object ...>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -371,6 +371,7 @@ class MeetingMinutes(WorkReportInstance):
|
||||||
tasks, taskTitle, taskDescription, workItems))
|
tasks, taskTitle, taskDescription, workItems))
|
||||||
defaultOutputFields = fields
|
defaultOutputFields = fields
|
||||||
states = ('planned', 'accepted', 'done', 'done_x', 'finished')
|
states = ('planned', 'accepted', 'done', 'done_x', 'finished')
|
||||||
|
taskTypeNames = ('agendaitem',)
|
||||||
|
|
||||||
def selectObjects(self, parts):
|
def selectObjects(self, parts):
|
||||||
return [adapted(t) for t in self.getTasks(parts)[1:]]
|
return [adapted(t) for t in self.getTasks(parts)[1:]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue