provide separate interfaces and type concepts for events and agenda items, e.g. for improving meeting minutes
This commit is contained in:
		
							parent
							
								
									944bb0e308
								
							
						
					
					
						commit
						142e1cb20b
					
				
					 9 changed files with 87 additions and 23 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							|  | @ -3,7 +3,7 @@ msgstr "" | ||||||
| 
 | 
 | ||||||
| "Project-Id-Version: $Id$\n" | "Project-Id-Version: $Id$\n" | ||||||
| "POT-Creation-Date: 2007-05-22 12:00 CET\n" | "POT-Creation-Date: 2007-05-22 12:00 CET\n" | ||||||
| "PO-Revision-Date: 2012-06-10 12:00 CET\n" | "PO-Revision-Date: 2012-07-17 12:00 CET\n" | ||||||
| "Last-Translator: Helmut Merz <helmutm@cy55.de>\n" | "Last-Translator: Helmut Merz <helmutm@cy55.de>\n" | ||||||
| "Language-Team: loops developers <helmutm@cy55.de>\n" | "Language-Team: loops developers <helmutm@cy55.de>\n" | ||||||
| "MIME-Version: 1.0\n" | "MIME-Version: 1.0\n" | ||||||
|  | @ -296,6 +296,9 @@ 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 "Task/Action" | msgid "Task/Action" | ||||||
| msgstr "Aufgabe" | msgstr "Aufgabe" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -316,7 +316,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)) | ||||||
|  |  | ||||||
|  | @ -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,29 @@ 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): | ||||||
|  | 
 | ||||||
|  |     pass | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| # '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